Linux

check_temp.pl

Description:

A perl script that checks the CPU (or M/B) temperature with lm-sensors. Default is to check the CPU temperature but this can be changed to check any temperature returned by sensors with an argument. The plugin complies with the guidelines, for example uses -w -c -v arguments etc. It also does some basic sanity checks and has an exit 3 catchall. ############################################### # To get the Temps from each core one per line: # Be sure to edit /etc/nagios/objects/commands.cfg and change notify-service-by-email to this: # command_line /usr/bin/printf “%b” “***** Nagios *****nnNotification Type: $NOTIFICATIONTYPE$nnService: $SERVICEDESC$nHost: $HOSTALIAS$nAddress: $HOSTADDRESS$nState: $SERVICESTATE$nnDate/Time: $LONGDATETIME$nnAdditional Info:nn$SERVICEOUTPUT$n$LONGSERVICEOUTPUT$n” | /bin/mail -s “** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **” $CONTACTEMAIL$ # notice the addition of $LONGSERVICEOUTPUT$n to the end of the message. ###############################################

Current Version

1.3

Last Release Date

2011-05-18

Compatible With

  • Nagios 2.x
  • Nagios 3.x

License

GPL


Project Files
Project Notes
This plugin can be used with NRPE or on a local machine. It has been tested with sensor output in several forms: #{1,3} #{1,3}.# #{1,3}.## It will also match $sensor[newline]$temp where $sensor is the value of the -s argument. ## NRPE example ## /etc/nagios/nrpe.cfg command[check_temp]=/usr/lib/nagios/plugins/check_temp.pl -c 85 -w 75 -s 'CPU ., Core .' /etc/sensors.conf chip "coretemp-isa-0000" label temp1 "CPU 0, Core 0" chip "coretemp-isa-0001" label temp1 "CPU 0, Core 1" chip "coretemp-isa-0002" label temp1 "CPU 0, Core 2" chip "coretemp-isa-0003" label temp1 "CPU 0, Core 3" chip "coretemp-isa-0004" label temp1 "CPU 1, Core 0" chip "coretemp-isa-0005" label temp1 "CPU 1, Core 1" chip "coretemp-isa-0006" label temp1 "CPU 1, Core 2" chip "coretemp-isa-0007" label temp1 "CPU 1, Core 3" ## Local config example ## /etc/nagios/objects/commands.cfg define command { command_name check_temp command_line $USER1$/check_temp.pl -w $ARG1$ -c $ARG2$ -s $ARG3$ } /etc/nagios/objects/localhost.cfg define service{ use local-service host_name localhost service_description CPU Temp check_command check_temp!75!85!"CPU ., Core ." }
Reviews (1) Add a Review
nice plugin
by snord, May 31, 2012

Works great using coretemp module on IBM xSeries servers. It would be perfect if it would support performance data output for graphing temperature trends. Maybe in a future update. Thanks.



Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
4.3 (3)
Favorites
0
Views
107,780