Use check_snmp with multiple OID's

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
kevinkenny
Posts: 3
Joined: Thu May 19, 2011 11:35 am

Use check_snmp with multiple OID's

Post by kevinkenny »

The help for check_snmp says I can return metrics for more than one OID, for example:

Code: Select all

check_snmp -H 217.69.47.170 -P 2c -C public  -o .1.3.6.1.4.1.9600.1.1.1.1.15.2.67.58 -o .1.3.6.1.4.1.9600.1.1.1.1.18.2.67.58 -l DiskReadBytesPerSecond -l DiskWriteBytesPerSecond
This works fine and I get:

Code: Select all

SNMP OK - DiskReadBytesPerSecond 5074767 DiskWritesBytesPerSecond 4978109 | DiskReadBytesPerSecond=5074767 DiskWritesBytesPerSecond=4978109
I now need to set warning and critical levels for each of these values because we have a scenario where we want warnings and critical notifications set at different thresholds for reads and writes.

I tried a few different combinations of the -w and -c switches including:

Code: Select all

-w 10000 10000 -c 20000 20000
-w 10000 -w 10000 -c 20000 -c 20000
But I only every get a WARN or CRITICAL for the DiskReadBytesPerSecond. I have a test that purposely writes a large amount of data to the disk whilst keeping the reads very low but I can never trigger a WARN/CRITICAL for writes. It seems that only the first value is checked.

Is this possible or am I doing it wrong? :|


Is this possible?
Last edited by kevinkenny on Thu May 19, 2011 3:19 pm, edited 1 time in total.
kevinkenny
Posts: 3
Joined: Thu May 19, 2011 11:35 am

Re: Use check_snmp with multiple OID's

Post by kevinkenny »

I managed to solve this. The trick is to use quoted comma separated values

Code: Select all

-w "10000,15000" -c "20000,35000"
:D
Locked