Page 1 of 1

NRPE WMI Check Setup Help

Posted: Fri Mar 02, 2018 4:34 pm
by me@work55
Nagios 4.3.4 Core and Rhel 7

Window 2016 Server Windows 2008 Windows 2012 R2 servers

run this from my windows server

C:\Program Files\NSClient++>nscp nrpe --host 127.0.0.1 --command check_wmi -a "query=Select Version,Caption from win32_OperatingSystem"
Microsoft Windows Server 2008 R2 Enterprise , 6.1.7601

Run successfully

Add this to the nsclient which is 5.1.44

Code: Select all

; External scripts - A list of scripts available to run from the CheckExternalScripts module. Syntax is: `command=script arguments`
[/settings/external scripts/scripts]

; check_os - Alias for check_os. To configure this item add a section called: /settings/external scripts/scripts/check_os
check_os = check_wmi -a "Query=Select Version,Caption from win32_OperatingSystem" columnSyntax="%value%" columnSeparator=", " ignore-perf-data
Then from my Nagios server I run this
[tgrassi@anakin libexec]$ ./check_nrpe -t 60 -H printing.fdu.edu -c check_os
Failed to execute check_os: 2: The system cannot find the file specified.

Any ideas Thank you Tom

Re: NRPE WMI Check Setup Help

Posted: Mon Mar 05, 2018 3:09 pm
by npolovenko
Hello, @mework55.
I believe that's because you put the query in the external scripts section, so NSClient thinks its a script.
On newer versions of NSCLient you should be able to run the check_os_version command without configuring anything:

Code: Select all

[root@centos7x64 libexec]# ./check_nrpe -H 192.168.3.239 -c check_os_version
OK: Windows 7 (6.1.7601)|'version'=61;50;50