check_snmp not passing community to snmpget

Anthony Wood anthony.wood at sol1.com.au
Wed Sep 8 07:21:24 CEST 2021


 
Affected Versions monitoring-plugins 2.1.2,2.2,2.3
Affected OSes: Ubuntu 18.04.5 LTS, Debian 10 

Basically the check_snmp plugin is losing the community string on the way through and replacing it with the same number of spaces. 
  
 
root at 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 
pstree -paul 5552 
check_snmp,5552 -H 10.23.132.51 -C admin -o .1.3.6.1.4.1.4515.1.3.1.7.0 -v 
  └─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 

This is obvious when you use a long community string.

 
root at 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 & 
[1] 432 
root at 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 
pstree -paul 432 
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 
  └─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 
root at prod-icinga:~#  
  Expected behaviour would be an snmpget command line including the community string, which would return the expected result. 
  
Current behaviour is that: 
- snmpget outputs the help message on stderr (after complaining about MIBs)
- check_snmp times out after about a minute

Is anyone using check_snmp successfully ? which versions?

cheers, 
Woody  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/help/attachments/20210908/9195910e/attachment.html>


More information about the Help mailing list