SNMP Node does not work (or I don't know how to make it work!)

585 views
Skip to first unread message

Giovanni Castania

unread,
Aug 28, 2016, 5:26:19 PM8/28/16
to Node-RED
I'm tring to get info from my NAS via SNMP, what i did so far:
1) installed snmpd and snmp on Raspberry Pi
2) tested in my PI via command line to fetch free space and total space of the NAS ad all works as per below:
pi@GCRaspPI ~ $ snmpget -v 2c -c -mypassowrd- -O qv 192.168.1.230 1.3.6.1.4.1.24681.1.2.17.1.5.1
"18.73 TB"
pi@GCRaspPI
~ $ snmpget -v 2c -c -mypassowrd- -O qv 192.168.1.230 1.3.6.1.4.1.24681.1.2.17.1.4.1
"31.63 TB"
3) installed node-red-node-snmp
4) I just add NAS ip and same parameter as above and no output
5) I tried with exec node with full command line above (with and without "sudo " in front) and no output at all

Can some one help to drive me to the right direction?


Dave C-J

unread,
Aug 29, 2016, 10:29:09 AM8/29/16
to node...@googlegroups.com
Hi,

I just use the snmp node (not exec) as per below and the basic enquiry works....
gives me a msg.payload containing
[ { "oid": "1.3.6.1.2.1.1.1.0", "type": 4, "value": "Linux raspberrypi 4.4.14+ #896 Sat Jul 2 14:16:46 BST 2016 armv6l", "tstr": "OctetString" } ]


[{"id":"b02c5a6a.5a9d98","type":"snmp","z":"896b28a8.437658","host":"192.168.1.193","community":"public","version":"2c","oids":"1.3.6.1.2.1.1.1.0","name":"","x":384.5,"y":1242,"wires":[["e4486b69.418168"]]},{"id":"68dd85b6.5f251c","type":"inject","z":"896b28a8.437658","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":183,"y":1201,"wires":[["b02c5a6a.5a9d98"]]},{"id":"e4486b69.418168","type":"debug","z":"896b28a8.437658","name":"","active":true,"console":"false","complete":"false","x":589,"y":1209,"wires":[]}]

Giovanni Castania

unread,
Aug 30, 2016, 6:05:45 AM8/30/16
to Node-RED
Thanks Dave,

