Using:
- Node-RED v4.0.9
- node-red-contrib-snmp v2.0.0
- Node v20
You flow works fine with a known online SNMP server.
Note: I had to use an OID that worked with that particular server
The timeout error in your debug suggests the request was blocked or the server is unreachable from the Node-RED server. Check the VM can reach the host and that the UDP port 1614
number is not blocked (firewall?).
Here is the working flow i used - you can try for your self
[{"id":"fbd576fef798e023","type":"inject","z":"ac5eda1fbe5ce493","name":"Check Stores","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":"1","topic":"","payload":"","payloadType":"date","x":570,"y":180,"wires":[["f96ec1737b717db6"]]},{"id":"f96ec1737b717db6","type":"function","z":"ac5eda1fbe5ce493","name":"Server param","func":"// msg.host = \"fs2.sidmar.be:1614\";\nmsg.host = \"demo.pysnmp.com:161\";\nmsg.community = \"public\";\n\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":780,"y":180,"wires":[["b92b338f06c144e9"]]},{"id":"b92b338f06c144e9","type":"function","z":"ac5eda1fbe5ce493","name":"Store Index","func":"msg.index = \"0\";\n\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":610,"y":240,"wires":[["610ce2f5b356ef8f"]]},{"id":"4b67a5c691cddc6d","type":"debug","z":"ac5eda1fbe5ce493","name":"After SNMP node","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1190,"y":260,"wires":[]},{"id":"0e957302c4edc5b4","type":"debug","z":"ac5eda1fbe5ce493","name":"Before SNMP node","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1190,"y":220,"wires":[]},{"id":"7a0d3a5118ae419c","type":"snmp","z":"ac5eda1fbe5ce493","host":"","version":"2c","timeout":5,"community":"","auth":"noAuthNoPriv","oids":"","name":"StoreName","x":1010,"y":260,"wires":[["4b67a5c691cddc6d"]]},{"id":"610ce2f5b356ef8f","type":"function","z":"ac5eda1fbe5ce493","name":"oid param","func":"// msg.base = \"1.3.6.1.4.1.45120.4.1.2.1.1.\";\nmsg.base = \"1.3.6.1.2.1.1.1.\";\nmsg.oid = msg.base + msg.index;\n\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":780,"y":240,"wires":[["67d9b74c01c38bca"]]},{"id":"04bf136a978cc398","type":"inject","z":"ac5eda1fbe5ce493","name":"1.3.6.1.2.1.1.1.0","props":[{"p":"host","v":"demo.pysnmp.com:161","vt":"str"},{"p":"community","v":"public","vt":"str"},{"p":"oid","v":"1.3.6.1.2.1.1.1.0","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":"1","topic":"","x":760,"y":300,"wires":[["67d9b74c01c38bca"]]},{"id":"67d9b74c01c38bca","type":"junction","z":"ac5eda1fbe5ce493","x":880,"y":240,"wires":[["7a0d3a5118ae419c","0e957302c4edc5b4"]]}]
This is the online SNMP service I used: SNMP Simulation Service - PySNMP 7 Homepage