Page 1 of 1
check_snmp_temperature.pl
Posted: Tue Oct 02, 2012 8:24 am
by gshergill
Hi again Nagios Community,
Been attempting to get snmp working again to find the temperature of a server, etc.
After trying with check_snmp but getting nowhere, I decided to try out check_snmp_temperature.pl.
So, I've added it as a command and as a service as follows;
Code: Select all
define service{
use local-service
host_name tiger
service_description SuperMicro Temp
check_command check_snmp_temperature.pl!public!.1.3.6.1.4.1.10876.2.1.1.1.1.2.20
}
# 'check_snmp_temperature.pl' command definition
define command{
command_name check_snmp_temperature.pl
command_line $USER1$/check_snmp_temperature.pl -H $HOSTADDRESS$ -v2c -C public -N $ARG1$
}
The following is the error;
Code: Select all
Specify system type (-T) OR base SNMP OIDs for names (-N) and data (-D) tables OR exact list of sensor names (-n) and data OIDs (-d) !
Usage: /usr/local/icinga/libexec/check_snmp_temperature.pl [-v] -H <host> -C <snmp_community> [-2]
Performance Data: (-l login -x passwd [-X pass -L <authp>,<privp>]) [-p <port>] [-t <timeout>] -T dell|hp|cisco1|juniper|alteon | [-N <oid_attribnames> -D <oid_attribdata>] | [-n <list of sensor names> -d <list of sensor oids>] [-a <attributes to check> -w <warn levels> -c <crit levels> [-f]] [-A <attributes for perfdata>] [-o <out_temp_unit: C|F|K>] [-i <in_temp_unit>] [-u <unknown_default>] [-V]
Any tips please? I'm sure what to add for the -D option really, -N is all I could find online...
Thank you.
Kind Regards,
gshergill
EDIT:
root@nagios:/usr/local/nagios/etc/objects# snmpwalk -v2c -c public server.domain .1.3.6.1.4.1.10876.2.1.1.1.1.2.20
SNMPv2-SMI::enterprises.10876.2.1.1.1.1.2.20 = No more variables left in this MIB View (It is past the end of the MIB tree)
Re: check_snmp_temperature.pl
Posted: Tue Oct 02, 2012 5:08 pm
by scottwilkerson
Is this on a Nagios XI machine? Also can you link to which plugin you downloaded...
Thanks
Re: check_snmp_temperature.pl
Posted: Wed Oct 03, 2012 4:30 am
by gshergill
Hi scottwilkerson,
My apologies, I posted the wrong VM's error. I currently use 4 VM's for this, 3 of which I use to test command/service definitions for the production machine (don't want to break what is already, to an extent, working).
This is the webpage error;
Code: Select all
Specify system type (-T) OR base SNMP OIDs for names (-N) and data (-D) tables OR exact list of sensor names (-n) and data OIDs (-d) !
The service definition in grumbler.domain.cfg;
Code: Select all
define service{
use local-service
host_name grumbler.domain
service_description SuperMicro Temp
check_command check_snmp_temperature.pl!.1.3.6.1.4.1.10876.2.1.1.1.1.2.20
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
}
And the command definition in commands.cfg;
Code: Select all
define command {
command_name check_snmp_temperature.pl
command_line $USER1$/check_snmp_temperature.pl -H $HOSTADDRESS$ -v2c -C public -N $ARG1$
}
The check_snmp_temperature.pl being used is at the following link;
http://exchange.nagios.org/directory/Pl ... re/details
I chose Version 0.35 rather than the BETA version.
Thank you.
Kind Regards,
gshergill
Re: check_snmp_temperature.pl
Posted: Wed Oct 03, 2012 9:53 am
by scottwilkerson
I'm not totally familiar with this 3rd party plugin but it looks like you need to also give it the -D with the -N as well as a -a
./check_snmp_temperature.pl -h
SNMP Temperature Monitor for Nagios version 0.34
by William Leibzon - william(at)leibzon.org
Usage: ./check_snmp_temperature.pl [-v] -H <host> -C <snmp_community> [-2] | (-l login -x passwd [-X pass -L <authp>,<privp>]) [-p <port>] [-t <timeout>] -T dell|hp|cisco1|juniper|alteon | [-N <oid_attribnames> -D <oid_attribdata>] | [-n <list of sensor names> -d <list of sensor oids>] [-a <attributes to check> -w <warn levels> -c <crit levels> [-f]] [-A <attributes for perfdata>] [-o <out_temp_unit: C|F|K>] [-i <in_temp_unit>] [-u <unknown_default>] [-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 v 1 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=INT[,INT[,INT[..]]]
warning temperature level(s) (if more then one attribute is checked, must have multiple values)
-c, --crit=INT[,INT[,INT[..]]]
critical temperature level(s) (if more then one attribute is checked, must have multiple values)
-f, --perfdata
Perfparse compatible output
-t, --timeout=INTEGER
timeout for SNMP in seconds (Default: 5)
-V, --version
prints version number
-N, --oidtable_attribnames=OID_STRING
Base table OID to walk through to find names of those attributes supported and from that corresponding data OIDs
-D, --oidtable_attribdata=OID_STRING
Base table OID for sensor attribute data, one number is added to that to make up full attribute OID
-n, --sensor_names=STRING[,STRING[..]]
List of sensor names when -N is not used and sensors are specified with exeact oids
-d, --sensor_oids=OID_STRING[,OID_STRING[..]]
List of exact data OIDs for sensors specified with -n (specify this when -N and -D are not used)
-a, --attributes=STRING[,STRING[..]]
Which attribute(s) to check. This is used as regex to check if attribute is found in sensor names.
As an example for Dell the attribute names to use are: PROC_1, PROC_2, Ambient, Planar, Riser
-A, --perf_attributes=STRING[,STRING[..]]
Which attribute(s) to add to as part of performance data output. These names can be different then the
ones listed in '-a' to only output attributes in perf data but not check. Special value of '*' gets them all.
-f, --perfparse
Used only with '-a'. Causes to output data not only in main status line but also as perfparse output
-o --out_temp_unit=C|F|K
What temperature measurement units are used for output and warning/critical - 'C', 'F' or 'K' - default is 'C'
-i --in_temp_unit=[num]C|F|K
What temperature measurement reported by data OID - format is <num>C|F|K (default is 'C')
where num is used if data is num*realdata, i.e. if reported data of 330 means 33C, then it is: -i 10C
-u, --unknown_default=INT
If attribute is not found then report the output as this number (i.e. -u 0)
-T, --type=dell|hp|cisco1|juniper|alteon
This allows to use pre-defined system type to set Base, Data OIDs and incoming temperature measurement type
Currently support systems types are: dell, hp, cisco1 (7500, 5500, 2948, etc), juniper, alteon
Re: check_snmp_temperature.pl
Posted: Wed Oct 03, 2012 10:48 am
by gshergill
Hi scottwilkerson,
The problem I'm having is that after a long time I found a -N that works on snmpwalk, but I honestly haven't a clue what the -D needs to be for this command, let alone the -a.
Any chance you know what I should/could put there please?
It's a SuperMicro motherboard.
Thank you.
Kind Regards,
gshergill
Re: check_snmp_temperature.pl
Posted: Wed Oct 03, 2012 4:58 pm
by scottwilkerson
Honestly, I'm not familiar with this 3rd party plugin, you may want to post the question to the exchange page or email the author
by William Leibzon - william(at)leibzon.org
Re: check_snmp_temperature.pl
Posted: Thu Oct 04, 2012 5:16 am
by gshergill
Hi scottwilkerson,
Thanks, will email him soon (hopefully the munin gets working and I won't need to though xD).
Kind Regards,
gshergill
Re: check_snmp_temperature.pl
Posted: Thu Oct 04, 2012 7:32 am
by scottwilkerson
See my addition to your munin post