Home

Snmp env check

Script : check_snmp_env.pl

Last update : April 19 2007

Description :

Checks by snmp v1, v2c or v3 environemental parameters such as fan, power supply, temperature

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 (/usr/local/nagios/libexec)

Checks

The script will make the following checks depending on host type.
Either the threshold is directly set by the hardware manufacturer, or you must set them with an option.

This table shows what the script CAN check, depending on hardware version the sensors might not be there.
The script will return "UNKNOWN" if no sensors can be found.

If no option is specified in this table, it means the script uses the threshold of the snmp table.

Host type Option Power supply Fan Voltage Temperature Disks
Cisco cisco Yes Yes No (working on it) No (working on it) No
Nokia Ipso nokia Yes Yes No. Yes No
Bluecoat bc Yes Yes Yes Yes Yes
IronPort iron Yes Yes, option '-F' in RPM No Yes, option '-c' in Celcius No
Foundry Foundry Yes No (bug in snmp agent) No Yes No

Note : Bluecoat provides an "other" sensor which is tested also. But I never saw a Bluecoat reporting it.

 

Dowload lastest version : 1.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".

Get help

./check_snmp_env.pl -h

Verbose output ./check_snmp_env.pl -H <IP> -C <com> -v
snmpv3 login ./check_snmp_env.pl -H 127.0.0.1 -l login -x passwd

Check Cisco for all sensors

./check_snmp_env.pl -H 127.0.0.1 -C public -T cisco

Check Nokia for all sensors ./check_snmp_env.pl -H 127.0.0.1 -C public -T nokia
checks ironport fans RPM > 1500 and temp < 70 deg celcius ./check_snmp_env.pl -H 127.0.0.1 -C public -T iron -F 1500 -c 70

Output of check_snmp_env.pl -h


SNMP environmental Monitor for Nagios version 1.2
GPL Licence, (c)2006-2007 Patrick Proy

Usage: ./check_snmp_env.pl [-v] -H <host> -C <snmp_community> [-2] | (-l login -x passwd [-X pass -L <authp>,<privp>]) [-p <port>] -T (cisco|nokia|bc|iron|foundry) [-F <rpm>] [-c <celcius>] [-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)
-T, --type=cisco|nokia|bc|iron|foundry
Environemental check :
cisco : voltage,temp,fan,power supply status
will try to check everything present
nokia : fan and power supply
bc : fans, power supply, voltage, disks
iron : fans, power supply, temp
foundry : power supply, temp
-F, --fan=<rpm>
Minimum fan rpm value
-c, --celcius=<celcius>
Maximum temp in degree celcius
-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 :
SourceForge.net Logo

Nagios and the Nagios logo are registered trademarks of Ethan Galstad.