{"id":32481044,"url":"https://github.com/bangunindo/trap2json","last_synced_at":"2025-10-27T02:20:29.805Z","repository":{"id":179398724,"uuid":"656550244","full_name":"bangunindo/trap2json","owner":"bangunindo","description":"SNMP Trap to JSON Forwarder","archived":false,"fork":false,"pushed_at":"2025-08-21T14:45:37.000Z","size":196,"stargazers_count":42,"open_issues_count":4,"forks_count":8,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-24T10:13:49.697Z","etag":null,"topics":["json","kafka","mqtt","snmp","snmptrap","trap","zabbix","zabbix-sender"],"latest_commit_sha":null,"homepage":"","language":"Go","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/bangunindo.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-06-21T07:09:07.000Z","updated_at":"2025-10-11T21:49:20.000Z","dependencies_parsed_at":"2023-12-21T13:17:47.939Z","dependency_job_id":"5b53deab-4a46-40bc-a227-7ed74311d85c","html_url":"https://github.com/bangunindo/trap2json","commit_stats":null,"previous_names":["bangunindo/trap2json"],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/bangunindo/trap2json","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bangunindo%2Ftrap2json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bangunindo%2Ftrap2json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bangunindo%2Ftrap2json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bangunindo%2Ftrap2json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bangunindo","download_url":"https://codeload.github.com/bangunindo/trap2json/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bangunindo%2Ftrap2json/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281179365,"owners_count":26456749,"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","status":"online","status_checked_at":"2025-10-26T02:00:06.575Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["json","kafka","mqtt","snmp","snmptrap","trap","zabbix","zabbix-sender"],"created_at":"2025-10-27T02:20:29.207Z","updated_at":"2025-10-27T02:20:29.800Z","avatar_url":"https://github.com/bangunindo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Trap2JSON\nListens to SNMP Trap, converts it to json, and forwards it to zabbix, kafka,\nmqtt broker, http server or proxy it to other trap receiver.\nInternally it uses snmptrapd to listen to incoming trap message, output it\nto stdout and parse the messages. If you're familiar with how snmptrapd works,\nyou can add any configuration supported by snmptrapd.conf. Prior knowledge\nfor snmptrapd is not required as trap2json can handle common snmptrapd setup.\n\nWhile this tool can forward snmptrap to many destinations, we treat zabbix\nas the first class citizen and the main purpose for creating this tool. You\ncan use this as a solution for your distributed zabbix setup.\n\n## Features\n- Parse snmp trap messages to JSON and send to many forwarders\n- Supported forwarders\n  - File/stdout\n  - Kafka\n  - MQTT Broker\n  - SNMP Trap (like a proxy)\n  - HTTP\n  - Zabbix\n- Message filter for each forwarder\n  - Decide which messages to drop\n- Choose your own JSON schema\n- Prometheus exporter\n- Queued forwarder\n  - If the queue is full for a forwarder, the message is dropped\n  - Supports unbounded queue\n- Forwarder auto retry with exponential backoff delay\n- Supports trap/inform with version 1/2c/3 in a single endpoint\n- Correlates open/close alarms\n\n## Installation\nThe supported way of running Trap2JSON is to use docker. Docker image is available\non [dockerhub](https://hub.docker.com/r/bangunindo/trap2json).\nYou can see sample config and its explanations at [config.yml](config.yml)\n```shell\ndocker run -v ./config.yml:/etc/trap2json/config.yml -p 162:10162/udp bangunindo/trap2json:latest\n```\nThe docker image has default MIBs retrieved via snmp-mibs-downloader.\nIf you have your own MIBs, place it under `/etc/trap2json/mibs`\n```shell\ndocker run -v /path/to/mibs:/etc/trap2json/mibs -v ./config.yml:/etc/trap2json/config.yml -p 162:10162/udp bangunindo/trap2json:latest\n```\nYou might also want to adjust the timezone for better data readability\n```shell\ndocker run -e TZ=Asia/Jakarta -v ./config.yml:/etc/trap2json/config.yml -p 162:10162/udp bangunindo/trap2json:latest\n```\nOr if you want to pass extra arguments to snmptrapd\n```shell\ndocker run -v ./config.yml:/etc/trap2json/config.yml -p 162:10162/udp bangunindo/trap2json:latest -Lf /var/log/trap2json/snmptrapd.log -Dusm\n```\nThe buffer size for snmptrapd can be customized by setting `T2J_BUFFERSIZE` environment variable.\nBy default, it's set to 32M to accommodate trap2json startup time.\n```shell\ndocker run -e T2J_BUFFERSIZE=128M -v ./config.yml:/etc/trap2json/config.yml -p 162:10162/udp bangunindo/trap2json:latest\n```\n\n## Zabbix Forwarder\nFor zabbix forwarder to work, you need to create an item with Zabbix Trapper type and text/log data type. If you need\nto map the agent address to host's interface, consider using the `advanced` section of `zabbix_trapper` config in [config.yml](config.yml).\n\nZabbix limits its text/log type to 65536 characters/bytes (depending on backend). In most cases you probably will\nnot meet this limitation. But when it does, you might want to create a smaller json schema with only the data\nyou want.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbangunindo%2Ftrap2json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbangunindo%2Ftrap2json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbangunindo%2Ftrap2json/lists"}