SNMP trap receiving - iptables
-
I am running mango version 4.0.0 and trying to get SNMP traps working. I have added a rule to iptables to forward snmp traps from port 162 to 1162 using this command. I have changed my data source to look for traps on port 1162.
iptables -t nat -A PREROUTING -i eth0 -p udp --dport 162 -j REDIRECT --to-port 1162
iptables -I INPUT -p udp --destination-port 162 -j ACCEPTWhen run the iptables list I get this
when I run netstat I can see that port 1162 is bound to java so that all looks good
So I think the issue might be with my understanding of the iptables rule. Is the above iptables rule correct?
I have used wireshark to packet sniff my trap sender, the traps are definitely being generated.
In mango how can I check if the traps are being received in the application apart from looking at the data point in the data source?
My test device is a router and I am monitoring a spare ethernet port for UP/DOWN status. only the get requests are updating the port status. The trap generation has no effect on the data point.
-
Try
iptables -t nat -A PREROUTING -p UDP -i eth0 -d 127.0.0.1 --dport 162 -j DNAT --to-destination 127.0.0.1:1162
you may need to change the -d property to match the destination ip sent by your snmp device. Just a shot in the dark here, been a while since I have used ip tables...
Fox
-
@mattfox said in SNMP trap receiving - iptables:
iptables -t nat -A PREROUTING -p UDP -i eth0 -d 127.0.0.1 --dport 162 -j DNAT --to-destination 127.0.0.1:1162
Hi Matt is there anyway to packet sniff the data in Mango? The only way I am testing this at the moment is looking at the data point in the watch list or the data point in the data source. Are there any tools for seeing if the UDP packets are making it into Mango?
-
Run wireshark on the mango unit.
sudo apt-get install wireshark
Also turn on logging on the datasource if it has it