check_snmp and --delimeter


#1

Hello. I’m using nagios 2.10, nagios-plugins 1.4.11, Centreon 1.4.2.3, net-snmp 5.3.2.

I’m trying to setup a check_snmp command with --delimiter parameter.

Look:

monitoring# ./check_snmp -H 10.27.1.152 -P 2c -C public -o hrProcessorLoad.2 -u % -l “” -w 80 -c 90
OK - 56 % | HOST-RESOURCES-MIB::hrProcessorLoad.2=56

How can I get just “OK - 56 %”, when delimiter is “|” symbol and this symbol is using in argument string for command?
The remote host is under Windows 2003 with SNMP service.

Please help, any advices will be good. Thanks.


#2

Write a plugin shell script that would just do snmpget to your host for particular OID. In snmpget command use options (I would try first with the -Oqv options and see if it works). If it doesn’t output the way you want, try something else. Type snmpget in the terminal and you will get all options.
After you test this in the terminal and get the right output, go to directory with plugin’s configuration files and in there you define a command which would point to your script (here you define arguments for warning/critical etc.). Use the name of the command you’ve defined in service check_command.
Don’t forget about the execution right for your script. It must be executable for Nagios.