<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Greetings,<br>
<br>
I am having difficulties with snmp_check and MIB translation.<br>
<br>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<b>DEBIAN INFORMATION<br>
</b>socram@backup:~$ lsb_release -a<br>
No LSB modules are available.<br>
Distributor ID: Debian<br>
Description: Debian GNU/Linux 8.2 (jessie)<br>
Release: 8.2<br>
Codename: jessie<br>
<br>
This a very fresh install. Dated 30/11/2015.<br>
<br>
<b>NAGIOS-PLUGINS VERSION<br>
</b>socram@t430:/etc/alternatives$ apt-cache showpkg
nagios-plugins-standard | grep -A 1 Versions<br>
Versions: <br>
2.1.1-1
(/var/lib/apt/lists/ftp.pt.debian.org_debian_dists_jessie_main_binary-amd64_Packages)<br>
<br>
<b>SNMPGET VERSION<br>
</b>socram@backup:/usr/lib/nagios/plugins$ snmpget -V<br>
NET-SNMP version: 5.7.2.1<br>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<br>
<br>
<b>ABOUT THE COMMUNITY STRING ISSUE<br>
</b>At least in my version of check_snmp, the help page mentions
that verbose output might be truncated with the "-v" option.<br>
The following is the relevant excerpt:<br>
"<br>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<span style="color: rgb(46, 139, 87); font-family: Monaco, 'Andale
Mono', 'Courier New', Courier, mono; font-size: 11.7px;
font-style: normal; font-variant: normal; font-weight: normal;
letter-spacing: normal; line-height: 15.21px; orphans: auto;
text-align: start; text-indent: 0px; text-transform: none;
white-space: normal; widows: 1; word-spacing: 0px;
-webkit-text-stroke-width: 0px; display: inline !important; float:
none; background-color: rgb(255, 255, 255);"> -v, --verbose</span><br
style="margin: 0px; padding: 0px; color: rgb(46, 139, 87);
font-family: Monaco, 'Andale Mono', 'Courier New', Courier, mono;
font-size: 11.7px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: 15.21px;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: 1;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);">
<span style="color: rgb(46, 139, 87); font-family: Monaco, 'Andale
Mono', 'Courier New', Courier, mono; font-size: 11.7px;
font-style: normal; font-variant: normal; font-weight: normal;
letter-spacing: normal; line-height: 15.21px; orphans: auto;
text-align: start; text-indent: 0px; text-transform: none;
white-space: normal; widows: 1; word-spacing: 0px;
-webkit-text-stroke-width: 0px; display: inline !important; float:
none; background-color: rgb(255, 255, 255);"> Show details for
command-line debugging (output may be truncated by</span><br
style="margin: 0px; padding: 0px; color: rgb(46, 139, 87);
font-family: Monaco, 'Andale Mono', 'Courier New', Courier, mono;
font-size: 11.7px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: 15.21px;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: 1;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);">
<span style="color: rgb(46, 139, 87); font-family: Monaco, 'Andale
Mono', 'Courier New', Courier, mono; font-size: 11.7px;
font-style: normal; font-variant: normal; font-weight: normal;
letter-spacing: normal; line-height: 15.21px; orphans: auto;
text-align: start; text-indent: 0px; text-transform: none;
white-space: normal; widows: 1; word-spacing: 0px;
-webkit-text-stroke-width: 0px; display: inline !important; float:
none; background-color: rgb(255, 255, 255);"> the monitoring
system)<br>
"</span><br>
I tested this option and it truncates the "-C" option and the
respective string at the very least.<br>
<br>
<br>
<b>MIB TRANSLATION ISSUE<br>
</b>This is the part that I am having issues.<br>
<br>
The following is an example using a MIB:<br>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
socram@backup:/usr/lib/nagios/plugins$ ./check_snmp -v -H
192.168.1.90 -o iso.3.6.1.2.1.1.7.0 -C public -P 2c<br>
/usr/bin/snmpget -Le -t 1 -r 5 -m ALL -v 2c [authpriv]
192.168.1.90:161 iso.3.6.1.2.1.1.7.0<br>
CRITICAL - Plugin timed out while executing system call<br>
<br>
Note: As you can see the plugin times out. I do not recall how long
it was hanging for, but it was more than a second.<br>
<br>
The following is an example using the respective OID of the previous
MIB:<br>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
socram@backup:/usr/lib/nagios/plugins$ ./check_snmp -v -H
192.168.1.90 -o .1.3.6.1.2.1.1.7.0 -C public -P 2c<br>
/usr/bin/snmpget -Le -t 1 -r 5 -m '' -v 2c [authpriv]
192.168.1.90:161 .1.3.6.1.2.1.1.7.0<br>
iso.3.6.1.2.1.1.7.0 = INTEGER: 72<br>
SNMP OK - 72 | iso.3.6.1.2.1.1.7.0=72<br>
<br>
Note: The result is instantaneous.<br>
<br>
Now to test if <i>snmpget</i> is able to translate the previous
MIB:<br>
socram@backup:~$ /usr/bin/snmpget -Le -t 1 -r 5 -m ALL -v 2c -c
public 192.168.1.90:161 iso.3.6.1.2.1.1.7.0<br>
MIB search path:
/home/socram/.snmp/mibs:/usr/share/snmp/mibs:/usr/share/snmp/mibs/iana:/usr/share/snmp/mibs/ietf:/usr/share/mibs/site:/usr/share/snmp/mibs:/usr/share/mibs/iana:/usr/share/mibs/ietf:/usr/share/mibs/netsnmp<br>
(...)<br>
iso.3.6.1.2.1.1.7.0 = INTEGER: 72<br>
<br>
Note: The "(...)" means output that I truncated myself. This is
because there are exactly 1425 lines of stderr there. I have annexed
a file with the "std" and "stderr" outputs. As a general
description, the file contains lines of failure to load, find and
adopt modules or OIDs.<br>
<br>
<br>
Regards.<br>
<br>
</body>
</html>