This page shows how it is possible to connect Hard Disk Sentinel Professional and Nagios: how Hard Disk Sentinel Professional can provide hard disk status information - and how Nagios can accept and manage the collected status information.
Download: check_hddsentinel.zip (check_hddsentinel.vbs (c) Guilherme Orcutt)
Nagios installed and running.
Hard Disk Sentinel Professional installed, registered and activated
In Hard Disk Sentinel, open Configuration -> Advanced options. Select "Generate and update XML file" and select a Path
Install NSClient++
Source: http://www.nsclient.org/
check_nrpe has to be checked, others are recommended (for other checks).
Password is not necessary for nrpe checks.
After the installation: Copy the script to the NSClient++ scripts folder (Usual path: c:\Program Files\NSClient++\scripts)
Configure NSClient++
Open the nsclient.ini (Usual path: c:\Program Files\NSClient++) and add at end of the .ini file:
[/settings/NRPE/server]
allow arguments = 1
[/settings/external scripts]
allow arguments = 1
[/settings/external scripts/scripts]
check_hddsentinel = cscript.exe //T:30 //NoLogo "pathToScript" /file:$ARG1$ /drive:$ARG2$ /warningtemp:$ARG3$ /criticaltemp:$ARG4$ /warninghealth:$ARG5$ /criticalhealth:$ARG6$
Restart the NSClient++ service after the changes.
Notes:
/file: XML file Path
/drive: HDD Number in HDSentinel
You can also replace $ARGx$ by a value. For example I have decided to replace $ARG1$ by the XML file Path, so I do not have to add it as an argument for each Nagios-service. In this case do not forget to replace "$ARG2$" by "$ARG1$" (and so forth).
Configure Nagios
Add the following command to Nagios command.cfg:
define command{
command_name check_hddsentinel
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 20 -c check_hddsentinel -a $ARG1$ $ARG2$ $ARG3$ $ARG4$ $ARG5$ $ARG6$
}
Important: The number of arguments in the command.cfg is the same as in the nsclient.ini
Note: -t == timeout (in s)
Note2: Command in Nagios with 5 Arguments (without XML file path)
Add services to your host config file:
define service{
use yourServiceTemplate
host_name HDSentinelHost
service_description descriptionOfService
check_command check_hddsentinel!xmlPath! drive!warnTemp!critTemp!warnHealth!critHealth
}
Note by Editor: Nagios doesn't like spaces within the parameters! Make sure to use the short version of path/filename in case it contain spaces, like: c:/PROGRA~1/HARDDI~1/HDSENT~1.XML Alternatively, you may specify a folder in the beginning (step 1) where there is no space, for example: C:\HardDiskSentinel , C:\HDS or similar.
Example with XML file path:
check_hddsentinel!c:/PROGRA~1/HARDDI~1/HDSENT~1.XML!1!45!48!80!60
Example without XML file path:
Note: Do not forget to define the host!
All done! Restart Nagios.
Nagios Service Overview
Service Information
Thanks for Guilherme Orcutt for the script and Jakob Hirschl for the tutorial and information !