node-red/node-red-nodes

no reposnse to SNMP trap

AndKe opened this issue · 2 comments

AndKe commented

Which node are you reporting an issue on?

node-red-node-snmp 2.0.0 - snmp node

What are the steps to reproduce?

I have a node like this: (192.168.1.30 is the IP address of the UPS)
Screenshot from 2023-05-20 18-40-33
it is connected to debug:

Screenshot from 2023-05-20 18-40-41

the UPS is configured like this to send a trap to 192.168.1.36 (IP of the RaspberryPi)
Screenshot from 2023-05-20 18-40-52

Then the trap is sent
Screenshot from 2023-05-20 18-41-01

What happens?

..but the NodeRed did not produce any debug message.

These are my iptables

sudo iptables -L
# Warning: iptables-legacy tables present, use iptables-legacy to see them
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy DROP)
target     prot opt source               destination         
DOCKER-USER  all  --  anywhere             anywhere            
DOCKER-ISOLATION-STAGE-1  all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
DOCKER     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
DOCKER     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
DOCKER     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

Chain DOCKER (3 references)
target     prot opt source               destination         
ACCEPT     tcp  --  anywhere             172.18.0.2           tcp dpt:9001
ACCEPT     tcp  --  anywhere             172.17.0.2           tcp dpt:1880
ACCEPT     tcp  --  anywhere             172.18.0.2           tcp dpt:1883
ACCEPT     udp  --  anywhere             172.17.0.2           udp dpt:snmp-trap
ACCEPT     tcp  --  anywhere             172.18.0.3           tcp dpt:http-alt
ACCEPT     udp  --  anywhere             172.17.0.2           udp dpt:snmp

Chain DOCKER-ISOLATION-STAGE-1 (1 references)
target     prot opt source               destination         
DOCKER-ISOLATION-STAGE-2  all  --  anywhere             anywhere            
DOCKER-ISOLATION-STAGE-2  all  --  anywhere             anywhere            
DOCKER-ISOLATION-STAGE-2  all  --  anywhere             anywhere            
RETURN     all  --  anywhere             anywhere            

Chain DOCKER-ISOLATION-STAGE-2 (3 references)
target     prot opt source               destination         
DROP       all  --  anywhere             anywhere            
DROP       all  --  anywhere             anywhere            
DROP       all  --  anywhere             anywhere            
RETURN     all  --  anywhere             anywhere            

Chain DOCKER-USER (1 references)
target     prot opt source               destination         
RETURN     all  --  anywhere             anywhere  

What do you expect to happen?

I expected to see a SNMP trap in the debug

Please tell us about your environment:

  • Node-RED version: 3.0.2 (docker container)
  • node.js version: v16.16.0
  • npm version: ?
  • Platform/OS: Linux , Raspberry Pi
  • Browser: n/a
$ docker ps
CONTAINER ID   IMAGE                   COMMAND                  CREATED        STATUS                    PORTS                                                                                              NAMES
b9186fbb95b3   koenkk/zigbee2mqtt      "docker-entrypoint.s…"   4 months ago   Up 32 seconds             0.0.0.0:8080->8080/tcp, :::8080->8080/tcp                                                          zigbee2mqtt
d72af5dd46e8   eclipse-mosquitto:2.0   "/docker-entrypoint.…"   4 months ago   Up 32 seconds             0.0.0.0:1883->1883/tcp, :::1883->1883/tcp, 0.0.0.0:9001->9001/tcp, :::9001->9001/tcp               mqtt
dd6470bf5577   nodered/node-red        "./entrypoint.sh"        5 months ago   Up 32 seconds (healthy)   0.0.0.0:161-162->161-162/udp, :::161-162->161-162/udp, 0.0.0.0:1880->1880/tcp, :::1880->1880/tcp   mynodered

I do not think this node is designed to receive SNMP Traps, I believe it fetches data from agents as a result of a trigger instead. Perhaps this would be better suited for what you are trying to achieve:
node-red-contrib-snmp-trap-listener

AndKe commented

@wooferguy thank you - it worked instantly! :)