From 4b99a5f4d13041510fe0e8bcb98b33fa02a42456 Mon Sep 17 00:00:00 2001
From: andres <999999999e9@gmail.com>
Date: Sat, 24 Oct 2020 11:07:16 +1000
Subject: [PATCH] Added support for V3
Added support for version 3.
All the existing issues with v1 and v2c are also with v3 e.g.
https://github.com/node-red/node-red-nodes/issues/679
snmp walker will not return more than 1000 objects, all following objects cannot be accessed
Incorrect encryption (privacy) passphrase gives a timeout and not an error (protocol limitation?)
Incorrect community string gives a timeout and not an error (protocol limitation?)
Changes to the node are made with following details:
Node-red v1.2.2
Node.js v12.6.0
Windows_NT 10.0.19841 x64 LE
---
io/snmp/README.md | 82 +++++++++--
io/snmp/package.json | 7 +-
io/snmp/snmp.html | 328 +++++++++++++++++++++++++++++++++++++------
io/snmp/snmp.js | 207 ++++++++++++++++++++++++---
4 files changed, 545 insertions(+), 79 deletions(-)
diff --git a/io/snmp/README.md b/io/snmp/README.md
index 5067b11b..8caa1b28 100644
--- a/io/snmp/README.md
+++ b/io/snmp/README.md
@@ -18,9 +18,15 @@ Usage
SNMP oids fetcher. Can fetch a single or comma separated list of oids. Triggered by any input.
-`msg.host` may contain the host.
+`msg.host` may contain the host including the port.
-`msg.community` may contain the community.
+`msg.community` may contain the community. (v1 and v2c only)
+
+`msg.username` may contain the username. (v3 only)
+
+`msg.authkey` may contain the digest security key. (v3 only)
+
+`msg.privkey` may contain the encryption security key. (v3 only)
`msg.oid` may contain a comma separated list of oids to search for. (no spaces)
@@ -28,6 +34,12 @@ The host configured in the edit config will override `msg.host`. Leave blank if
The community configured in the edit config will override `msg.community`. Leave blank if you want to use `msg.community` to provide input.
+The username configured in the edit config will override `msg.username`. Leave blank if you want to use `msg.username` to provide input.
+
+The digest security key configured in the edit config will override `msg.authkey`. Leave blank if you want to use `msg.authkey` to provide input.
+
+The encryption security key configured in the edit config will override `msg.privkey`. Leave blank if you want to use `msg.privkey` to provide input.
+
The oids configured in the edit config will override `msg.oid`. Leave blank if you
want to use `msg.oid` to provide input.
@@ -38,9 +50,15 @@ Values depends on the oids being requested.
SNMP sets the value of one or more OIDs.
-`msg.host` may contain the host.
+`msg.host` may contain the host including the port.
-`msg.community` may contain the community.
+`msg.community` may contain the community. (v1 and v2c only)
+
+`msg.username` may contain the username. (v3 only)
+
+`msg.authkey` may contain the digest security key. (v3 only)
+
+`msg.privkey` may contain the encryption security key. (v3 only)
`msg.varbinds` may contain an array of varbind JSON objects e.g.:
```
@@ -81,6 +99,12 @@ The host configured in the edit config will override `msg.host`. Leave blank if
The community configured in the edit config will override `msg.community`. Leave blank if you want to use `msg.community` to provide input.
+The username configured in the edit config will override `msg.username`. Leave blank if you want to use `msg.username` to provide input.
+
+The digest security key configured in the edit config will override `msg.authkey`. Leave blank if you want to use `msg.authkey` to provide input.
+
+The encryption security key configured in the edit config will override `msg.privkey`. Leave blank if you want to use `msg.privkey` to provide input.
+
The varbinds configured in the edit config will override `msg.varbinds`. Leave blank if you want to use `msg.varbinds` to provide input.
@@ -89,16 +113,28 @@ The varbinds configured in the edit config will override `msg.varbinds`. Leave b
Simple SNMP table oid fetcher. Triggered by any input.
-`msg.host` may contain the host.
+`msg.host` may contain the host including the port.
-`msg.community` may contain the community.
+`msg.community` may contain the community. (v1 and v2c only)
-`msg.oid` may contain the oid of a single table to search for.
+`msg.username` may contain the username. (v3 only)
+
+`msg.authkey` may contain the digest security key. (v3 only)
+
+`msg.privkey` may contain the encryption security key. (v3 only)
+
+`msg.oid` may contain a comma separated list of oids to search for. (no spaces)
The host configured in the edit config will override `msg.host`. Leave blank if you want to use `msg.host` to provide input.
The community configured in the edit config will override `msg.community`. Leave blank if you want to use `msg.community` to provide input.
+The username configured in the edit config will override `msg.username`. Leave blank if you want to use `msg.username` to provide input.
+
+The digest security key configured in the edit config will override `msg.authkey`. Leave blank if you want to use `msg.authkey` to provide input.
+
+The encryption security key configured in the edit config will override `msg.privkey`. Leave blank if you want to use `msg.privkey` to provide input.
+
The oid configured in the edit config will override `msg.oid`. Leave blank if you
want to use `msg.oid` to provide input.
@@ -109,9 +145,15 @@ Values depends on the oids being requested.
Simple SNMP oid subtree fetcher. Triggered by any input. Reads from OID specified and any below it.
-`msg.host` may contain the host.
+`msg.host` may contain the host including the port.
-`msg.community` may contain the community.
+`msg.community` may contain the community. (v1 and v2c only)
+
+`msg.username` may contain the username. (v3 only)
+
+`msg.authkey` may contain the digest security key. (v3 only)
+
+`msg.privkey` may contain the encryption security key. (v3 only)
`msg.oid` may contain the oid of a single table to search for.
@@ -119,6 +161,12 @@ The host configured in the edit config will override `msg.host`. Leave blank if
The community configured in the edit config will override `msg.community`. Leave blank if you want to use `msg.community` to provide input.
+The username configured in the edit config will override `msg.username`. Leave blank if you want to use `msg.username` to provide input.
+
+The digest security key configured in the edit config will override `msg.authkey`. Leave blank if you want to use `msg.authkey` to provide input.
+
+The encryption security key configured in the edit config will override `msg.privkey`. Leave blank if you want to use `msg.privkey` to provide input.
+
The oid configured in the edit config will override `msg.oid`. Leave blank if you
want to use `msg.oid` to provide input.
@@ -129,9 +177,15 @@ Values depends on the oids being requested.
Simple SNMP oid walker fetcher. Triggered by any input. Reads from OID specified to the end of the table.
-`msg.host` may contain the host.
+`msg.host` may contain the host including the port.
-`msg.community` may contain the community.
+`msg.community` may contain the community. (v1 and v2c only)
+
+`msg.username` may contain the username. (v3 only)
+
+`msg.authkey` may contain the digest security key. (v3 only)
+
+`msg.privkey` may contain the encryption security key. (v3 only)
`msg.oid` may contain the oid of a single table to search for.
@@ -139,6 +193,12 @@ The host configured in the edit config will override `msg.host`. Leave blank if
The community configured in the edit config will override `msg.community`. Leave blank if you want to use `msg.community` to provide input.
+The username configured in the edit config will override `msg.username`. Leave blank if you want to use `msg.username` to provide input.
+
+The digest security key configured in the edit config will override `msg.authkey`. Leave blank if you want to use `msg.authkey` to provide input.
+
+The encryption security key configured in the edit config will override `msg.privkey`. Leave blank if you want to use `msg.privkey` to provide input.
+
The oid configured in the edit config will override `msg.oid`. Leave blank if you
want to use `msg.oid` to provide input.
diff --git a/io/snmp/package.json b/io/snmp/package.json
index c2c118f7..f812391e 100644
--- a/io/snmp/package.json
+++ b/io/snmp/package.json
@@ -1,9 +1,9 @@
{
"name" : "node-red-node-snmp",
- "version" : "0.0.25",
+ "version" : "0.0.26",
"description" : "A Node-RED node that looks for SNMP oids.",
"dependencies" : {
- "net-snmp" : "1.2.4"
+ "net-snmp" : "2.9.6"
},
"repository" : {
"type":"git",
@@ -23,6 +23,7 @@
},
"contributors": [
{ "name": "Mika Karaila" },
- { "name": "Bryan Malyn" }
+ { "name": "Bryan Malyn" },
+ { "name": "Andres" }
]
}
diff --git a/io/snmp/snmp.html b/io/snmp/snmp.html
index 4cd13ef8..0df25340 100644
--- a/io/snmp/snmp.html
+++ b/io/snmp/snmp.html
@@ -3,19 +3,56 @@
-
-
-
-
Timeout
S
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Priv.Prot.
+
+
+
+
+
+
+
+
+
+
+
@@ -31,6 +68,9 @@
Simple SNMP oid or oid list fetcher. Triggered by any input.
msg.host may contain the host.
msg.community may contain the community.
+
msg.username may contain the username.
+
msg.authkey may contain the digest security key.
+
msg.privkey may contain the encryption security key.
msg.oid may contain a comma separated list of oids to request. (no spaces)