-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 29/04/08 07:27 PM, Allan Clark wrote:
> (pulled cc;)
Please keep the mailing list in - Is can be useful for others.
> Are MIBs so new or unused that (like LDAP) there's not enough of a
> user-base to warrant Nagios understanding them?
Nagios has absolutely no knowledge of MIBs - basically all it know about
is hosts, services and their results... The problem you'll have is to
map a specific trap (or set of traps) to a Nagios service and alert
level with a meaningful message.
What's nice with SNMPTT is that it can parse MIBs and extract traps and
put everything in a SNMPTT config file ready for logging. You'll see the
traps, description and variables. All you have to do then is add an EXEC
line for the traps you want to send the result to Nagios, and set the
alert level and message you want (using the variables provided).
I attached a sample config file. This is basically a convert of IF-MIB
with two traps in it, linkUp and linkDown (I'm not sure it I trimmed it
of not...). What I added is the EXEC lines (and possibly modified the
FORMAT lines). Everything else is from snmpttconvertmib.
Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFIF8US6dZ+Kt5BchYRAmCUAJ4/FcqrH2rc16l5li/TFGhJtC4QugCg8fv9
Wdc4Tcyxw3RtVJ3Kl7Fh7Yg=
=92w3
-----END PGP SIGNATURE-----
MIB: IF-MIB (file:/etc/snmp/mibs/IF-MIB.txt) converted on Tue Jul 4 10:53:49
2006 using snmpttconvertmib v1.1
#
#
#
EVENT linkDown IF-MIB::linkDown "Events" Normal
FORMAT Link change: $2 state changed to $4
EXEC /usr/local/nagios/libexec/eventhandlers/submit_check_result $r "IF-MIB
Traps" 1 "Link Change: $2 state changed to $4"
SDESC
A linkDown trap signifies that the SNMP entity, acting in
an agent role, has detected that the ifOperStatus object for
one of its communication links is about to enter the down
state from some other state (but not from the notPresent
state). This other state is indicated by the included value
of ifOperStatus.
Variables:
1: ifIndex
Syntax="INTEGER32"
Descr="A unique value, greater than zero, for each interface. It
is recommended that values are assigned contiguously
starting from 1. The value for each interface sub-layer
must remain constant at least from one re-initialization of
the entity's network management system to the next re-
initialization."
2: ifAdminStatus
Syntax="INTEGER"
1: up
2: down
3: testing
Descr="The desired state of the interface. The testing(3) state
indicates that no operational packets can be passed. When a
managed system initializes, all interfaces start with
ifAdminStatus in the down(2) state. As a result of either
explicit management action or per configuration information
retained by the managed system, ifAdminStatus is then
changed to either the up(1) or testing(3) states (or remains
in the down(2) state)."
3: ifOperStatus
Syntax="INTEGER"
1: up
2: down
3: testing
4: unknown
5: dormant
6: notPresent
7: lowerLayerDown
Descr="The current operational state of the interface. The
testing(3) state indicates that no operational packets can
be passed. If ifAdminStatus is down(2) then ifOperStatus
should be down(2). If ifAdminStatus is changed to up(1)
then ifOperStatus should change to up(1) if the interface is
ready to transmit and receive network traffic; it should
change to dormant(5) if the interface is waiting for
external actions (such as a serial line waiting for an
incoming connection); it should remain in the down(2) state
if and only if there is a fault that prevents it from going
to the up(1) state; it should remain in the notPresent(6)
state if the interface has missing (typically, hardware)
components."
EDESC
#
#
#
EVENT linkUp IF-MIB::linkUp "Status Events" Normal
FORMAT Link change: $2 state changed to $4
#EXEC /usr/local/nagios/libexec/eventhandlers/submit_check_result $r "IF-MIB
Traps" 1 "Link Change: $2 state changed to $4"
SDESC
A linkUp trap signifies that the SNMP entity, acting in an
agent role, has detected that the ifOperStatus object for
one of its communication links left the down state and
transitioned into some other state (but not into the
notPresent state). This other state is indicated by the
included value of ifOperStatus.
Variables:
1: ifIndex
Syntax="INTEGER32"
Descr="A unique value, greater than zero, for each interface. It
is recommended that values are assigned contiguously
starting from 1. The value for each interface sub-layer
must remain constant at least from one re-initialization of
the entity's network management system to the next re-
initialization."
2: ifAdminStatus
Syntax="INTEGER"
1: up
2: down
3: testing
Descr="The desired state of the interface. The testing(3) state
indicates that no operational packets can be passed. When a
managed system initializes, all interfaces start with
ifAdminStatus in the down(2) state. As a result of either
explicit management action or per configuration information
retained by the managed system, ifAdminStatus is then
changed to either the up(1) or testing(3) states (or remains
in the down(2) state)."
3: ifOperStatus
Syntax="INTEGER"
1: up
2: down
3: testing
4: unknown
5: dormant
6: notPresent
7: lowerLayerDown
Descr="The current operational state of the interface. The
testing(3) state indicates that no operational packets can
be passed. If ifAdminStatus is down(2) then ifOperStatus
should be down(2). If ifAdminStatus is changed to up(1)
then ifOperStatus should change to up(1) if the interface is
ready to transmit and receive network traffic; it should
change to dormant(5) if the interface is waiting for
external actions (such as a serial line waiting for an
incoming connection); it should remain in the down(2) state
if and only if there is a fault that prevents it from going
to the up(1) state; it should remain in the notPresent(6)
state if the interface has missing (typically, hardware)
components."
EDESC
#
#
#
#
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting
any issue.
::: Messages without supporting info will risk being sent to /dev/null