[CentOS] OT: forwarding SNMP traps

James Pifer jep at obrien-pifer.com
Fri Sep 28 14:36:47 EDT 2012


Can anyone here give me a hand with forwarding snmp traps? I'm looking at Zenoss and I 
want to see how it handles snmp traps. We currently have snmp traps getting sent to two 
servers. One of them is basically ignoring the traps, but I can't just change the ip address (to 
give to Zenoss) because of other things the host is doing.

So instead I'd like to simply forward the snmp traps to the new zenoss system. I've tried a 
couple different forwarding programs, like jredirect and a python script I found while 
searching. I use jredirect to forward some other things, but I'm guessing it doesn't like udp.

I've also tried figuring out snmptrapd and snmpd without any success at all. 

Last, I tried simply using iptables with something like:
# iptables -t nat -A PREROUTING -i eth0 -p udp -m udp --dport 162 -j DNAT --to-destination 
192.168.1.3:162
# iptables -A INPUT -i eth0 -p udp -m udp --dport 162 -j ACCEPT

But that doesn't seem to work either. 

I can see running wireshark on both systems that the old server is receiving traps, but they 
are never getting forwarded to the zenoss system. 

Anyone here know how to do it? Any assistance is appreciated. 

Thanks,
James


More information about the CentOS mailing list