Modifying Plugin check_snmp_load.pl

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
tthomas
Posts: 39
Joined: Mon Jun 01, 2015 6:54 am

Modifying Plugin check_snmp_load.pl

Post by tthomas »

Hello,

I am getting "UNKNOWN" error while trying to monitor CPU usage for a solaris server.

Code: Select all

COMMAND: /usr/local/nagios/libexec/check_snmp_load.pl -H HOSTNAME -C STRING -w 90 -c 95 -T stand -f
OUTPUT: Can't find CPU usage information : UNKNOWN
We have checked in the script "check_snmp_load.pl" and found that"stand" is for windows and we tried with "netsl" and "netsc"
stand : standard MIBII (works with Windows),
can handle multiple CPU.
netsl : linux load provided by Net SNMP (1,5 & 15 minutes values)
netsc : cpu usage given by net-snmp (100-idle)

It complained about usage of the command when used netsl

Code: Select all

root@ ~]# /usr/local/nagios/libexec/check_snmp_load.pl -H HOSTNAME -C STRING -w 99 -c 100 -T netsl -f
3 warnings and critical !

It worked with netscm, even though it is giving cpu used output.

Code: Select all

[root@ ~]# /usr/local/nagios/libexec/check_snmp_load.pl -H HOSTNAME -C STRING -w 99 -c 100 -T netsc -f
CPU used 11.0% (<99) : OK | cpu_prct_used=11%;99;100
When using "stand" for another server.

Code: Select all

[root@ ~]# /usr/local/nagios/libexec/check_snmp_load.pl -H HOSTNAME -C STRING -2 -w 99 -c 100 -T stand -f
1 CPU, load 1.0% < 99% : OK | cpu_prct_used=1%;99;100
I have few queries here.

1. How can I update the command with "netsl" so that "check_snmp_load.pl" uses this parameter when doing the service check.

2. Can I edit the command only for this particular host ?

3. What is the difference between "CPU load" and "CPU used" outputs in terms of nagios checks?

Regards
Tino
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Modifying Plugin check_snmp_load.pl

Post by ssax »

What version of the check_snmp_load.pl plugin are you running?

1. This is because the snmp daemon that you are using (probably Solaris's own) doesn't have the proper OIDs, you can install net-snmp on there and try it.

2. Yes but you would need to modify the check_snmp_load.pl script and do some logic on the passed in HOSTNAME parameter.

3. Load takes into account the total number of CPUs over time, CPU Used is just a percentage of max CPU.
Locked