Environmental

check_hddtemp.sh

Description:

Monitor ATA and S-ATA drive temperature.

Current Version

Last Release Date

June 4, 2009

Compatible With


Project Files
Project Notes
A very simple script that gets the harddrive temperature from S.M.A.R.T. by using hddtemp syntax and example: ./check_hddtemp.sh ./check_hddtemp.sh /dev/sda 40 50 since hddtemp needs superuser access you will need to set up sudo: nagios ALL=(root) NOPASSWD:/usr/lib/nagios/plugins/check_hddtemp.sh I have only testet it on nagios 2 and debian etch
Reviews (5) Add a Review
Results in Farenheit
by wj@ds-science, December 31, 2018
Good Plugin. I use it to monitor different servers within the rack to validate our climate control monitoring system.

To get results in Fahrenheit, make the following edit (line 70)

HEAT=`$HDDTEMP $DEVICE -n -uF`
Helpful? Yes  No 
Make sure selinux is not Enforcing
by azymux, April 30, 2014
Just to hopefully save someone else some heartache, if you have your command defined and sudo privileges granted, make sure to use "getenforce" and verify SELinux isn't interfering with your plans!
Helpful? Yes  No 
you need to
by krasko, July 31, 2012
You need to define nagios command with sudo prefix, for example:

define command{
command_name check_hddtemp
command_line sudo $USER1$/contrib/check_hddtemp.sh /dev/$ARG1$ 40 50
}

And you will also probbly need to do not require tty for nagios user sudo. Add following line into /etc/sudoers:

Defaults:nagios !requiretty
Helpful? Yes  No 
Simple and working
by hronny, July 31, 2012
Check location of the script in sudoers file. I had the same problem because my installation is under /usr/local/nagios/

The correct line in sudoers file is:
nagios ALL=(root) NOPASSWD:/usr/local/nagios/libexec/check_hddtemp.sh

this works for me!
Helpful? Yes  No 
50% working
by nishith, July 31, 2012
This plugin is working from command line. Please have a look.


root@localhost/]#./check_hddtemp.sh /dev/sda 40 50
OK: Temperature is below warn treshold (/dev/sda is 34)

But, it is giving below error in "Nagios Web Interface".

UNKNOWN: please make sure script is running as root

I have set it up in "sudoers" file, but still no luck.
Helpful? Yes  No 
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.6 (12)
Favorites
0
Views
109,245