Result of Manubulon plugin using ifName instead of ifDescr

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
DanielB
Posts: 77
Joined: Sun Aug 17, 2014 2:17 pm

Result of Manubulon plugin using ifName instead of ifDescr

Post by DanielB »

Hi all!

A few days ago I decided to migrate my own servers to Debian GNU/Linux Jessie. Having migrated my firewall, I started getting an error in the Manubulon plugin check_snmp_int.pl since it does not find the interface eth1.

Code: Select all

# ./check_snmp_netint.pl -H 10.1.0.10 -l Us3r -x passw0rd0 -X passwOrd1 -L md5,des -w 1500,295 -c 2500,400 \
> -k -B --label -M -B --label -n eth1
ERROR : Unknown interface eth1
This was running smoothly prior to migration, although it now seems to have changed the description:

Code: Select all

# ./check_snmp_netint.pl -H 10.1.0.10 -l Us3r -x passw0rd0 -X passwOrd1 -L md5,des -n -v
Alarm at 10 + 5
SNMPv3 AuthPriv login : Us3r, md5, des
Filter : 
OID : 1.3.6.1.2.1.2.2.1.2.2, Desc : Realtek Semiconductor Co., Ltd. RTL-8100/8101L/8139 PCI Fast Ethernet Adapter
OID : 1.3.6.1.2.1.2.2.1.2.1, Desc : lo
OID : 1.3.6.1.2.1.2.2.1.2.3, Desc : VIA Technologies, Inc. VT6102 [Rhine-II]
OID : 1.3.6.1.2.1.2.2.1.2.4, Desc : tun0
Name : Realtek Semiconductor Co., Ltd. RTL-8100/8101L/8139 PCI Fast Ethernet Adapter, Index : 2
Realtek Semiconductor Co., Ltd. RTL-8100/8101L/8139 PCI Fast Ethernet Adapter:UP:(1 UP): OK |
So I checked the equivalence between ifDescr and ifName:

Code: Select all

# snmpwalk -v 3 -u Us3r -l authPriv -a MD5 -A passw0rd0 -x DES -X passwOrd1 10.1.0.10 ifDescr
IF-MIB::ifDescr.1 = STRING: lo
IF-MIB::ifDescr.2 = STRING: Realtek Semiconductor Co., Ltd. RTL-8100/8101L/8139 PCI Fast Ethernet Adapter
IF-MIB::ifDescr.3 = STRING: VIA Technologies, Inc. VT6102 [Rhine-II]
IF-MIB::ifDescr.4 = STRING: tun0

Code: Select all

# snmpwalk -v 3 -u Us3r -l authPriv -a MD5 -A passw0rd0 -x DES -X passwOrd1 10.1.0.10 ifName
IF-MIB::ifName.1 = STRING: lo
IF-MIB::ifName.2 = STRING: eth1
IF-MIB::ifName.3 = STRING: eth0
IF-MIB::ifName.4 = STRING: tun0
I could use something like this, but the output is extremely long:

Code: Select all

# ./check_snmp_netint.pl -H 10.1.0.10 -l Us3r -x passw0rd0 -X passwOrd1 -L md5,des -w 1500,295 -c 2500,400 -k -B --label -k -B --label -n "Realtek.*"
Realtek Semiconductor Co., Ltd. RTL-8100/8101L/8139 PCI Fast Ethernet Adapter:UP (in=93.0Kbps/out=13.1Kbps):(1 UP): OK |
Any suggestions to return to the original behavior?

Thanks in advance.

Best regards,
Daniel
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Result of Manubulon plugin using ifName instead of ifDes

Post by scottwilkerson »

Depending on the version of the plugin you are using, you can add the -N flag to determine what OID to compare the name against

Code: Select all

-N, --descrname_oid=OID
   SNMP OID of the description table (optional for non-standard equipment)
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
DanielB
Posts: 77
Joined: Sun Aug 17, 2014 2:17 pm

Re: Result of Manubulon plugin using ifName instead of ifDes

Post by DanielB »

Hi, Scott.

Thanks for your reply.

Initially I was using the original Manubulon plugin, check_snmp_int.pl, which is the last version, I think, dating from 2007. This version does not have the "-N" option.

But researching in the internet I found the check_snmp_netint.pl plugin which looks like a revamped version of the Manubulon plugin check_snmp_int.pl. In fact, I've seen in the comments that Patrick Proy, developer of check_snmp_int.pl plugin, has worked in check_snmp_netint.pl.

I'm not sure if Patrick's plugin is still in development. Maybe you can clearing that. Maybe now he is working with other developers (William Leibzon, and others) in this newer version. This plugin (check_snmp_netint.pl) does have the "-N" option, but for some reason I could not identify, it is not working for me.

Code: Select all

