Page 1 of 1

Checking OS Version

Posted: Sun Sep 13, 2015 2:06 am
by rlinux57
When i run command on terminal it shows perfect:
./check_nrpe -H IP_Address -t 30 -c check_wmi -a "query=Select Version,Caption from win32_OperatingSystem"
Microsoft Windows Server 2012 R2 Standard, 6.3.9600


But when i run through command definition than restart the service it shows below error:
============================================================================================================================
Checking objects...
Error: Service check command 'check_nrpe -H winserver-2012 -t 30 -c check_wmi -a "query=Select Version,Caption from win32_OperatingSystem"' specified in service 'Operating System' for host 'winserver-2012' not defined anywhere!

============================================================================================================================


command define:
============================================================================================================================
define service{
use generic-service
host_name winserver-2012
service_description Operating System
check_command check_nrpe -H winserver-2012 -t 30 -c check_wmi -a "query=Select Version,Caption from win32_OperatingSystem"
}

============================================================================================================================

Re: Checking OS Version

Posted: Mon Sep 14, 2015 10:40 am
by tmcdonald
You need to separate arguments to your command like so:

check_command check_nrpe!check_wmi!-a "query=Select Version,Caption from win32_OperatingSystem"

assuming your check_nrpe command is defined as:

$USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$

Please see the following documentation on setting up commands and services:

https://assets.nagios.com/downloads/nag ... ml#command
https://assets.nagios.com/downloads/nag ... ml#service
https://assets.nagios.com/downloads/nag ... acros.html

Re: Checking OS Version

Posted: Wed Sep 16, 2015 1:02 am
by rlinux57
Actually i'm using nsclient++ 0.41 version, so below command is preferrable for that version, but still getting error.

./check_nrpe -H IP_Address -t 30 -c CheckWMI -a "Query=Select Version,Caption from win32_OperatingSystem" columnSyntax="%value%" columnSeparator=", " ignore-perf-data
Output:
CHECK_NRPE: No output returned from daemon.



But when i run previous command i.e it shows below output:

./check_nrpe -H IP_Address -t 30 -c check_wmi -a "query=Select Version,Caption from win32_OperatingSystem"
Output:
No checks specified add warn/crit boundries

Re: Checking OS Version

Posted: Wed Sep 16, 2015 1:28 am
by Box293
Can you confirm your NClient++ version:

Code: Select all

./check_nrpe -H IP_Address
Also, can you please provide your nsclient.ini file

Re: Checking OS Version

Posted: Wed Sep 16, 2015 4:55 am
by rlinux57
It's: I (0.4.2.112 2015-01-08) seem to be doing fine...

Re: Checking OS Version

Posted: Wed Sep 16, 2015 9:11 am
by hsmith
Box293 wrote:
Also, can you please provide your nsclient.ini file
Can you please complete this step so we can review the file?

Thanks!

Re: Checking OS Version

Posted: Wed Sep 16, 2015 5:54 pm
by Box293
rlinux57 wrote:It's: I (0.4.2.112 2015-01-08) seem to be doing fine...
rlinux57 wrote:But when i run previous command i.e it shows below output:

./check_nrpe -H IP_Address -t 30 -c check_wmi -a "query=Select Version,Caption from win32_OperatingSystem"
Output:
No checks specified add warn/crit boundries
I can confirm this is a bug in the version of NSClient++ you are running.

This has been fixed in the latest version 0.4.3.143:

Code: Select all

Command:
./check_nrpe -H win2008r2-01 -c check_wmi -a "query=Select Version,Caption from win32_OperatingSystem"

Output:
Microsoft Windows Server 2008 R2 Standard , 6.1.7600

Re: Checking OS Version

Posted: Sat Sep 19, 2015 5:41 am
by rlinux57
thanks it's working with new stable version.

Re: Checking OS Version

Posted: Mon Sep 21, 2015 9:16 am
by hsmith
I'm going to go ahead and close this one up then as you have it working. Thanks!