{"id":13566623,"url":"https://github.com/phpipam/php-snmptraps","last_synced_at":"2026-01-23T06:49:17.697Z","repository":{"id":7824865,"uuid":"56589848","full_name":"phpipam/php-snmptraps","owner":"phpipam","description":"php snmptrap handler + web UI","archived":false,"fork":false,"pushed_at":"2025-01-20T08:55:14.000Z","size":2830,"stargazers_count":73,"open_issues_count":13,"forks_count":31,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-01-20T09:38:39.669Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phpipam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-19T11:07:22.000Z","updated_at":"2025-01-20T08:55:16.000Z","dependencies_parsed_at":"2022-09-20T21:51:11.965Z","dependency_job_id":null,"html_url":"https://github.com/phpipam/php-snmptraps","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/phpipam%2Fphp-snmptraps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpipam%2Fphp-snmptraps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpipam%2Fphp-snmptraps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpipam%2Fphp-snmptraps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phpipam","download_url":"https://codeload.github.com/phpipam/php-snmptraps/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247103291,"owners_count":20884023,"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-01T13:02:13.389Z","updated_at":"2026-01-23T06:49:17.668Z","avatar_url":"https://github.com/phpipam.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"## php-snmptraps\n\n###### php snmptrap handler and web UI for management\n\nphp-snmptraps is an php trpahandler that processes snmp traps, writes them to database and/or file and sends\nnotifications via sms/email/pushover to users, based on web settings.\n\nIt comes with nice HMTL5 UI:\n* Dashboard that shows overview of last messages\n* Displays messages sent by specific host\n* Displays messages per severity\n* Displays specific messages received\n* Live update of received traps\n\nand more.\n\nYou can set severity level for each received message, ignore specific message types, create maintenance periods\nfor hosts, set per-user quiet hours and more.\n\n\nNotifications are set per-user/severity, by default aupported are:\n* Email notification\n* Pushover notification\n* SMS notification\n* Slack/Mattermost notification\n\nThe can be easily extended to any other custom notification type.\n\n\n## screenshots\n\nSome sample UI screenshots can be found below:\n![Screen1](/css/screenshots/Screen1.png?raw=true \"Screen1\")\n![Screen2](/css/screenshots/Screen2.png?raw=true \"Screen2\")\n![Screen3](/css/screenshots/Screen3.png?raw=true \"Screen3\")\n![Screen4](/css/screenshots/Screen4.png?raw=true \"Screen4\")\n\n\n## setup\n\nThis guide assumes you have a working net-snmp, apache, php and mysql installation with default apache files stored\n in /var/www/.\n\n1.Set traphandler\n\nFirst, edit file `/etc/snmp/snmptrapd.conf` and add traphandler for default files to traphandler.php:\n\n```\n# listen on\nagentaddress my_ip_address:162\n# set php-snmptraps as default trap handler\ntraphandle default /usr/bin/php /var/www/traphandler.php\n```\n\n2.Prepare and edit config file\n\nNow go to /var/www/ directory and copy config.dist.php to config.php:\n```\ncp /var/www/config.dist.php /var/www/config.php\n```\nand edit the config file to match your settings.\n\n\n3.Set mod_rewrite\n\nmod_rewrite is required for snmptraps. Example here:\n\nhttp://phpipam.net/documents/prettified-links-with-mod_rewrite/\n\n4.Import database schema\n\nNow you have to import chema for mysql database with following command:\n\n```\nmysql -u root -p\nEnter password:\n\nmysql\u003e create database snmptraps;\nQuery OK, 1 row affected (0.00 sec)\n\nmysql\u003e GRANT ALL on snmptraps.* to snmptraps@localhost identified by \"snmptraps\";\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql\u003e exit\nBye\n\n# import SCHEMA.SQL file\nmysql -u root -p snmptraps \u003c db/SCHEMA.sql\n```\n\nThat should be it, fire up browser and login. Default user/pass is Admin/snmptraps.\n\n\n5.Send test message and debugging\n\nTo test snmptrap you can use the following command:\n\n```snmptrap -v 2c -c public my_public_ip '' .1.3.6.1.4.1.2636.4.1.1 .1.3.6.1.4.1.2636.4.1.1 s \"Power supply failure\"```\n\nCheck also the file you set in config.php for possible errors:\n\n```tail -f /tmp/trap.txt```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpipam%2Fphp-snmptraps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphpipam%2Fphp-snmptraps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpipam%2Fphp-snmptraps/lists"}