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
  • Can NRPE sudo without password? – Christopher Perrin Oct 14 '14 at 11:07
  • @ChristopherPerrin I have actually taken care of that in the /etc/sudoers file. See the update. – dsljanus Oct 14 '14 at 11:16
  • Show us the output of a manual test, running check_nrpe manually. – Keith Oct 14 '14 at 14:43
  • Wait... you know you have to define the check_hwinfo commands on the Windows side, right? If you're asking about a Windows box, nothing starting with "/usr/lib64" is relevant at all. Also, there is no Nagios 6.5 – Keith Oct 14 '14 at 14:43
  • @Keith Fixed the typo. It is now 'Nagios 3.5'. Also, there is no mention of '/usr/lib64...' on my windows hosts. Tomorrow I will run the manual check and report back here. – dsljanus Oct 14 '14 at 14:48
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.)

  • I have enabled external scripts the way it is described in the article. – dsljanus Oct 20 '14 at 6:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.