SNMP communication has stopped working

I am updating an old system, created by an engineer who has left us. The system hasn't been maintained since his departure so it is my task to update it, as well as take ownership of it.
The old system is run on docker on a pc that failed recently (but we were able to recover) and new plans are to run it on a Virtual Machine without docker.
Node.js version: V10 -> V22
NodeRed version: V1.3.4 -> V4.0.9
SNMP module: node-red-node-snmp v0.0.25 - > node-red-node-snmp v2.0.0
Using wireshark, i find that the problem lays with NR, as no SNMP messages are coming out of the system whatsoever.
Any idea what might be causing the issue?


Settings are the exact same as in the old system, which does work as expected.

If I've read that correctly, you are using Node-RED to publish some snmp entries?

If that is the case, what is receiving them? Perhaps there is a local firewall preventing snmp messages from getting out (or in)?

I'm not sure, we are querying for an OID number to a server.
The old version can do this just fine.
However, on the VM where i am developing the updated version, this does not work.

I looked into it deeper, like setting up wireshark to monitor all incoming and outgoing messages.
Yet wireshark does no see anything outgoing!
Which (as far as i understand) means the messages are not even being sent.
Because if the firewall on the VM side of the discourse is the issue, i should see a "Msg request" message in wireshark, but not on the server.

This leads me to believe that node red does not even create the request.

So to test this, i set up a debug node after the first SNMP node:



But the debug node outputs nothing, meaning the node is defective.

Hmm, I've honestly never used NR to publish an SNMP output, only to subscribe to them.

You may need to up the log level for Node-RED to see if you can spot anything happening.

How does one do such a thing?

Have a look in the settings.js file for node-red, you should see a logging section there. The most verbose level is "trace".

After doing this, i disabled all nodes and proceeded to "inject" to try, but nothing happens.
No extra data is added in the NR cmd.


Hmm, this is beyond me I'm afraid. Going to ping the last authors involved with updates: @Steve-Mcl and @dceejay.

1 Like

Thank you either way for the attempt!

1 Like

After noticing metric and audit options, i tried enabling them.
Now, with only the nodes shown above active, this is the outcome of an inject:
Debug for NR forum.txt (15.0 KB)

So, some snmp.receive but no sends.

First thing first, use a debug to see exactly what is going into the SNMP node. By that I mean the debug must come after the function "iod param" and before the SNMP node "StoreName".

Ensure the debug is set to show the complete msg.

Next, share a minimal flow that recreates your issue and post it (as text, not a file) in a code block

Ok, current situation:

[
    {
        "id": "ac5eda1fbe5ce493",
        "type": "tab",
        "label": "Flow 1",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "fbd576fef798e023",
        "type": "inject",
        "z": "ac5eda1fbe5ce493",
        "name": "Check Stores",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "60",
        "crontab": "",
        "once": false,
        "onceDelay": "1",
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 200,
        "y": 240,
        "wires": [
            [
                "f96ec1737b717db6"
            ]
        ]
    },
    {
        "id": "f96ec1737b717db6",
        "type": "function",
        "z": "ac5eda1fbe5ce493",
        "name": "Server param",
        "func": "msg.host = \"fs2.sidmar.be:1614\";\nmsg.community = \"public\";\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 400,
        "y": 240,
        "wires": [
            [
                "b92b338f06c144e9"
            ]
        ]
    },
    {
        "id": "b92b338f06c144e9",
        "type": "function",
        "z": "ac5eda1fbe5ce493",
        "name": "Store Index",
        "func": "msg.index = \"0\";\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "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": 1150,
        "y": 240,
        "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": 1150,
        "y": 180,
        "wires": []
    },
    {
        "id": "7a0d3a5118ae419c",
        "type": "snmp",
        "z": "ac5eda1fbe5ce493",
        "host": "",
        "version": "2c",
        "timeout": 5,
        "community": "",
        "oids": "",
        "name": "StoreName",
        "x": 950,
        "y": 240,
        "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.oid = msg.base + msg.index;\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 780,
        "y": 240,
        "wires": [
            [
                "7a0d3a5118ae419c",
                "0e957302c4edc5b4"
            ]
        ]
    }
]

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

1 Like

Thank you, this is very interesting.
I see that pinging the server works fine, and i regularly get files from this server.


However, upon closer inspection, the wireshark SNMP port was wrong.
Tested it earlier on a 1612 port, so did not change it to 1614. Thank you for making me realise.
The get requests are sent, but do not get any anwser.
Now to check wether or not they arrive on the server.
I will get back to you on this.