Checking OS Version

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Checking OS Version

Post 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"
}

============================================================================================================================
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Checking OS Version

Post 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
Former Nagios employee
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: Checking OS Version

Post 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
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Checking OS Version

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: Checking OS Version

Post by rlinux57 »

It's: I (0.4.2.112 2015-01-08) seem to be doing fine...
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Checking OS Version

Post 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!
Former Nagios Employee.
me.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Checking OS Version

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: Checking OS Version

Post by rlinux57 »

thanks it's working with new stable version.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Checking OS Version

Post by hsmith »

I'm going to go ahead and close this one up then as you have it working. Thanks!
Former Nagios Employee.
me.
Locked