{"id":13545511,"url":"https://github.com/FreeDSx/SNMP","last_synced_at":"2025-04-02T15:31:19.907Z","repository":{"id":44950083,"uuid":"135075780","full_name":"FreeDSx/SNMP","owner":"FreeDSx","description":"A Pure PHP SNMP Library.","archived":false,"fork":false,"pushed_at":"2023-01-22T00:11:09.000Z","size":376,"stargazers_count":56,"open_issues_count":6,"forks_count":12,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-03-24T17:22:36.396Z","etag":null,"topics":["php","snmp","snmp-trap-listener","snmp-traps","snmpv2","snmpv3"],"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/FreeDSx.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2018-05-27T19:34:23.000Z","updated_at":"2024-02-07T17:57:26.000Z","dependencies_parsed_at":"2023-02-12T14:01:21.759Z","dependency_job_id":null,"html_url":"https://github.com/FreeDSx/SNMP","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FreeDSx%2FSNMP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FreeDSx%2FSNMP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FreeDSx%2FSNMP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FreeDSx%2FSNMP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FreeDSx","download_url":"https://codeload.github.com/FreeDSx/SNMP/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246841685,"owners_count":20842632,"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":["php","snmp","snmp-trap-listener","snmp-traps","snmpv2","snmpv3"],"created_at":"2024-08-01T11:01:04.464Z","updated_at":"2025-04-02T15:31:14.894Z","avatar_url":"https://github.com/FreeDSx.png","language":"PHP","funding_links":[],"categories":["PHP","Libraries"],"sub_categories":["PHP"],"readme":"# FreeDSx SNMP ![](https://github.com/FreeDSx/SNMP/workflows/Build/badge.svg)\nFreeDSx SNMP is a pure PHP SNMP library. It has no requirement on the core PHP SNMP extension. It implements SNMP\nclient functionality described in [RFC 3412](https://tools.ietf.org/html/rfc3412) / [RFC 3416](https://tools.ietf.org/html/rfc3416) / [RFC 3414](https://tools.ietf.org/html/rfc3414).\nIt also includes functionality described in various other RFCs, such as SHA2 authentication ([RFC 7860](https://tools.ietf.org/html/rfc7860)) and strong encryption\nmechanisms ([3DES](https://tools.ietf.org/html/draft-reeder-snmpv3-usm-3desede-00) / [AES-192-256](https://tools.ietf.org/html/draft-blumenthal-aes-usm-04)).\nSome main features include:\n\n* SNMP version 1, 2, and 3 support.\n* Supports all authentication mechanisms (md5, sha1, sha224, sha256, sha384, sha512).\n* Supports all privacy encryption mechanisms (des, 3des, aes128, aes192, aes256).\n* Supports all client request types (Get, GetNext, GetBulk, Set, Inform, TrapV1, TrapV2).\n* Supports sending SNMPv1 and SNMPv2 traps (including inform requests).\n* Trap Sink server for receiving and processing incoming traps.\n\nThe OpenSSL extension is required for privacy / encryption support. The GMP extension is required for 64-bit counters (BigCounter).\n\n# Documentation\n\n* [SNMP Client](/docs/Client)\n  * [Configuration](/docs/Client/Configuration.md)\n  * [General Usage](/docs/Client/General-Usage.md)\n  * [Request Types](/docs/Client/Request-Types.md)\n  * [SNMP Walk](/docs/Client/SNMP-Walk.md)\n* [SNMP Server](/docs/Server)\n  * [Trap Sink](/docs/Server/Trap-Sink.md)\n\n# Getting Started\n\nInstall via composer:\n\n```bash\ncomposer require freedsx/snmp\n```\n\nUse the SnmpClient class and the helper classes:\n\n```php\nuse FreeDSx\\Snmp\\SnmpClient;\n\n$snmp = new SnmpClient([\n    'host' =\u003e 'servername',\n    'version' =\u003e 2,\n    'community' =\u003e 'secret',\n]);\n\n# Get a specific OID value as a string...\necho $snmp-\u003egetValue('1.3.6.1.2.1').PHP_EOL;\n\n# Get a specific OID as an object...\n$oid = $snmp-\u003egetOid('1.3.6.1.2.1');\nvar_dump($oid);\n\necho sprintf(\"%s == %s\", $oid-\u003egetOid(), (string) $oid-\u003egetValue()).PHP_EOL;\n\n# Get multiple OIDs and iterate through them as needed...\n$oids = $snmp-\u003eget('1.3.6.1.2.1.1.1', '1.3.6.1.2.1.1.3', '1.3.6.1.2.1.1.5');\n \nforeach($oids as $oid) {\n    echo sprintf(\"%s == %s\", $oid-\u003egetOid(), (string) $oid-\u003egetValue()).PHP_EOL;\n}\n\n# Using the SnmpClient, get the helper class for an SNMP walk...\n$walk = $snmp-\u003ewalk();\n\n# Keep the walk going until there are no more OIDs left\nwhile($walk-\u003ehasOids()) {\n    try {\n        # Get the next OID in the walk\n        $oid = $walk-\u003enext();\n        echo sprintf(\"%s = %s\", $oid-\u003egetOid(), $oid-\u003egetValue()).PHP_EOL;\n    } catch (\\Exception $e) {\n        # If we had an issue, display it here (network timeout, etc)\n        echo \"Unable to retrieve OID. \".$e-\u003egetMessage().PHP_EOL;\n    }\n}\n\necho sprintf(\"Walked a total of %s OIDs.\", $walk-\u003ecount()).PHP_EOL; \n```\n\nFor a complete configuration reference please see the [configuration doc](/docs/Client/Configuration.md). There are also\nSNMP v3 examples for [NoAuthNoPriv](/docs/Client/General-Usage.md#noauthnopriv), [AuthNoPriv](/docs/Client/General-Usage.md#authnopriv), and [AuthPriv](/docs/Client/General-Usage.md#authpriv)\nin the [general usage doc](/docs/Client/General-Usage.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFreeDSx%2FSNMP","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FFreeDSx%2FSNMP","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFreeDSx%2FSNMP/lists"}