check_hddtemp.sh plugin

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
nishith
Posts: 28
Joined: Thu Jul 12, 2012 3:45 am

check_hddtemp.sh plugin

Post 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
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: check_hddtemp.sh plugin

Post 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
nishith
Posts: 28
Joined: Thu Jul 12, 2012 3:45 am

Re: check_hddtemp.sh plugin

Post 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
agriffin
Posts: 876
Joined: Mon May 09, 2011 9:36 am

Re: check_hddtemp.sh plugin

Post by agriffin »

Thanks for sharing, good to see you figured it out!
Locked