Community discussions

MikroTik App
 
comaco
just joined
Topic Author
Posts: 15
Joined: Wed Nov 21, 2007 8:29 pm

Sending SNMP traps

Fri May 23, 2008 3:53 pm

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!
 
JJCinAZ
Member
Member
Posts: 475
Joined: Fri Oct 22, 2004 8:03 am
Location: Tucson, AZ

Re: Sending SNMP traps

Fri May 23, 2008 8:20 pm

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?
 
comaco
just joined
Topic Author
Posts: 15
Joined: Wed Nov 21, 2007 8:29 pm

Re: Sending SNMP traps

Mon May 26, 2008 2:11 pm

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.
 
JJCinAZ
Member
Member
Posts: 475
Joined: Fri Oct 22, 2004 8:03 am
Location: Tucson, AZ

Re: Sending SNMP traps

Mon May 26, 2008 6:56 pm

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).