...
Code Block |
---|
/usr/share/nagios3/plugins/eventhandlers/submit_check_result |
Creating a MIB
To create a MIB for openwsn I used a very friendly gui program named snmpb.
As a reference other MIBs can be used. Using snmpb you can load them (located at /usr/share/apps/snmpb/mib) and modify the fields according to your needs. The following example is a very simple approximation to what we want to monitor from motes. Note that in some cases, instead of single values we want to deal with arrays as a mote can have more than one neighbor.
Code Block |
---|
OPENWSN-MIB DEFINITIONS ::= BEGIN
IMPORTS
MODULE-IDENTITY, OBJECT-TYPE,
experimental FROM SNMPv2-SMI
TimeInterval, DisplayString
FROM SNMPv2-TC;
openwsnMIB MODULE-IDENTITY
LAST-UPDATED "9801290000Z"
ORGANIZATION "UC Berkeley"
CONTACT-INFO
" Xavi Vilajosana
Postal: Cory Hall
Swarm Lab.UC Berkeley.
Berkeley, CA 94720.
US
Email: xvilajosana@eecs.berkeley.edu"
DESCRIPTION
"The MIB module for entities running OpenWSN."
::= { experimental 88 }
nodeId OBJECT-TYPE
SYNTAX DisplayString (SIZE (0..8))
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The 64bit ID of the mote"
::= { openwsnMIB 1 }
rank OBJECT-TYPE
SYNTAX INTEGER
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The rank in the network."
::= { openwsnMIB 2 }
nodeType OBJECT-TYPE
SYNTAX INTEGER {
base-station(1),
node(2)
}
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"whether it is base station or not."
::= { openwsnMIB 3 }
numTx OBJECT-TYPE
SYNTAX INTEGER
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The number of tx packets."
::= { openwsnMIB 4 }
numRx OBJECT-TYPE
SYNTAX INTEGER
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The number of rx packets."
::= { openwsnMIB 5 }
numTxAck OBJECT-TYPE
SYNTAX INTEGER
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The number of acks received."
::= { openwsnMIB 6 }
END |
(download this mib)
Conclusion
TBD...
References
...
http://askaralikhan.blogspot.com/2010/12/receiving-snmp-traps-in-nagios.html