NodeBrain Module Reference
Release 0.6.4 - April 2006

< Prev Table of Contents Next >

7         Snmptrap Module

 

The Snmptrap module provides an expert that monitors SNMP V1 and V2 traps.  This expert listens on a specified port and interface for SNMP traps.  By default it listens to port 162 on all interfaces.

 

          define snmptrap expert snmptrap; # default to port 162

          define snmptrap expert snmptrap(50162); # alternate port

          define snmptrap expert snmptrap(“127.0.0.1”); # interface address

          define snmptrap expert snmptrap(“127.0.0.1:50162”); # both

 

When a trap is received, the expert sends an alert command to its own context.  Since this module is not MIB aware, the generated alert command references NodeBrain terms that are single quoted OID’s.

 

          alert ‘<oid>’=<value>,…;

 

You can reference these OID terms in you NodeBrain rules, or define aliases as illustrated in the example below.

 

declare snmptrap module /usr/local/lib/nb/nb_mod_snmptrap.?;

define snmptrap expert snmptrap.snmptrap;

snmptrap. define snmpTrap      cell '1.3.6.1.6.3.1.1.4.1.0';

snmptrap. define myMsgText     cell '1.3.6.1.4.1.2789.2005.1';

snmptrap. define myRestartTrap cell snmpTrap="1.3.6.1.4.1.2789.2005.0.2476317";

snmptrap. define r1 if(myRestartTrap and myMsgText~~"WWW"):$ - echo "$${myMsgText}"

 

 

To send your own traps to this expert, you will need a utility for sending traps.  Examples are shown below using the snmptrap in the Net-SNMP package.

 

snmptrap -v 1 -d -c public localhost .1.3.6.1.4.1.2789.2005 localhost 6 2476317 '' \

          .1.3.6.1.4.1.2789.2005.1 s "WWW Server Has Been Restarted"

 

snmptrap -v 2c -d -c public localhost '' .1.3.6.1.6.3.1.1.5.3 \

          ifIndex i 2   ifAdminStatus i 1    ifOperStatus i 1

 

 


Copyright © 2003-2006 The Boeing Company