<html><body><div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; color: rgb(0, 0, 0);"><div>Ignore me from last week.<br><br>snmpget modifies it's commandline in proc to replace the community string with spaces...<br><br>The real problem was that snmpget was verbosely whinging about crappy MIBs that it filled up the stderr buffer.<br>Meanwhile check_snmp is waiting to read from snmpget's stdout before it reads from stderr.<br><br>https://github.com/monitoring-plugins/monitoring-plugins/issues/1706 reported with quick fix of reading stderr before stdin</div>
<div> </div>
<div>cheers,</div>
<div>Woody</div>
<div> </div>
<div id="OLK_SRC_BODY_SECTION">
<div id="OLK_SRC_BODY_SECTION">
<blockquote style="margin: 0 0 0 0.8em; border-left: 1px #ccc solid; padding-left: 1em;"><hr id="MESSAGE_DATA_MARKER"><strong>From: </strong>Anthony <anthony.wood@sol1.com.au><br><strong>To: </strong>help <help@monitoring-plugins.org><br><strong>Date: </strong>Monday, 13 September 2021 5:13 PM AEST<br><strong>Subject: </strong>check_snmp not passing community to snmpget<br><br>
<div style="font-size: 12pt; font-family: 'arial' , 'helvetica' , sans-serif; color: #000000;">
<div style="font-size: 12pt; font-family: 'arial' , 'helvetica' , sans-serif; color: #000000;">
<div>Affected Versions monitoring-plugins 2.1.2,2.2,2.3<br>Affected OSes: Ubuntu 18.04.5 LTS, Debian 10</div>
<div><br>Basically the check_snmp plugin is losing the community string on the way through and replacing it with the same number of spaces.</div>
<div> </div>
<div>
<div>root@subview:/etc/icinga2# /usr/bin/snmpget -Le -t 10 -r 5 -m '' -v 1 [context] [authpriv] 10.23.132.51:161 .1.3.6.1.4.1.4515.1.3.1.7.0</div>
<div>pstree -paul 5552</div>
<div>check_snmp,5552 -H 10.23.132.51 -C admin -o .1.3.6.1.4.1.4515.1.3.1.7.0 -v</div>
<div>  └─snmpget,5553 -Le -t 10 -r 5 -m  -v 1 -c       10.23.132.51:161 .1.3.6.1.4.1.4515.1.3.1.7.0</div>
<div><br>This is obvious when you use a long community string.<br><br>
<div>root@prod-icinga:~# /usr/lib/nagios/plugins/check_snmp  -H 10.23.132.51 -C obviously_long_community_string -o .1.3.6.1.4.1.4515.1.3.1.7.0 -v &</div>
<div>[1] 432</div>
<div>root@prod-icinga:~# /usr/bin/snmpget -Le -t 10 -r 5 -m '' -v 1 [context] [authpriv] 10.23.132.51:161 .1.3.6.1.4.1.4515.1.3.1.7.0</div>
<div>pstree -paul 432</div>
<div>check_snmp,432 -H 10.23.132.51 -C obviously_long_community_string -o .1.3.6.1.4.1.4515.1.3.1.7.0 -v</div>
<div>  └─snmpget,433 -Le -t 10 -r 5 -m  -v 1 -c                                 10.23.132.51:161 .1.3.6.1.4.1.4515.1.3.1.7.0</div>
<div>root@prod-icinga:~# </div>
<div> </div>
Expected behaviour would be an snmpget command line including the community string, which would return the expected result.</div>
<div> </div>
<div>Current behaviour is that:</div>
<div>- snmpget outputs the help message on stderr (after complaining about MIBs)<br>- check_snmp times out after about a minute<br><br>Is anyone using check_snmp successfully ? which versions?<br><br>cheers,</div>
<div>Woody</div>
</div>
</div>
</div>
<br><br></blockquote>
</div>
</div></div></body></html>