Nagios plugin check_snmp_int does not match regular expression

nagiosregex

I am using nagios plugin check_snmp_int with -n switch. Help show:

-n, --name=NAME
   Name in description OID (eth0, ppp0 ...).
   This is treated as a regexp : -n eth will match eth0,eth1,...
   Test it before, because there are known bugs (ex : trailling /)

So It should work with regex but it does not look like. I try to match exact description of adapter "Marvell Yukon 88E8056 PCI-E Gigabit Ethernet Controller", but it gives me all adapters matching this string or nothing. I have also other adapters with names:

Marvell Yukon 88E8056 PCI-E Gigabit Ethernet Controller - Deterministic Network Enhancer Miniport
Marvell Yukon 88E8056 PCI-E Gigabit Ethernet Controller #2
...

I tried regex Controller$, which work well with grep command, but did not match anything with check_snmp_int command.

I tried also turn off regex with -r switch, but then did not found anything.

Any ideas how to solve that without changing description on adapter?

Best Answer

I found solution which works well also with performance data generation:

/usr/lib/nagios/plugins/check_snmp_netint.pl -H xxx.xxx.xxx.xxx -C public -n "Marvell Yukon 88E8056 PCI-E Gigabit Ethernet Controller$" -fZkz

You should now see output like this:

Marvell Yukon 88E8056 PCI-E Gigabit Ethernet Controller:UP (1.0KBps/7.0KBps) :(1 UP): OK |  'Marvell Yukon 88E8056 PCI-E Gigabit Ethernet Controller_in_octet'=275793073c 'Marvell Yukon 88E8056 PCI-E Gigabit Ethernet Controller_out_octet'=74278639c

When your graph do not work till now and you see output also with part after "|" , just delete old rrd and xml file for service located at:

/var/lib/pnp4nagios/perfdata

As you can see I used pnp4nagios as graphing tool. Hope this helps someone.

Related Topic