{"id":13586192,"url":"https://github.com/dropbox/trapperkeeper","last_synced_at":"2025-07-14T09:10:57.112Z","repository":{"id":15146017,"uuid":"17873435","full_name":"dropbox/trapperkeeper","owner":"dropbox","description":"A suite of tools for ingesting and displaying SNMP traps.","archived":false,"fork":false,"pushed_at":"2018-02-08T21:16:54.000Z","size":236,"stargazers_count":80,"open_issues_count":11,"forks_count":26,"subscribers_count":35,"default_branch":"master","last_synced_at":"2024-04-14T06:03:44.982Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dropbox.png","metadata":{"files":{"readme":"README","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":"2014-03-18T16:38:19.000Z","updated_at":"2024-04-02T09:33:32.000Z","dependencies_parsed_at":"2022-09-24T01:40:22.847Z","dependency_job_id":null,"html_url":"https://github.com/dropbox/trapperkeeper","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/dropbox%2Ftrapperkeeper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropbox%2Ftrapperkeeper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropbox%2Ftrapperkeeper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dropbox%2Ftrapperkeeper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dropbox","download_url":"https://codeload.github.com/dropbox/trapperkeeper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223285153,"owners_count":17119845,"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-08-01T15:05:22.925Z","updated_at":"2024-11-06T04:31:10.941Z","avatar_url":"https://github.com/dropbox.png","language":"Python","funding_links":[],"categories":["Python","Tools"],"sub_categories":["CLIs"],"readme":"TrapperKeeper\n=============\n\nDescription\n-----------\n\nTrapperKeeper is a suite of tools for ingesting and displaying SNMP\ntraps. This is designed as a replacement for snmptrapd and to supplement\nexisting stateful monitoring solutions.\n\nNormally traps are stateless in nature which makes it difficult to\nmonitor with a system like nagios which requires polling a source.\nTrapperKeeper will store traps in an active state for a configured\namount of time before expiring. This makes it possible to poll the\nservice for active traps and alert off of those traps.\n\nOne example might be a humidity alert. If you cross over the humidity\nthreshold and it clears immediately you might not want to be paged at\n3am. But if it continues to send a trap every 5 minutes while it's over\nthat threshold the combination of (host, oid, severity) will remain in\nan active state as long as that trap's expiration duration is longer\nthan 5 minutes. This allows something like nagios to alarm when a single\ntrap remains active for greater than some period of time.\n\nAnother benefit is allowing aggregation of pages. Previously we'd just\nhad an e-mail to a pager per trap but now we're only paged based on the\nalert interval regardless of how many traps we receive. This also allows\nus to schedule downtime for a device during scheduled maintenance to\navoid trap storms.\n\nRequirements\n------------\n\nUbuntu\n~~~~~~\n\n.. code:: bash\n\n    $ sudo apt-get install libmysqlclient-dev libsnmp-dev\n\nInstallation\n------------\n\nNew versions will be updated to PyPI pretty regularly so it should be as\neasy as:\n\n.. code:: bash\n\n    $ pip install trapperkeeper\n\nOnce you've created a configuration file with your database information\nyou can run the following to create the database schema.\n\n.. code:: bash\n\n    $ python -m trapperkeeper.cmds.sync_db -c /path/to/trapperkeeper.yaml\n\nTools\n-----\n\ntrapperkeeper\n~~~~~~~~~~~~~\n\nThe trapperkeeper command receives SNMP traps and handles e-mailing and\nwriting to the database. An example configuration file with\ndocumentation is available `here. \u003cconf/trapperkeeper.yaml\u003e`__\n\ntrapdoor\n~~~~~~~~\n\ntrapdoor is a webserver that provides a view into the existing traps as\nwell as an API for viewing the state of traps. An example configuration\nfile with documentation is available `here. \u003cconf/trapdoor.yaml\u003e`__\n\n.. figure:: https://raw.githubusercontent.com/dropbox/trapperkeeper/master/images/trapdoor.png\n   :alt: Screenshot\n\n   Screenshot\nAPI\n^^^\n\n/api/activetraps\n''''''''''''''''\n\n**Optional Parameters:** \\* host \\* oid \\* severity\n\n**Returns:**\n\n.. code:: javascript\n\n    [\n        (\u003chost\u003e, \u003coid\u003e, \u003cseverity\u003e)\n    ]\n\n/api/varbinds/\n''''''''''''''\n\n**Returns:**\n\n.. code:: javascript\n\n    [\n        {\n            \"notification_id\": \u003cnotification_id\u003e,\n            \"name\": \u003cvarbind_name\u003e,\n            \"pretty_value\": \u003cpretty_value\u003e,\n            \"oid\": \u003coid\u003e,\n            \"value\": \u003cvalue\u003e,\n            \"value_type\": \u003cvalue_type\u003e\n        }\n    ]\n\nMIB Configuration\n-----------------\n\n``trapperkeeper`` and ``trapdoor`` use the default mibs via netsnmp. You\ncan see the default path for your system by running\n``net-snmp-config --default-mibdirs``. You can use the following\nenvironment variables usually documented in the ``snmpcmd`` man page\n\n    MIBS - The list of MIBs to load. Defaults to\n    SNMPv2-TC:SNMPv2-MIB:IF-MIB:IP-MIB:TCP-MIB:UDP-MIB:SNMP-VACM-MIB.\n\n    MIBDIRS - The list of directories to search for MIBs. Defaults to\n    /usr/share/snmp/mibs.\n\nFor example I run both the ``trapperkeeper`` and ``trapdoor`` commands\nwith the following environment to add a directory to the path and load\nall mibs.\n\n``MIBS=ALL MIBDIRS=+/usr/share/mibs/local/``\n\nTODO\n----\n\n-  Allow Custom E-mail templates for TrapperKeeper\n-  cdnjs prefix for local cdnjs mirrors\n-  User ACLs for resolution\n-  Logging resolving user\n\nKnown Issues\n------------\n\n-  Doesn't currently support SNMPv3\n-  Doesn't currently support inform\n-  Certain devices have been known to send negative TimeTicks. pyasn1\n   fails to handle this.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdropbox%2Ftrapperkeeper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdropbox%2Ftrapperkeeper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdropbox%2Ftrapperkeeper/lists"}