Result of Manubulon plugin using ifName instead of ifDescr

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Result of Manubulon plugin using ifName instead of ifDescr

Postby DanielB » Sat Mar 07, 2015 2:10 pm

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
DanielB
 
Posts: 77
Joined: Sun Aug 17, 2014 2:17 pm

Re: Result of Manubulon plugin using ifName instead of ifDes

Postby scottwilkerson » Mon Mar 09, 2015 3:28 pm

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)
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 15030
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Result of Manubulon plugin using ifName instead of ifDes

Postby DanielB » Tue Mar 10, 2015 10:38 am

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
DanielB
 
Posts: 77
Joined: Sun Aug 17, 2014 2:17 pm

Re: Result of Manubulon plugin using ifName instead of ifDes

Postby ssax » Tue Mar 10, 2015 2:05 pm

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/com_mtree/attachment.php?link_id=1475&cf_id=35

Please give that a try and see if it works for you.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
ssax
Dreams In Code
 
Posts: 4100
Joined: Wed Feb 11, 2015 12:54 pm

Re: Result of Manubulon plugin using ifName instead of ifDes

Postby DanielB » Tue Mar 10, 2015 3:32 pm

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
DanielB
 
Posts: 77
Joined: Sun Aug 17, 2014 2:17 pm

Re: Result of Manubulon plugin using ifName instead of ifDes

Postby ssax » Tue Mar 10, 2015 4:20 pm

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
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
ssax
Dreams In Code
 
Posts: 4100
Joined: Wed Feb 11, 2015 12:54 pm

Re: Result of Manubulon plugin using ifName instead of ifDes

Postby DanielB » Tue Mar 10, 2015 4:39 pm

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
DanielB
 
Posts: 77
Joined: Sun Aug 17, 2014 2:17 pm

Re: Result of Manubulon plugin using ifName instead of ifDes

Postby ssax » Wed Mar 11, 2015 12:14 pm

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)".
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
ssax
Dreams In Code
 
Posts: 4100
Joined: Wed Feb 11, 2015 12:54 pm

Re: Result of Manubulon plugin using ifName instead of ifDes

Postby DanielB » Wed Mar 11, 2015 4:56 pm

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
DanielB
 
Posts: 77
Joined: Sun Aug 17, 2014 2:17 pm

Re: Result of Manubulon plugin using ifName instead of ifDes

Postby ssax » Thu Mar 12, 2015 1:39 pm

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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
ssax
Dreams In Code
 
Posts: 4100
Joined: Wed Feb 11, 2015 12:54 pm


Return to Nagios Core

Who is online

Users browsing this forum: anthonywong and 31 guests