4

I am using Nagios to monitor Windows hosts. I am using Nagios 3.5 running on a Centos 7 server. The following packages have been installed from the official repositories and from the EPEL repository:

nagios
nagios-plugins-all
nagios-plugins-nrpe

So far I am using the 'check_nt' method to run some basic checks on the windows hosts. This is working fine.

Now I want to use the check_hwinfo plugin to gather information about the hosts in a single place. This plugin requires NRPE in order to run.

In the 'commands.cfg' file I have added:

define command{
    command_name    check_hwinfo
    command_line    $USER1$/check_nrpe_hwinfo $HOSTNAME$ $HOSTADDRESS$
}

In the 'nrpe.cfg' I have added:

command[check_hwinfo]=/usr/bin/sudo /usr/lib64/nagios/plugins/check_hwinfo.pl
command[check_hwinfo_csv]=/usr/bin/sudo /usr/lib64/nagios/plugins/check_hwinfo.pl -t csv

command[check_hwinfo]=c:\windows\system32\cscript.exe //NoLogo //T:10 "C:check_hwinfo\check_hwinfo.wsf"
command[check_hwinfo_csv]=c:\windows\system32\cscript.exe //NoLogo //T:10 "C:\check_hwinfo\check_hwinfo.wsf" /sep:csv

I have copied the 'check_hwinfo.pl' script in the '/usr/lib64/nagios/plugins' folder and made it executable, with identical permissions with the other scripts in the folder.

I have added these lines to '/etc/sudoers' in order to execute without password:

Defaults:nagios      !requiretty
nagios ALL=NOPASSWD: /usr/lib/nagios/plugins/check_hwinfo.pl "", /usr/lib/nagios/plugins/check_hwinfo.pl -t csv

On the client side, I am running NSClient++ on the Windows hosts I am monitoring. For check_hwinfo I made the folder 'C:\check_hwinfo' and put inside the 'check_hwinfo.wsf' file needed for running the test on Windows.

This is my nsclient.ini and this is my nsclient-full.ini files.

While all the other checks (via check_nt) are working fine, check_hwinfo refuses to work no matter what I try. The service status in the Nagios page is 'WARNING' and the error message is 'No handler for command: check_hwinfo_csv'.

Does anybody have experience with check_hwinfo? Can you please point me in the right direction?

UPDATE 1:

When trying to run check_nrpe manualy I get this:

./check_nrpe -H 192.168.10.13 -c CheckDisk
No handler for command: checkdisk

It is the same as the error message I get at the GUI from the check_hwinfo plugin

No handler for command: check_hwinfo_csv 

UPDATE 2:

In the Windows client, in the nsclient-full.ini file I have the following definitions:

check_hwinfo=C:\check_hwinfo\check_hwinfo.wsf
check_hwinfo_csv=C:\check_hwinfo\check_hwinfo.wsf -t csv
dlyk1988
  • 1,644
  • 4
  • 24
  • 36

1 Answers1

0

That error indicates that you don't have the external script handler enabled. Fortunately, nsclient++ has excellent documentation on this subject.

(Looks like they're currently in the process of re-doing the wiki/docs, so you might want to check the old one too if something's missing.)

Keith
  • 4,627
  • 14
  • 25