Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

check_hddtemp.sh

Rating
12 votes
Favoured:
0
Hits
109211
Files:
FileDescription
check_hddtemp.shVersion 1.0 (8 sept. 2008)
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
Monitor ATA and S-ATA drive temperature.
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)
bywj@ds-science, December 10, 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`
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!
bykrasko, July 28, 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
byhronny, July 25, 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!
bynishith, July 11, 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.