{"id":15026729,"url":"https://github.com/kiler129/snmp-mib-parser","last_synced_at":"2025-08-04T16:42:38.959Z","repository":{"id":57028060,"uuid":"262715327","full_name":"kiler129/snmp-mib-parser","owner":"kiler129","description":"🗄️ True SNMP MIB parser based on real Net-SNMP library","archived":false,"fork":false,"pushed_at":"2020-06-29T02:17:42.000Z","size":195,"stargazers_count":8,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T22:13:37.356Z","etag":null,"topics":["ffi","mib","mibs","netsnmp","parsing","php","php-library","php74","snmp","snmp-library"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/kiler129.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":"2020-05-10T04:58:59.000Z","updated_at":"2024-05-31T16:56:38.000Z","dependencies_parsed_at":"2022-08-23T16:30:11.806Z","dependency_job_id":null,"html_url":"https://github.com/kiler129/snmp-mib-parser","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/kiler129%2Fsnmp-mib-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiler129%2Fsnmp-mib-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiler129%2Fsnmp-mib-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiler129%2Fsnmp-mib-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kiler129","download_url":"https://codeload.github.com/kiler129/snmp-mib-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248104452,"owners_count":21048341,"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":["ffi","mib","mibs","netsnmp","parsing","php","php-library","php74","snmp","snmp-library"],"created_at":"2024-09-24T20:04:58.908Z","updated_at":"2025-04-09T20:21:42.807Z","avatar_url":"https://github.com/kiler129.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🗄️ \u003csup\u003e(the)\u003c/sup\u003e SNMP MIB Parser\n\nIf you have ever needed to deal with [SNMP](https://en.wikipedia.org/wiki/Simple_Network_Management_Protocol), and \nespecially with [SNMP in PHP](https://www.php.net/manual/en/book.snmp.php) you know how important accurate name to\nOID mappings are. This library offers that, and way more exposing **the** SNMP library - `Net-SNMP` - to PHP!\n\nIf you hated SNMP I hope this library can convince you to stop ;)\n\n## Basics\n### What's SNMP?\nSNMP is a networking protocol allowing for information exchange between hosts, think about it like a REST from 1990s. \nWhile the protocol is certainly dated it's still used everywhere... and thus available on almost all network-enabled\nhardware.  \n\nNowadays the SNMP is used mostly to pull metrics (e.g. list of devices connected to a WiFi access point, or free disk \nspace on a server)... but nobody said it cannot be used to control [your coffee pot](https://www.ietf.org/rfc/rfc2325.html)!\n\n\n### So, what are MIBs?\nMIB, or *management information base*, is a collection of textual files containing description of the data present on a\nremote system. Without these files most of the information is just a meaningless set of numbers and strings. Even worse,\nwithout MIBs you cannot request `sysUpTime.0` but `1.3.6.1.2.1.1.3.0`... yikes!\n\nMIBs installed on a system calling a remote SNMP host allow for simple querying and validation of the data. They also\ndescribe exactly WHAT can be requested from the remote system.\n\n\n\n## What this library brings?\nAlmost every *nix system comes with [`Net-SNMP`](http://net-snmp.sourceforge.net) library and [tools for it](https://wiki.debian.org/SNMP).\nFor example to see the structure describing installed disks on a Synology NAS you can use a single command to print a\nnice tree:\n\n```\n% snmptranslate -Tp 'SYNOLOGY-DISK-MIB::diskTable'\n+--diskTable(1)\n   |\n   +--diskEntry(1)\n      |  Index: diskIndex, diskStatus\n      |\n      +-- ---- Integer32 diskIndex(1)\n      |        Range: 0..2147483647\n      +-- -R-- String    diskID(2)\n      +-- -R-- String    diskModel(3)\n      +-- -R-- String    diskType(4)\n      +-- -R-- Integer32 diskStatus(5)\n      |        Range: 1..5\n      +-- -R-- Integer32 diskTemperature(6)\n```\n\nHowever, there's no programmatic access to all the information presented in that tree (and parsing it is a fragile \nnightmare). \n\n`Net-SNMP` provides everything needed, and it's **the** library for SNMP interactions \u0026 MIB parsing. Unfortunately, it's \nwritten in `C` is , it has no PHP binding. Since MIB standard is in active development for close to 35 years, pretty \nmuch there are no fully compatible options other than `Net-SNMP`.\n\n### ...but can't we use `Net-SNMP` in PHP?!\nYes! Since PHP 7.4 it's possible thanks to [FFI](https://www.php.net/manual/en/book.ffi.php). It's not easy, due to a \nton of ancient-C magic present in many places, yet possible.    \nThis library hides the complexity behind a nice object-oriented interface.\n\n![tree-example](.github/tree-example.png)\n\u003csup\u003e*(example above is included in [`examples`](examples/) directory)*\u003c/sup\u003e\n\n\n## Requirements\n - PHP 7.4 (64-bit, since SNMP contains such types)\n - Release version of `libnetsnmp`\n   - **macOS** ships with it (`/usr/lib/libnetsnmp.25.dylib`), as well as all tools like `snmptranslate` \n   - **Linux** will require installation of a package (e.g. Debian/Ubuntu: `snmp`)\n   - **Windows** requires installation, Net-SNMP repository [contains precompiled binaries](https://sourceforge.net/projects/net-snmp/files/net-snmp%20binaries/)\n\n\n## License\nThe library itself is [MIT-licensed](LICENSE). However, the code uses \u0026 includes parts of Net-SNMP. The code source tree contains\nparts of Net-SNMP header files, as well as structures (e.g. constants) translated from C to PHP.  \nFor details about NET-SNMP licensing see [LICENSE-NETSNMP](LICENSE-NETSNMP).\n\n*I'm not a lawyer, but this stuff is free \u0026 open-source and you can use it - just play fair and include the licenses ;)*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiler129%2Fsnmp-mib-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkiler129%2Fsnmp-mib-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiler129%2Fsnmp-mib-parser/lists"}