Page 1 of 1

Sending SNMP traps

Posted: Fri May 23, 2008 3:53 pm
by comaco
Hi all!

Does somebody know how to send snmp traps in a script, i.e. to notify an interface down??
(using RouterOS 3.9)

THANKS!

Re: Sending SNMP traps

Posted: Fri May 23, 2008 8:20 pm
by JJCinAZ
There is no way to do that. You can use an external system to poll SNMP values or you can simulate the traps using the Netwatch tool. The tool can either email a notice or you can create an SNMP Trap Proxy using PHP or Perl on an external system whereby you can then execute the Fetch tool via a Netwatch and the HTTP GET talks to your SNMP Trap proxy which in turn fires the Trap(s). It's a little Rube Goldberg-ish, but we get paid to be creative, don't we?

Re: Sending SNMP traps

Posted: Mon May 26, 2008 2:11 pm
by comaco
There is no way to do that. You can use an external system to poll SNMP values or you can simulate the traps using the Netwatch tool. The tool can either email a notice or you can create an SNMP Trap Proxy using PHP or Perl on an external system whereby you can then execute the Fetch tool via a Netwatch and the HTTP GET talks to your SNMP Trap proxy which in turn fires the Trap(s). It's a little Rube Goldberg-ish, but we get paid to be creative, don't we?
:D
OK, thanks a lot!!

But now, I wonder why has been included the "send-trap" tool in the ultimate RouterOS versions... I promise I've tried to make it work, but no success at all.

Re: Sending SNMP traps

Posted: Mon May 26, 2008 6:56 pm
by JJCinAZ
Well shucks... there it is. I totally forgot that was added to v3 -- but then we haven't rolled out v3 for production use yet.

It looks like you can setup a trap destination and tell the system to fire a trap on an interface change with
/snmp set trap-generators=interfaces 
or with the
/snmp send-trap
, but neither worked in my testing with v3.9 (no snmp packets left the router).