Page 1 of 1

check_hddtemp.sh plugin

Posted: Thu Jul 12, 2012 3:50 am
by nishith
"check_hddtemp.sh" plugin is not working in Nagios Core 3 web interface. But, it is working through command line. Please have a look of below configuration.


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

Nagios "commands.cfg" file

define command{
command_name check_hddtemp.sh
command_line $USER1$/check_hddtemp.sh -H $HOSTADDRESS$ -p $ARG1$ $ARG2$
}

Nagios "localhost.cfg" file


define service{
use local-service ; Name of service template to use
host_name localhost
service_description Hard Disk Temperature
check_command check_hddtemp.sh!40!50
notifications_enabled 0
}

Let me know if i miss something to mention.

Nishith N.Vyas

Re: check_hddtemp.sh plugin

Posted: Thu Jul 12, 2012 5:31 pm
by jsmurphy
The problem with shell scripts is that they have the potential to call binaries that the nagios user may not have privileges to execute, so I would test for this by using su to change to the nagios user and then trying to run the script on the command line. Let us know how that goes first :D

Re: check_hddtemp.sh plugin

Posted: Fri Jul 13, 2012 2:35 am
by nishith
It is working now. Nagios is giving below message in WEB Console.


Hard Disk Temperature
WARNING 07-13-2012 13:01:46 0d 21h 57m 27s 3/3 OK: Temperature is below warn treshold (/dev/sda is 35)

Below is my command.cfg
define command{
command_name check_hddtemp.sh
command_line sudo /usr/local/nagios/libexec/check_hddtemp.sh /dev/sda 40 50 && sudo
# command_line sudo /usr/local/nagios/libexec/check_hddtemp.sh /dev/sdb 40 50 && sudo
}

switch.cfg

define service{
use generic-service ; Inherit values from a template
host_name Dell NFS Server
service_description HDD Temperature
check_command check_nrpe!check_hddtemp
}

Hope this will sure help other people,having script related problem.

Nishith N.Vyas

Re: check_hddtemp.sh plugin

Posted: Fri Jul 13, 2012 10:08 am
by agriffin
Thanks for sharing, good to see you figured it out!