{"id":16488705,"url":"https://github.com/grongor/go-snmp-proxy","last_synced_at":"2025-03-23T12:34:18.950Z","repository":{"id":47159729,"uuid":"268260313","full_name":"grongor/go-snmp-proxy","owner":"grongor","description":"HTTP proxy server for SNMP requests, written in Go","archived":false,"fork":false,"pushed_at":"2024-10-04T15:27:41.000Z","size":126,"stargazers_count":3,"open_issues_count":4,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-12T13:39:33.663Z","etag":null,"topics":["go","golang","http","proxy","proxy-server","snmp"],"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/grongor.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}},"created_at":"2020-05-31T10:51:27.000Z","updated_at":"2024-09-12T09:12:26.000Z","dependencies_parsed_at":"2023-12-08T18:28:18.090Z","dependency_job_id":"5b020880-e351-4e15-bb34-8d6a4f09af09","html_url":"https://github.com/grongor/go-snmp-proxy","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grongor%2Fgo-snmp-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grongor%2Fgo-snmp-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grongor%2Fgo-snmp-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grongor%2Fgo-snmp-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grongor","download_url":"https://codeload.github.com/grongor/go-snmp-proxy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221851105,"owners_count":16891715,"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":["go","golang","http","proxy","proxy-server","snmp"],"created_at":"2024-10-11T13:39:41.815Z","updated_at":"2024-10-28T15:51:47.646Z","avatar_url":"https://github.com/grongor.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"go-snmp-proxy\n=============\n\n![CI](https://github.com/grongor/go-snmp-proxy/workflows/CI/badge.svg)\n[![Coverage Status](https://coveralls.io/repos/github/grongor/go-snmp-proxy/badge.svg)](https://coveralls.io/github/grongor/go-snmp-proxy)\n\nHTTP proxy server for SNMP requests, written in Go.\n\nUse cases\n---------\n\n- reduce time for devices with latency issues (remote locations, bad connection, ...)\n  - fetching large SNMP tree of a server in Asia from data center in US might take a long time\n- remove dependency on SNMP from your code\n  - don't want to/can't install SNMP tooling, PHP extension,... ? This solves it gracefully.\n- use HTTP authentication for your SNMP requests\n- encrypt \"SNMP traffic\" between the client and the server\n- bypass firewall\n- ...post your use-case via issue/PR :-)\n\nOnly SNMP versions 1 and 2c are supported. If you want support for version 3, please, send a pull request.\n\nClients\n=======\n\n| Language | Link                               |\n|----------|------------------------------------|\n| PHP      | https://github.com/simPod/PHP-SNMP |\n\nFeel free to create an issue to include your implementation here.\n\nHow it works\n------------\n\nThe application provides a single HTTP endpoint `/snmp-proxy`, which accepts POST requests:\n```json\n{\n    \"host\": \"192.168.1.1\",\n    \"community\": \"public\",\n    \"version\": \"2c\",\n    \"timeout\": 10,\n    \"retries\": 3,\n    \"requests\": [\n        {\n            \"request_type\": \"getNext\",\n            \"oids\": [\n                \".1.2.3\",\n                \".4.5.6\"\n            ]\n        },\n        {\n            \"request_type\": \"walk\",\n            \"oids\": [\".7.8.9\"],\n            \"max_repetitions\": 20\n        }\n    ]\n}\n```\n\nIt will then issue SNMP requests based on the given JSON request, convert the result into JSON and send it back\nto the client. Response might look like this:\n```json\n{\n    \"result\": [\n        [\n            \".1.2.3.4.5\",\n            123,\n            \".4.5.6.7.8\",\n            \"lorem\"\n        ],\n        [\n            \".7.8.9.1.1\",\n            \"some\",\n            \".7.8.9.1.2\",\n            \"values\",\n            \".7.8.9.1.3\",\n            \"here\"\n        ]\n    ]\n}\n```\n\nResult is an array instead of a map because maps in Go aren't ordered (and overcoming this would unnecessarily\ncomplicated), and the order is also not guaranteed by the JSON format.\n\nIf there is an error, response will be as follows:\n```json\n{\n    \"error\": \"description of what happened\"\n}\n```\n\nSome errors are \"standardized\" and expected:\n - no such instance\n - no such object\n - end of mib\n\nThe rest of the errors just describe what unexpected happened.\n\nMIBs\n----\n\nThe application will try to find all installed MIBs and parse the DisplayHint information for OctetString types\nso that it knows how to format them. MIB parsing was inspired by\n[Prometheus SNMP exporter generator](https://github.com/prometheus/snmp_exporter/tree/master/generator). Thanks!\n\nIn case that OID is of the type OctetString, and it isn't found in the MIBs, then we try to detect whether the string\nis printable (utf8 valid + all characters are printable). If it isn't, it's formatted as `AB C0 D5 D6...`.\n\nMIBs parsing can be skipped by using a binary built with `-tags=nonetsnmp`.\nThese binaries are also available in the [Releases](https://github.com/grongor/go-snmp-proxy/releases).\n\nMetrics\n-------\n\nIf you set Metrics.Listen address in the config, the application will expose Prometheus metrics on given address[:port],\nspecifically on `GET /metrics`. These metrics contain all essential information about Go runtime, and a histogram\nof `POST /snmp-proxy` requests (count, durations).\n\nShared libraries\n----------------\n\nUnless you use binary built with `-tags=nonetsnmp`, you will have to install a shared library for the `snmp-proxy`:\n`libsnmp` (contained in `libsnmp-dev`).\n\nBinaries available in the [Releases](https://github.com/grongor/go-snmp-proxy/releases) will be built on the Ubuntu LTS\nand thus compatible with the version of this library available in the Ubuntu LTS (and stable Debian).\nIf that doesn't match your target system, you can:\n - install the expected version of `libsnmp` (you will usually have the newer version, but it should be possible\n   to install older one)\n - build the `snmp-proxy` yourself in the same environment as you expected the `snmp-proxy` to run\n - use binary built with `-tags=nonetsnmp`, also available in the\n   [Releases](https://github.com/grongor/go-snmp-proxy/releases)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrongor%2Fgo-snmp-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrongor%2Fgo-snmp-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrongor%2Fgo-snmp-proxy/lists"}