{"id":18257912,"url":"https://github.com/linkdd/tcp2canopsis","last_synced_at":"2025-04-08T22:46:52.182Z","repository":{"id":24203045,"uuid":"27594485","full_name":"linkdd/tcp2canopsis","owner":"linkdd","description":"This package provides a Canopsis connector which listen for events on a TCP port.","archived":false,"fork":false,"pushed_at":"2015-10-06T08:51:56.000Z","size":283,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-17T08:07:13.122Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://linkdd.github.com/tcp2canopsis","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linkdd.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-05T14:17:37.000Z","updated_at":"2018-11-09T11:32:13.000Z","dependencies_parsed_at":"2022-08-22T14:30:32.281Z","dependency_job_id":null,"html_url":"https://github.com/linkdd/tcp2canopsis","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkdd%2Ftcp2canopsis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkdd%2Ftcp2canopsis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkdd%2Ftcp2canopsis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkdd%2Ftcp2canopsis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linkdd","download_url":"https://codeload.github.com/linkdd/tcp2canopsis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247941719,"owners_count":21022037,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T10:28:08.025Z","updated_at":"2025-04-08T22:46:52.156Z","avatar_url":"https://github.com/linkdd.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"TCP to Canopsis connector\n=========================\n\n.. image:: https://travis-ci.org/linkdd/tcp2canopsis.svg?branch=master\n\n\nThis package provides a connector which listen for events on a TCP port.\n\nUsage\n-----\n\nRun the script on a designated port (``8000`` in this example) and with the URL\nof the AMQP server:\n\n.. code-block::\n\n   $ tcp2canopsis -p 8000 -a \"amqp://guest:guest@localhost:5672/\" -t token\n\nThen use ``telnet`` to publish events:\n\n.. code-block::\n\n   $ telnet localhost 8000\n   Trying ::1...\n   Connected to localhost.\n   Escape character is '^]'.\n   token\n   {\"connector\": \"test\", \"connector_name\": \"testname\", \"event_type\": \"check\", \"source_type\": \"resource\", \"component\": \"testcmp\", \"resource\": \"testrsrc\", \"state\": 0, \"output\": \"test output\"}\n   {\"connector\": \"test\", \"connector_name\": \"testname\", \"event_type\": \"check\", \"source_type\": \"resource\", \"component\": \"testcmp\", \"resource\": \"testrsrc\", \"state\": 1, \"output\": \"test output 2\"}\n   {\"connector\": \"test\", \"connector_name\": \"testname\", \"event_type\": \"check\", \"source_type\": \"resource\", \"component\": \"testcmp\", \"resource\": \"testrsrc\", \"state\": 0, \"output\": \"test output 3\"}\n   Connection closed by foreign host.\n\nOr in a JSON file:\n\n.. code-block:: javascript\n\n   {\"tcp2canopsis\": {\n       \"port\": 8000,\n       \"amqp\": \"amqp://guest:guest@localhost:5672/\",\n       \"token\": \"token\"\n   }}\n\nAnd load the file using:\n\n.. code-block::\n\n   $ tcp2canopsis -c path/to/config.json\n\n\nConfiguration keys\n------------------\n\n - ``port``: AMQP port\n - ``amqp``: AMQP URI\n - ``token``: authentication token\n - ``realroute``: ``amqp`` or ``devnull``. ``devnull`` just ignore events\n\nSSL\n---\n\nIf using configuration via command line, use those options:\n\n.. code-block::\n\n   $ tcp2canopsis --ssl-cert server.pem --ssl-key server.key\n\n*NB: other options are still mandatory*\n\nOr via the configuration file:\n\n.. code-block:: javascript\n\n   {\"tcp2canopsis\": {\n       \"port\": 8000,\n       \"amqp\": \"amqp://guest:guest@localhost:5672/\",\n       \"token\": \"token\",\n       \"ssl-cert\": \"server.pem\",\n       \"ssl-key\": \"server.key\"\n   }}\n\nThen, instead of ``telnet``, use this command to test the connector:\n\n.. code-block::\n\n   $ openssl s_client -quiet -connect localhost:8000 -CAfile ca.pem -crlf\n   testtoken\n   {\"connector\": \"test\", \"connector_name\": \"testname\", \"event_type\": \"check\", \"source_type\": \"resource\", \"component\": \"testcmp\", \"resource\": \"testrsrc\", \"state\": 0, \"output\": \"test output\"}\n\n\nInstallation\n------------\n\nJust type:\n\n.. code-block::\n\n   $ pip install tcp2canopsis\n\nOr, to install it in a locally:\n\n.. code-block::\n\n   $ ./makefile\n\nThis will create a virtual Python environment in the current folder, and install the dependencies listed by ``requirements.txt``.\nFinally, it will perform a ``python setup.py install``.\n\nAfter executing this script, the connector will be available in the current folder (which is now a virtual Python environment).\n\nConnector on boot\n-----------------\n\nCentOS\n++++++\n\nCopy the initscript and add the configuration file:\n\n.. code-block::\n\n   $ cp contrib/tcp2canopsis.init.centos.sh /etc/init.d/tcp2canopsis\n   $ cat \u003e /etc/sysconfig/tcp2canopsis \u003c\u003c \"EOF\"\n   CONNECTOR_DIR=\"/path/to/tcp2canopsis/virtualenv\"\n   EOF\n\nDebian\n++++++\n\nTODO\n\nsystemd\n+++++++\n\nTODO\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkdd%2Ftcp2canopsis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinkdd%2Ftcp2canopsis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkdd%2Ftcp2canopsis/lists"}