Skip to main content

Canopsis Connector which listen for JSON events on TCP port

Project description

https://travis-ci.org/linkdd/tcp2canopsis.svg?branch=master

This package provides a connector which listen for events on a TCP port.

Usage

Run the script on a designated port (8000 in this example) and with the URL of the AMQP server :

$ tcp2canopsis -p 8000 -a "amqp://guest:guest@localhost:5672/" -t token

Then use telnet to publish events :

$ telnet localhost 8000
Trying ::1...
Connected to localhost.
Escape character is '^]'.
token
{"connector": "test", "connector_name": "testname", "event_type": "check", "source_type": "resource", "component": "testcmp", "resource": "testrsrc", "state": 0, "output": "test output"}
{"connector": "test", "connector_name": "testname", "event_type": "check", "source_type": "resource", "component": "testcmp", "resource": "testrsrc", "state": 1, "output": "test output 2"}
{"connector": "test", "connector_name": "testname", "event_type": "check", "source_type": "resource", "component": "testcmp", "resource": "testrsrc", "state": 0, "output": "test output 3"}
Connection closed by foreign host.

Or in a JSON file :

{"tcp2canopsis": {
    "port": 8000,
    "amqp": "amqp://guest:guest@localhost:5672/",
    "token": "token"
}}

And load the file using :

$ tcp2canopsis -c path/to/config.json

Installation

Just type :

$ pip install tcp2canopsis

Or, to install it in a locally :

$ ./makefile

This will create a virtual Python environment in the current folder, and install the dependencies listed by requirements.txt. Finally, it will perform a python setup.py install.

After executing this script, the connector will be available in the current folder (which is now a virtual Python environment).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tcp2canopsis-0.3.tar.gz (3.4 kB view details)

Uploaded Source

File details

Details for the file tcp2canopsis-0.3.tar.gz.

File metadata

  • Download URL: tcp2canopsis-0.3.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for tcp2canopsis-0.3.tar.gz
Algorithm Hash digest
SHA256 60683c3d333146a026d16f175fe0b2fb93b98c34502a7041f3b8c93807612072
MD5 4a8b0ec40fa427c71cfd10c7a1e91ca5
BLAKE2b-256 cfd54bd89b558f3136b394ab8c9bc0d457c6119d3329f5cb54fa955df5ede004

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page