Windows OS Version
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Windows OS Version
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.
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.
-
peakyblinder
- Posts: 63
- Joined: Tue Mar 25, 2014 4:39 am
Re: Windows OS Version
I'm not seven sure how to go about defining it to be honest.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.
Re: Windows OS Version
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?
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
-
peakyblinder
- Posts: 63
- Joined: Tue Mar 25, 2014 4:39 am
Re: Windows OS Version
Yes, that's correct. I will look into the external scripts option.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?
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
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.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).
Okay, good luck.
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Windows OS Version
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!
-
peakyblinder
- Posts: 63
- Joined: Tue Mar 25, 2014 4:39 am
Re: Windows OS Version
OK, had a go at configuring this although I think I'm missing something.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!
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
Can you post the "NSC.ini" (or "nsclient.ini") file for a review? I just tried your script, and I got a different output... 
It has to be a problem with the config.
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;50Be sure to check out our Knowledgebase for helpful articles and solutions!
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Windows OS Version
This should be cscript.exepeakyblinder wrote:- check_os_version=script.exe //T:30 //NoLogo scripts\OS_Version.vbs
Code: Select all
check_os_version=cscript.exe //T:30 //NoLogo scripts\OS_Version.vbsAs of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
peakyblinder
- Posts: 63
- Joined: Tue Mar 25, 2014 4:39 am
Re: Windows OS Version
Curse of the typo!!! My bad... this works a treat if you call cscript properly. Thank you very much!Box293 wrote:This should be cscript.exepeakyblinder wrote:- check_os_version=script.exe //T:30 //NoLogo scripts\OS_Version.vbs
Make the change, restart NSClient and test.Code: Select all
check_os_version=cscript.exe //T:30 //NoLogo scripts\OS_Version.vbs