{"id":15532832,"url":"https://github.com/tito/snmp2canopsis","last_synced_at":"2025-03-20T04:08:41.716Z","repository":{"id":28591035,"uuid":"32109229","full_name":"tito/snmp2canopsis","owner":"tito","description":"SNMP trap daemon for Canopsis / AMQP","archived":false,"fork":false,"pushed_at":"2015-05-28T06:42:57.000Z","size":233,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-25T05:44:24.995Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/tito.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-12T23:35:57.000Z","updated_at":"2016-11-07T20:46:16.000Z","dependencies_parsed_at":"2022-09-11T22:10:52.401Z","dependency_job_id":null,"html_url":"https://github.com/tito/snmp2canopsis","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tito%2Fsnmp2canopsis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tito%2Fsnmp2canopsis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tito%2Fsnmp2canopsis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tito%2Fsnmp2canopsis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tito","download_url":"https://codeload.github.com/tito/snmp2canopsis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244547605,"owners_count":20470103,"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-10-02T11:33:20.717Z","updated_at":"2025-03-20T04:08:41.696Z","avatar_url":"https://github.com/tito.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SNMP trap daemon for Canopsis / AMQP\n\n`snmp2canopsis` is a daemon that listen to SNMP trap and send them into\nthe Canopsis/AMQP.\n\n\n## Installation\n\nStable version (not published yet):\n\n    pip install snmp2canopsis\n\nDevelopment version:\n\n    pip install https://github.com/tito/snmp2canopsis\n\n\n## Usage\n\nSince the tool need to listen the SNMP trap port, you'll need to execute it\nwith root permission:\n\n    $ sudo snmp2canopsis\n\nCreate a configuration file named \"/etc/snmp2canopsis.conf\":\n\n    [snmp]\n    ip = 127.0.0.1\n    port = 162\n\n    [amqp]\n    host = localhost\n    port = 5672\n    user = guest\n    password = guest\n    vhost = amqp\n    exchange = amqp.events\n\nThen you can start with a predefined configuration:\n\n    $ sudo snmp2canopsis -c snmp2canopsis.conf\n\nOtherwise, you can go manually:\n\n    $ snmp2canopsis --help\n    usage: snmp2canopsis [-h] [-p [PORT]] [-l [IP]] [-H [AMQP_HOST]] [-P [AMQP_PORT]]\n                     [-U [AMQP_USER]] [-W [AMQP_PASSWORD]] [-V [AMQP_VHOST]]\n                     [-E [AMQP_EXCHANGE]] [-c [CONFIG]]\n\n    Send SNMP trap to amqp\n\n    optional arguments:\n      -h, --help            show this help message and exit\n      -p [PORT], --port [PORT]\n                            SNMP port to listen\n      -l [IP], --ip [IP]    SNMP ip to listen (0.0.0.0 for all)\n      -H [AMQP_HOST], --amqp-host [AMQP_HOST]\n                            AMQP hostname\n      -P [AMQP_PORT], --amqp-port [AMQP_PORT]\n                            AMQP port\n      -U [AMQP_USER], --amqp-user [AMQP_USER]\n                            AMQP user\n      -W [AMQP_PASSWORD], --amqp-password [AMQP_PASSWORD]\n                            AMQP password\n      -V [AMQP_VHOST], --amqp-vhost [AMQP_VHOST]\n                            AMQP vhost\n      -E [AMQP_EXCHANGE], --amqp-exchange [AMQP_EXCHANGE]\n                            AMQP exchange\n      -c [CONFIG], --config [CONFIG]\n                            Configuration file\n\nA daemon management is also included, you can start it with:\n\n    $ snmp2canopsis --daemon\n    [2015-03-21 10:01:30.654804] INFO: snmp2canopsis: Read configuration from /etc/snmp2canopsis.conf\n    Starting...\n\n    $ snmp2canopsis --status\n    [2015-03-21 10:01:57.394623] INFO: snmp2canopsis: Read configuration from /etc/snmp2canopsis.conf\n    Process (pid 22688) is running...\n\n    $ snmp2canopsis --kill\n    [2015-03-21 10:02:00.773632] INFO: snmp2canopsis: Read configuration from /etc/snmp2canopsis.conf\n    Stopping...\n    Stopped\n\n\n## Process management (ala nagios)\n\nA script is included to allow to start/stop the process, and manage\nconfiguration (start, stop, getState, getConf, setConf).\n\n    # cat-snmp2canopsis status\n    {\"connector\": \"0\"}\n    # cat-snmp2canopsis start\n    {\"connector\": \"1\"}\n    # cat-snmp2canopsis getState\n    {\"connector\": \"1\"}\n    # cat-snmp2canopsis getConf\n    {\"host\": \"localhost\", \"version\": \"0.2\", \"virtual_host\": \"canopsis\",\n     \"snmp_port\": \"162\", \"snmp_ip\": \"0.0.0.0\",\n     \"exchange_name\": \"canopsis.snmp\", \"password\": \"guest\",\n     \"userid\": \"guest\", \"port\": \"5672\"}\n    # cat-snmp2canopsis stop\n    {\"connector\": \"0\"}\n\n\n## Test trap (incomplete)\n\n    $ snmptrap -v 1 -c public localhost IF-MIB:linkDown localhost 2 0 '' \\\n      ifIndex i 1 ifAdminStatus i 2 ifOperStatus i 2\n\n    $ snmptrap -v 2c -c public localhost '' IF-MIB:linkDown \\\n      ifIndex i 1 ifAdminStatus i 2 ifOperStatus i 2\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftito%2Fsnmp2canopsis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftito%2Fsnmp2canopsis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftito%2Fsnmp2canopsis/lists"}