{"id":26058033,"url":"https://github.com/gapitio/node-red-contrib-gapit-snmp","last_synced_at":"2026-02-14T07:03:32.581Z","repository":{"id":43097214,"uuid":"420101941","full_name":"gapitio/node-red-contrib-gapit-snmp","owner":"gapitio","description":null,"archived":false,"fork":false,"pushed_at":"2022-08-19T14:57:50.000Z","size":159,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-30T11:13:10.484Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gapitio.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":"2021-10-22T13:06:54.000Z","updated_at":"2023-12-06T11:47:40.000Z","dependencies_parsed_at":"2022-08-03T09:00:24.774Z","dependency_job_id":null,"html_url":"https://github.com/gapitio/node-red-contrib-gapit-snmp","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/gapitio/node-red-contrib-gapit-snmp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gapitio%2Fnode-red-contrib-gapit-snmp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gapitio%2Fnode-red-contrib-gapit-snmp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gapitio%2Fnode-red-contrib-gapit-snmp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gapitio%2Fnode-red-contrib-gapit-snmp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gapitio","download_url":"https://codeload.github.com/gapitio/node-red-contrib-gapit-snmp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gapitio%2Fnode-red-contrib-gapit-snmp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29438984,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T05:24:35.651Z","status":"ssl_error","status_checked_at":"2026-02-14T05:24:34.830Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2025-03-08T11:59:59.338Z","updated_at":"2026-02-14T07:03:32.556Z","avatar_url":"https://github.com/gapitio.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# node-red-contrib-gapit-snmp\n\nThe *gapit-snmp* \u003ca href=\"http://nodered.org\" target=\"_new\"\u003eNode-RED\u003c/a\u003e \nnode queries all the OIDs listed in a *Gapit code* JSON structure using \nSNMP get. The *Gapit code* structures and names data, preparing it for \ninsertion into a database. The complementary *gapit-results-to-influx-batch* \nnode transforms the output of this node to the format required by the \n*influx batch* node (from `node-red-contrib-influxdb`).\n\nSo to fetch a standard set of data and insert it into InfluxDB, a flow \nlike this is all you need:\n\n![Example Flow](images/example_flow.png)\n\nHere's a fragment of a *Gapit code* for UPSes:\n\n```json\n{\n    \"objects\": [\n        {\n            \"group_name\": \"Battery\",\n            \"read_priority\": 0,\n            \"group\": [\n                {\n                    \"description\": \"Battery status\",\n                    \"byte_type\": \"INT\",\n                    \"address\": \"1.3.6.1.2.1.33.1.2.1.0\",\n                    \"scaling_factor\": 1,\n                    \"unit\": \"1=Unknown, 2=Ok, 3=Low, 4=Depleted\"\n                },\n                {\n                    \"description\": \"Seconds on battery\",\n                    \"byte_type\": \"INT\",\n                    \"address\": \"1.3.6.1.2.1.33.1.2.2.0\",\n                    \"scaling_factor\": 1,\n                    \"unit\": \"sec\"\n                }\n            ]\n        }\n    ]\n}\n```\n\nThis would get inserted into a InfluxDB measurement called \"Battery\" (from the *group_name* field), \nwith fields called \"Battery status\" and \"Seconds on battery\" (from the *description* field).\n\nThe output of `gapit-snmp`, which is parsed by `gapit-results-to-influx-batch`, \nis `msg.gapit_results`. This has the same structure as the *Gapit code*, \nexcept with `.value` added for each OID.\n\n### Other destinations/databases?\n\nIf you want to insert the data into a different database, you can parse \nthe `msg.gapit_results` structure, and transform it into the required \nformat.\n\n### gapit-results-to-influx-batch node\n\nThe gapit-results-to-influx-batch node is packaged as a separate module, \n`node-red-contrib-gapit-results`, which is automatically installed with \nthis module. It is a packaged as a separate module to enable sharing with \nother nodes which yield results in the same `msg.gapit_results` structure.\n\nThe `node-red-contrib-gapit-results` module may be expanded with new \nnodes in the future.\n\n\n## Installation\n\n### Install from the Node-RED interface\n\nInstall using *Manage palette* -\u003e *Install*.\n\nYou need to refresh your browser for the `gapit-results-to-influx-batch` \nnode to be available in the node palette. If you are running Node-RED 1.2 \nor older, you will need to restart Node-RED for it to be visible.\n\nIf you are using an ancient version of NPM, you will need to manually install \n`node-red-contrib-gapit-results`.\n\n### Install using the command line\n\nRun the following command in your Node-RED user directory - typically `~/.node-red`\n\n    npm install @gapit/node-red-contrib-gapit-snmp\n\nand then restart Node-RED.\n\n\n## Usage\n\n### Example flow\n\nThis is the JSON for the flow pictured above.\n\n```json\n[{\"id\":\"18636adc.5ff2c5\",\"type\":\"tab\",\"label\":\"Flow 1\",\"disabled\":false,\"info\":\"\"},{\"id\":\"e9fbc788.fe6a28\",\"type\":\"inject\",\"z\":\"18636adc.5ff2c5\",\"name\":\"inject msg.ts\",\"props\":[{\"p\":\"ts\",\"v\":\"\",\"vt\":\"date\"}],\"repeat\":\"\",\"crontab\":\"\",\"once\":false,\"onceDelay\":0.1,\"topic\":\"\",\"x\":170,\"y\":180,\"wires\":[[\"2216c2a5.f7ae6e\"]]},{\"id\":\"2216c2a5.f7ae6e\",\"type\":\"gapit-snmp\",\"z\":\"18636adc.5ff2c5\",\"host\":\"192.168.122.52\",\"community\":\"eaton-9PX-partial-walk\",\"version\":\"1\",\"tagname_device_name\":\"devname\",\"tagvalue_device_name\":\"ups1\",\"minion_ids\":\"\",\"custom_tags\":\"{\\\"floor\\\":\\\"1\\\",\\\"room\\\":\\\"101\\\"}\",\"gapit_code\":\"{\\\"objects\\\":[{\\\"group_name\\\":\\\"Battery\\\",\\\"read_priority\\\":20,\\\"next_read\\\":0,\\\"group\\\":[{\\\"description\\\":\\\"Flarb\\\",\\\"value\\\":\\\"f\\\",\\\"byte_type\\\":\\\"INT\\\",\\\"address\\\":\\\"1.3.6.1.4.1.534.1.4.7.0\\\",\\\"scaling_factor\\\":1,\\\"unit\\\":\\\"1=Unknow, 2=Ok, 3=Low, 4=Depleted\\\"},{\\\"description\\\":\\\"Flarb the Second\\\",\\\"value\\\":\\\"f\\\",\\\"byte_type\\\":\\\"INT\\\",\\\"address\\\":\\\"1.3.6.1.4.1.534.1.2.1.0\\\",\\\"scaling_factor\\\":1,\\\"unit\\\":\\\"1=Unknow, 2=Ok, 3=Low, 4=Depleted\\\"}]}]}\",\"scaling\":\"general\",\"skip_nonexistent_oids\":true,\"remove_novalue_items_from_gapit_results\":true,\"timeout\":5,\"name\":\"\",\"x\":400,\"y\":180,\"wires\":[[\"48874c94.c9c534\"]]},{\"id\":\"48874c94.c9c534\",\"type\":\"gapit-results-to-influx-batch\",\"z\":\"18636adc.5ff2c5\",\"use_timestamp_from_msg\":true,\"timestamp_property\":\"ts\",\"name\":\"\",\"x\":680,\"y\":180,\"wires\":[[\"f23c3400.74ae98\"]]},{\"id\":\"f23c3400.74ae98\",\"type\":\"influxdb batch\",\"z\":\"18636adc.5ff2c5\",\"influxdb\":\"2aa4b01d.f511f\",\"precision\":\"ms\",\"retentionPolicy\":\"\",\"name\":\"\",\"database\":\"database\",\"precisionV18FluxV20\":\"ms\",\"retentionPolicyV18Flux\":\"\",\"org\":\"organisation\",\"bucket\":\"bucket\",\"x\":910,\"y\":180,\"wires\":[]},{\"id\":\"2aa4b01d.f511f\",\"type\":\"influxdb\",\"hostname\":\"influx\",\"port\":\"8086\",\"protocol\":\"http\",\"database\":\"db1\",\"name\":\"influx\",\"usetls\":false,\"tls\":\"\",\"influxdbVersion\":\"1.x\",\"url\":\"http://localhost:8086\",\"rejectUnauthorized\":true}]\n```\n\n### Gapit codes\n\nA library of ready-made *Gapit codes* is forthcoming.\n\n### gapit-snmp\n\nThe node needs to be configured with, at a minimum:\n\n* SNMP config (host, community, etc.)\n* Gapit code\n\n| Parameter | Description |\n| ------ | ------ |\n| Name | Node name |\n| Host | SNMP host |\n| Community | SNMP community |\n| Version | SNMP version |\n| Timeout | SNMP timeout |\n| Device name | The device name database records will be tagged with (e.g. \"ups1\")|\n| Device name db-tag | The database tag for device name (e.g. \"devname\") |\n| Minion IDs | A list of minion IDs, see below |\n| Custom tags | Extra tags to add to database records, see below |\n| Gapit code | The Gapit code JSON |\n| Scaling | *General* or *Schleifenbauer* |\n| Skip nonexistent OIDs in subsequent queries | If an OID generates a \"doesn't exist\" error, stop querying it (*default on*) |\n| Remove items with no value from gapit_results | If checked, only those items where a value was returned is represented in `msg.gapit_results` (*default on*) |\n\n\n#### Minion IDs\n\nUsing an SNMP bridge device, it is possible to query multiple devices \n\"behind\" the bridge. The bridges represent these devices using a variable \nID as part of the OID, e.g. 1.2.3.4.x.1, and some *Gapit codes* are set \nup for this. Specify your device IDs in the *Minion IDs* field, separated by \nsemicolons (**;**). If you specify more than one *Minion IDs*, the *Device \nname* field must have an equal number of names, also semicolon separated.\n\n#### Custom tags\n\nAdd database tags, formatted as JSON with `tag_name: value`. If multiple minions are specified, tags must be in a child object named for the device name, or \"all-minion-tags\" for any tags that should be common for all minions.\n\nExample:\n\n```json\n{\n    \"floor\": \"1\",\n    \"room\": \"101\"\n}\n```\n\n### gapit-results-to-influx-batch\n\nTo use a Node-RED timestamp with influxdb (enabled by default), \nadd a property containing a timestamp in your inject node. The \ndefault name is `msg.ts`.\n\n| Parameter | Description |\n| ------ | ------ |\n| Name | Node name |\n| Use timestamp from Message | Use a timestamp injected in the flow (*default on*) |\n| Timestamp property | The `msg` property to get the timestamp from (*default: \"ts\"*) |\n\n#### N.B.! Check the InfluxDB time precision\n\nIf using timestamps from Node-RED, note that while this works \"out-of-the-box\" \nwith InfluxDB v2, you will have to set the `influx batch` node to match the \nmillisecond resolution of Node-RED if you're using InfluxDB v1. You can do this \nby checking `Advanced Query Options` on the `influx batch` node, and then \nchoosing `Milliseconds (ms)` from the `Time Precision` popup menu.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgapitio%2Fnode-red-contrib-gapit-snmp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgapitio%2Fnode-red-contrib-gapit-snmp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgapitio%2Fnode-red-contrib-gapit-snmp/lists"}