indeed now with your flow I'm able to fetch single OID :)
The issue is that if I want a full "branch" using the SNMPWALKER or SNMPTABLE node I get always an empty payload :(
In the example below the SNMP node works ore returning a single value, but if I want the full list, I tried with SNMPWALKER/TABLE and no way to get anything on the payload...

[{"id":"c9b960ac.af2ee","type":"snmp","z":"50270326.b76b0c","host":"192.168.1.230","community":"public","version":"2c","oids":"1.3.6.1.4.1.24681.1.2.17.1.5.1\n","name":"QNAP Query","x":316.75,"y":339.75,"wires":[[]]},{"id":"9c705ee1.17e4","type":"inject","z":"50270326.b76b0c","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":143.25,"y":332.75,"wires":[["c9b960ac.af2ee","3525704f.b35178"]]},{"id":"891f067e.83cc1","type":"debug","z":"50270326.b76b0c","name":"","active":true,"console":"false","complete":"true","x":597.25,"y":332.75,"wires":[]},{"id":"3525704f.b35178","type":"snmp table","z":"50270326.b76b0c","host":"192.168.1.230","community":"public","version":"2c","oids":"1.3.6.1.4.1.24681.1.2.17.1","name":"","x":336.3666687011719,"y":398.75,"wires":[["891f067e.83cc1"]]}]

Dave C-J

unread,
Sep 1, 2016, 4:41:22 AM9/1/16
to node...@googlegroups.com
Hmm - again I just used the walker node

[{"id":"68dd85b6.5f251c","type":"inject","z":"896b28a8.437658","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":183,"y":1201,"wires":[["b02c5a6a.5a9d98","21f582de.28c8ae","d752ca6b.4213f8"]]},{"id":"21f582de.28c8ae","type":"snmp walker","z":"896b28a8.437658","host":"192.168.1.230","community":"public","version":"1","oids":"1.3.6.1.2.1.1.1.0","name":"","x":417.5,"y":1233,"wires":[["bd93e9fa.562ce8"]]},{"id":"bd93e9fa.562ce8","type":"debug","z":"896b28a8.437658","name":"","active":true,"console":"false","complete":"false","x":657,"y":1220,"wires":[]}]

and I get a large array back...
[ { "oid": "1.3.6.1.2.1.1.2.0", "value": "1.3.6.1.4.1.8072.3.2.10" }, { "oid": "1.3.6.1.2.1.1.3.0", "value": 89686 }, { "oid": "1.3.6.1.2.1.1.4.0", "value": { "type": "Buffer", "data": [ 77, 101, 32, 60, 109, 101, 64, 101, 120, 97, 109, 112, 108, 101, 46, 111, 114, 103, 62 ] } }, { "oid": "1.3.6.1.2.1.1.5.0", "value": { "type": "Buffer", "data": [ 112, 105, 97, 112, 108, 117, 115 ] } }, { "oid": "1.3.6.1.2.1.1.6.0", "value": { "type": "Buffer", "data": [ 83, 105, 116, 116, 105, 110, 103, 32, 111, 110, 32, 116, 104, 101, 32, 68, 111, 99, 107, 32, 111, 102, 32, 116, 104, 101, 32, 66, 97, 121 ] } }, { "oid": "1.3.6.1.2.1.1.7.0", "value": 72 }, { "oid": "1.3.6.1.2.1.1.8.0", "value": 68 }, { "o ....


or using the subtree ( on OID 1.3.6.1.2.1.1 - Ie above the lowest level)
[{"id":"68dd85b6.5f251c","type":"inject","z":"896b28a8.437658","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":183,"y":1201,"wires":[["b02c5a6a.5a9d98","21f582de.28c8ae","d752ca6b.4213f8"]]},{"id":"d752ca6b.4213f8","type":"snmp subtree","z":"896b28a8.437658","host":"192.168.1.230","community":"public","version":"1","oids":"1.3.6.1.2.1.1","name":"","x":361.5,"y":1285,"wires":[["915fd0e4.94546","bf9c2f1d.4aa7a"]]},{"id":"915fd0e4.94546","type":"function","z":"896b28a8.437658","name":"","func":"msg.payload = msg.payload[0].value.toString();\nreturn msg;","outputs":1,"noerr":0,"x":559.5,"y":1305,"wires":[["bf9c2f1d.4aa7a"]]},{"id":"bf9c2f1d.4aa7a","type":"debug","z":"896b28a8.437658","name":"","active":true,"console":"false","complete":"false","x":705,"y":1286,"wires":[]}]


Jan Van den Audenaerde

unread,
Feb 15, 2017, 1:50:59 PM2/15/17
to Node-RED


On Thursday, September 1, 2016 at 10:41:22 AM UTC+2, Dave C-J wrote:
Hmm - again I just used the walker node

[{"id":"68dd85b6.5f251c","type":"inject","z":"896b28a8.437658","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":183,"y":1201,"wires":[["b02c5a6a.5a9d98","21f582de.28c8ae","d752ca6b.4213f8"]]},{"id":"21f582de.28c8ae","type":"snmp walker","z":"896b28a8.437658","host":"192.168.1.230","community":"public","version":"1","oids":"1.3.6.1.2.1.1.1.0","name":"","x":417.5,"y":1233,"wires":[["bd93e9fa.562ce8"]]},{"id":"bd93e9fa.562ce8","type":"debug","z":"896b28a8.437658","name":"","active":true,"console":"false","complete":"false","x":657,"y":1220,"wires":[]}]

 
Hi Dave, 

I managed to get the snmp node working on my raspberry pi but I couldn't get the walker node working.  
When I tried above code (I only changed host into 127.0.0.1) I get following error message:

2/15/2017, 7:45:32 PMnode: 10f22ba5.960334msg : string[41]
"TypeError: response.add is not a function"
Have you any idea what I might doing wrong ?

kr
Jan.

Dave C-J

unread,
Feb 15, 2017, 2:15:56 PM2/15/17
to node...@googlegroups.com
Hi sorry no - not exactly something I use day to day :-(

Jan Van den Audenaerde

unread,
Feb 16, 2017, 7:12:30 AM2/16/17
to Node-RED
Hi Dave,

I was directing it to you as in one of your previous comments you managed to get a response on the above flow using the snmp walker node.
I was just wondering if there is something wrong with my SNMP configuration or that there is an issue with the snmp walker node in combination with the latest node-red version.
Note also that the error "response.add is not a function" is not very helpful for me.
For me it would already be a good start if someone managed to the get proper snmp walker node output (preferably on raspberry pi).

Note that I already managed to use the snmp node and this looks very promising to me.

kr
Jan
Reply all
Reply to author
Forward
0 new messages