# ./check_snmp_netint.pl -H 10.1.0.10 -l Us3r -x passw0rd0 -X passwOrd1 -L md5,des -w 1500,295 -c 2500,400 -n -v
Alarm at 10 + 5
SNMPv3 AuthPriv login : Us3r, md5, des
Filter :
OID : 1.3.6.1.2.1.2.2.1.2.2, Desc : Realtek Semiconductor Co., Ltd. RTL-8100/8101L/8139 PCI Fast Ethernet Adapter
OID : 1.3.6.1.2.1.2.2.1.2.1, Desc : lo
OID : 1.3.6.1.2.1.2.2.1.2.3, Desc : VIA Technologies, Inc. VT6102 [Rhine-II]
OID : 1.3.6.1.2.1.2.2.1.2.4, Desc : tun0
Name : Realtek Semiconductor Co., Ltd. RTL-8100/8101L/8139 PCI Fast Ethernet Adapter, Index : 2
Realtek Semiconductor Co., Ltd. RTL-8100/8101L/8139 PCI Fast Ethernet Adapter:UP:(1 UP): OK |

Code: Select all

# ./check_snmp_netint.pl -H 10.1.0.10 -l Us3r -x passw0rd0 -X passwOrd1 -L md5,des -w 1500,295 -c 2500,400 -N 1.3.6.1.2.1.2.2.1.2.2
Usage: ./check_snmp_netint.pl [-v [debugfilename]] -H <host> (-C <snmp_community> [-2]) | (-l login -x passwd [-X pass -L <authp>,<privp>)  [-p <port>] [-N <desc table oid>] -n <name in desc_oid> [-O <comments table OID>] [-I] [-i | -a | -D] [-r] [-f[eSyYZ] [-P <previous perf data from nagios $SERVICEPERFDATA$>] [-T <previous time from nagios $LASTSERVICECHECK$>] [--pcount=<hist size in perf>]] [-k[qBMGu] [-S [intspeed]] -g [-w<warn levels> -c<crit levels> [-z]| -z] -d<delta>] [-o <octet_length>] [-m|-mm] [-t <timeout>] [-s] [--label] [--cisco=[oper,][addoper,][linkfault,][use_portnames|show_portnames]] [--stp[=<expected stp state>]] [-V]
It returns the options like there was something wrong with the syntax used.


Best regards,
Daniel
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Result of Manubulon plugin using ifName instead of ifDes

Post by ssax »

I get the same problem, it requires you to puth in the -n option.

It seems to work with the development version: http://exchange.nagios.org/components/c ... 5&cf_id=35

Please give that a try and see if it works for you.
DanielB
Posts: 77
Joined: Sun Aug 17, 2014 2:17 pm

Re: Result of Manubulon plugin using ifName instead of ifDes

Post by DanielB »

Hello, ssax.

Thanks for your reply.

I've tried check_snmp_netint.pl adding the "-n" option, but it has not worked for me. Although in this case the output is different:

Code: Select all

# ./check_snmp_netint.pl -H 10.1.0.10 -l Us3r -x passw0rd0 -X passwOrd1 -L md5,des -w 1500,295 -c 2500,400 -n -N 1.3.6.1.2.1.2.2.1.2.2
ERROR: Description table : The requested table is empty or does not exist.

Code: Select all

# ./check_snmp_netint.pl -H 10.1.0.10 -l Us3r -x passw0rd0 -X passwOrd1 -L md5,des -w 1500,295 -c 2500,400 -n -N 1.3.6.1.2.1.2.2.1.2.3
ERROR: Description table : The requested table is empty or does not exist.
I have also tried the check_netint.pl plugin (thanks for the suggestion) with "-N" and "-n -N" but in both cases I get the same error:

Code: Select all

# ./check_netint.pl -H 10.1.0.10 -l Us3r -x passw0rd0 -X passwOrd1 -L md5,des -w 1500,295 -c 2500,400 -n -N 1.3.6.1.2.1.2.2.1.2.2
ERROR: Description table : The requested table is empty or does not exist.
# ./check_netint.pl -H 10.1.0.10 -l Us3r -x passw0rd0 -X passwOrd1 -L md5,des -w 1500,295 -c 2500,400 -N 1.3.6.1.2.1.2.2.1.2.2
ERROR: Description table : The requested table is empty or does not exist.

Code: Select all

# ./check_netint.pl -H 10.1.0.10 -l Us3r -x passw0rd0 -X passwOrd1 -L md5,des -w 1500,295 -c 2500,400 -n -N 1.3.6.1.2.1.2.2.1.2.3
ERROR: Description table : The requested table is empty or does not exist.
# ./check_netint.pl -H 10.1.0.10 -l Us3r -x passw0rd0 -X passwOrd1 -L md5,des -w 1500,295 -c 2500,400 -N 1.3.6.1.2.1.2.2.1.2.3
ERROR: Description table : The requested table is empty or does not exist.
Best regards,
Daniel
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Result of Manubulon plugin using ifName instead of ifDes

Post by ssax »

Can you see if it at least gets you all the interfaces with:

Code: Select all

./check_netint.pl -H 10.1.0.10 -l Us3r -x passw0rd0 -X passwOrd1 -L md5,des -w 1500,295 -c 2500,400 -N 1.3.6.1.2.1.2.2.1.2
DanielB
Posts: 77
Joined: Sun Aug 17, 2014 2:17 pm

Re: Result of Manubulon plugin using ifName instead of ifDes

Post by DanielB »

Hi, ssax.

I tried your suggestion and with some warnings, I think, of Perl, the plugin informs the interfaces:

Code: Select all

# ./check_netint.pl -H 10.1.0.10 -l Us3r -x passw0rd0 -X passwOrd1 -L md5,des -w 1500,295 -c 2500,400 -N 1.3.6.1.2.1.2.2.1.2
Use of uninitialized value within @oid_perf_inoct in hash element at ./check_netint.pl line 2023.
Use of uninitialized value within @oid_perf_inoct in hash element at ./check_netint.pl line 2023.
Use of uninitialized value within @oid_perf_inoct in hash element at ./check_netint.pl line 2023.
Use of uninitialized value within @oid_perf_inoct in hash element at ./check_netint.pl line 2023.
Realtek Semiconductor Co., Ltd. RTL-8100/8101L/8139 PCI Fast Ethernet Adapter:UP, lo:UP, VIA Technologies, Inc. VT6102 [Rhine-II]:UP, tun0:UP (4 UP): OK
In fact, if I invoke the plugin with "-n -v", it displays all interfaces (as happened with check_snmp_int.pl and check_snmp_netint.pl):

Code: Select all

# ./check_netint.pl -H 10.1.0.10 -l Us3r -x passw0rd0 -X passwOrd1 -L md5,des -w 1500,295 -c 2500,400 -n -v
Alarm at 10 + 5
Filter :
SNMPv3 AuthPriv login : Us3r, md5, des
Getting Interfaces Description Table (1.3.6.1.2.1.2.2.1.2):
 OID : 1.3.6.1.2.1.2.2.1.2.2, Clean Desc : Realtek Semiconductor Co., Ltd. RTL-8100/8101L/8139 PCI Fast Ethernet Adapter, Raw Desc: Realtek Semiconductor Co., Ltd. RTL-8100/8101L/8139 PCI Fast Ethernet Adapter
 OID : 1.3.6.1.2.1.2.2.1.2.1, Clean Desc : lo, Raw Desc: lo
 OID : 1.3.6.1.2.1.2.2.1.2.3, Clean Desc : VIA Technologies, Inc. VT6102 [Rhine-II], Raw Desc: VIA Technologies, Inc. VT6102 [Rhine-II]
 OID : 1.3.6.1.2.1.2.2.1.2.4, Clean Desc : tun0, Raw Desc: tun0
Name : Realtek Semiconductor Co., Ltd. RTL-8100/8101L/8139 PCI Fast Ethernet Adapter, Index : 2
Doing snmp request on status table OIDs: 1.3.6.1.2.1.2.2.1.8.2
Finished SNMP request. Result contains 1 entries:
 1.3.6.1.2.1.2.2.1.8.2 = 1
Use of uninitialized value within @oid_perf_inoct in hash element at ./check_netint.pl line 2023.
Realtek Semiconductor Co., Ltd. RTL-8100/8101L/8139 PCI Fast Ethernet Adapter:UP (1 UP): OK
Thanks for your reply.

Best regards,
Daniel
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Result of Manubulon plugin using ifName instead of ifDes

Post by ssax »

Apparently you can use the -s command to make the output shorter:
To make output shorter, specially when you have many interfaces, you can put
the -s option. It will get only the first <n> characters of the interface
description. If the number is negative then get the last <n> characters.

Ex : EL20005 3Com Gigabit NIC (3C2000 Family)
-s 4 will output : "EL20".
-s -4 will output : "ily)".
DanielB
Posts: 77
Joined: Sun Aug 17, 2014 2:17 pm

Re: Result of Manubulon plugin using ifName instead of ifDes

Post by DanielB »

Hi, ssax.

It is interesting what you mention about the "-s" option. I appreciate you have taking the time to investigate it. I'll keep that in mind as an alternative, since I still think it is easier to identify interfaces such as eth0, eth1, etc, rather than by its manufacturer/model.

It's a pity If I can not solve it because quite a while I was using the check_snmp_int plugin and was very happy with their results. But now in Debian Jessie I'm having this problem. It seems that something has changed in the SNMP service included in the new version of Debian since before (on Debian Wheezy) the description matched the ifName:

Code: Select all

# ./check_snmp_netint.pl -H srv01.freesoftware -C public -w 1500,295 -c 2500,400 -n -v
Alarm at 10 + 5
SNMP v1 login
Filter : 
OID : 1.3.6.1.2.1.2.2.1.2.2, Desc : eth0
OID : 1.3.6.1.2.1.2.2.1.2.1, Desc : lo
Name : eth0, Index : 2
eth0:UP:(1 UP): OK |
Best regards.
Daniel
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Result of Manubulon plugin using ifName instead of ifDes

Post by ssax »

Yeah, sounds like instead of the OID desc being eth0 like it used to be it's just listing the actual name.

You could ask around in the Debian forums and see if someone there could help you but it would be something that you would have to change on each new host unless they can come up with an alternate solution.
Locked