Home

Snmp load check
Script : check_snmp_load.pl Last update : Sept 5 2006

Description :

Checks by snmp v1, v2c or v3 cpu or average load.
Works on Windows, Linux/Unix, AS400, Cisco, Cisco catalyst, HP Procurve, LinkProof, Blucoat, Nokia, Fortinet, Netscreen.

Check types are selected by the -T option :

-T value | System | -w & -c values
netsl | Linux : load provided by Net SNMP | 3 values : load average on 1 min, 5 min, 15 min (absolute)
netsc | Linux : CPU usage given by net-snmp | 1 value in %
as400 | as400 CPU usage | 1 value in %
cisco | cisco CPU usage | 3 values : CPU average on 5sec, 1 min & 5 min (%)
cata | cisco catalyst CPU usage | 3 values : CPU average on 5sec, 1 min & 5 min (%)
nsc | Netscreen CPU usage | 3 values : CPU average on 5sec, 1 min & 5 min (%)
fg | Fortigate CPU usage | 1 value in %
bc | bluecoat CPU usage | 1 value in %
nokia | nokia CPU usage | 1 value in %
hp | HP procurve switch CPU usage | 1 value in %
lp | Linkproof CPU usage | 1 value in %
hpux | HP-UX load | 3 values : load average on 1 min, 5 min, 15 min

Vérifie par snmp v1,v2c ou v3 la charge ou l'ocupation CPU.

SNMP Login

See snmp info page

Requirements :

- Perl in /usr/bin/perl - or just run 'perl script'
- Net::SNMP
- file 'utils.pm' in plugin diretory

Dowload lastest version : 1.3.2

Configurations examples

Changelog : On CVS repository on sourceforge : http://nagios-snmp.cvs.sourceforge.net/nagios-snmp/plugins/.

Examples :

All examples below are considering the script is local directory. Host to be checked is 127.0.0.1 with snmp community "public".

If multiple interfaces are selected, all must be up to get an OK result

Get help | ./check_snmp_load.pl -h
Check loads on linux with Net-SNMP : checks the 1, 5 and 15 minutes load average. | ./check_snmp_load.pl -H 127.0.0.1 -C public -w 3,3,2 -c 4,4,3 -T netsl
Check cpu load (generic) : checks the %used CPU for the last minute | ./check_snmp_load.pl -H 127.0.0.1 -C public -w 98% -c 99%
Check cpu load on AS/400 | ./check_snmp_load.pl -H 127.0.0.1 -C public -w 98% -c 99% -T as400

Output of check_snmp_load.pl -h

SNMP Load & CPU Monitor for Nagios version 1.3
(c)2004-2006 Patrick Proy

Usage: ./check_snmp_load.pl [-v] -H <host> -C <snmp_community> [-2] | (-l login -x passwd [-X pass -L <authp>,<privp>]) [-p <port>] -w <warn level> -c <crit level> -T=[stand|netsl|netsc|as400|cisco|cata|nsc|fg|bc|nokia|hp|lp] [-f] [-t <timeout>] [-V]
-v, --verbose
print extra debugging information
-h, --help
print this help message
-H, --hostname=HOST
name or IP address of host to check
-C, --community=COMMUNITY NAME
community name for the host's SNMP agent (implies v1 protocol)
-2, --v2c
Use snmp v2c
-l, --login=LOGIN ; -x, --passwd=PASSWD
Login and auth password for snmpv3 authentication
If no priv password exists, implies AuthNoPriv
-X, --privpass=PASSWD
Priv password for snmpv3 (AuthPriv protocol)
-L, --protocols=<authproto>,<privproto>
<authproto> : Authentication protocol (md5|sha : default md5)
<privproto> : Priv protocole (des|aes : default des)
-P, --port=PORT
SNMP port (Default 161)
-w, --warn=INTEGER | INT,INT,INT
1 value check : warning level for cpu in percent (on one minute)
3 value check : comma separated level for load or cpu for 1min, 5min, 15min
-c, --crit=INTEGER | INT,INT,INT
critical level for cpu in percent (on one minute)
1 value check : critical level for cpu in percent (on one minute)
3 value check : comma separated level for load or cpu for 1min, 5min, 15min
-T, --type=stand|netsl|netsc|as400|cisco|bc|nokia|hp|lp
CPU check :
stand : standard MIBII (works with Windows),
can handle multiple CPU.
netsl : linux load provided by Net SNMP
netsc : cpu usage given by net-snmp (100-idle)
as400 : as400 CPU usage
cisco : Cisco CPU usage
cata : Cisco catalyst CPU usage
nsc : NetScreen CPU usage
fg : Fortigate CPU usage
bc : Bluecoat CPU usage
nokia : Nokia CPU usage
hp : HP procurve switch CPU usage
lp : Linkproof CPU usage
-f, --perfparse
Perfparse compatible output
-t, --timeout=INTEGER
timeout for SNMP in seconds (Default: 5)
-V, --version
prints version number

This project is hosted on : http://sourceforge.net/projects/nagios-snmp Nagios and the Nagios logo are registered trademarks of Ethan Galstad.