Page 2 of 3

Re: Windows OS Version

Posted: Mon Jun 09, 2014 3:50 pm
by slansing
Can you show an example of what you are trying to define, and what it is throwing out? Maybe we can weasel it in.

We're actively developing a process for checking eventlogs with NCPA which should provide a much cleaner and easier to understand method than this one.

Re: Windows OS Version

Posted: Tue Jun 10, 2014 2:52 am
by peakyblinder
slansing wrote:Can you show an example of what you are trying to define, and what it is throwing out? Maybe we can weasel it in.

We're actively developing a process for checking eventlogs with NCPA which should provide a much cleaner and easier to understand method than this one.
I'm not seven sure how to go about defining it to be honest.

Re: Windows OS Version

Posted: Tue Jun 10, 2014 6:47 am
by eloyd
Aren't you just trying to figure out what OS version is being run on the remote side? You said you had a VB script that does what you want. You can use NSClient++ to execute it if you want. Info is at http://nsclient.org/nscp/wiki/guides/na ... al_scripts. But I don't see why you can't just update to the latest version and get the check_os_version method?

Re: Windows OS Version

Posted: Tue Jun 10, 2014 6:52 am
by peakyblinder
eloyd wrote:Aren't you just trying to figure out what OS version is being run on the remote side? You said you had a VB script that does what you want. You can use NSClient++ to execute it if you want. Info is at http://nsclient.org/nscp/wiki/guides/na ... al_scripts. But I don't see why you can't just update to the latest version and get the check_os_version method?
Yes, that's correct. I will look into the external scripts option.

I'd like to upgrade but currently don't have a mechanism for updating hundreds of clients. Something I negated to consider when starting this (my bad).

Re: Windows OS Version

Posted: Tue Jun 10, 2014 6:56 am
by eloyd
I'd like to upgrade but currently don't have a mechanism for updating hundreds of clients. Something I negated to consider when starting this (my bad).
Ahhhh. It wasn't clear that you already had NSClient++ in place. I thought you were going to install it, and couldn't figure out why you didn't just install the latest version. :-)

Okay, good luck.

Re: Windows OS Version

Posted: Tue Jun 10, 2014 4:47 pm
by slansing
Yep, external scripts is the place to go, that is how you would be remotely executing plugins/scripts via NSClient++, let us know if you have issues!

Re: Windows OS Version

Posted: Thu Jun 12, 2014 8:58 am
by peakyblinder
slansing wrote:Yep, external scripts is the place to go, that is how you would be remotely executing plugins/scripts via NSClient++, let us know if you have issues!
OK, had a go at configuring this although I think I'm missing something.

VB script sits in teh scripts folder under NSClient.

Add a command to the external scripts section of nscliet.ini
- check_os_version=script.exe //T:30 //NoLogo scripts\OS_Version.vbs

Running the command line:
- ./check_nrpe -H ipaddress -p 5666 -c check_os_version

I get the following:
ExternalCommands: failed to create process (script.exe //T:30 //NoLogo scripts\OS_Version.vbs): 2: The system cannot find the file specified.

Any ideas?

---------------------------------------------
I should also mention that my vb scripts is pretty simple. Here it is...
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
Wscript.Echo objOperatingSystem.Caption & _
" " & objOperatingSystem.Version
Next



Thanks,

Re: Windows OS Version

Posted: Thu Jun 12, 2014 4:08 pm
by lmiltchev
Can you post the "NSC.ini" (or "nsclient.ini") file for a review? I just tried your script, and I got a different output... :)

Code: Select all

[root@testbox libexec]# ./check_nrpe -H 192.168.x.x -c check_os_version
CRITICAL: Windows 7 (6.1.7601)|'version'=61;50;50
It has to be a problem with the config.

Re: Windows OS Version

Posted: Thu Jun 12, 2014 4:41 pm
by Box293
peakyblinder wrote:- check_os_version=script.exe //T:30 //NoLogo scripts\OS_Version.vbs
This should be cscript.exe

Code: Select all

check_os_version=cscript.exe //T:30 //NoLogo scripts\OS_Version.vbs
Make the change, restart NSClient and test.

Re: Windows OS Version

Posted: Fri Jun 13, 2014 2:36 am
by peakyblinder
Box293 wrote:
peakyblinder wrote:- check_os_version=script.exe //T:30 //NoLogo scripts\OS_Version.vbs
This should be cscript.exe

Code: Select all

check_os_version=cscript.exe //T:30 //NoLogo scripts\OS_Version.vbs
Make the change, restart NSClient and test.
Curse of the typo!!! My bad... this works a treat if you call cscript properly. Thank you very much!