Page 1 of 1

windows server version monitoring using ncpa

Posted: Mon Nov 22, 2021 9:47 am
by mejokj
Hi Team,

Want to monitor windows server version for eg: "windows server 2016" using ncpa agent on nagios.

Thanks

Re: windows server version monitoring using ncpa

Posted: Mon Nov 22, 2021 3:20 pm
by gsmith
Hi

You could use SNMP to get:

Code: Select all

SNMPv2-MIB::sysDescr.0 = STRING: Hardware: Intel64 Family 6 Model 63 Stepping 2 AT/AT COMPATIBLE - Software: Windows Version 6.3 (Build 9600 Multiprocessor Free)
If you wanted to use a script you could create something like:

Code: Select all

@echo off
set ERRORLEVEL=2
for /f  "tokens=1,2,3,4,5,6,7,8 delims= " %%i in ('C:\Windows\System32\systeminfo.exe') do ( 
  if %%i==OS (
     if %%j==Name: (
        echo %%k %%l %%m %%n %%o %%p
        set ERRORLEVEL=0
     )
  )  
)
And put it in C:\Program Files (x86)\Nagios\ncpa\plugins on the machine to be monitored. Then call it from the XI server with check_ncpa.py

The issue I see with that is if you are going to the trouble of installing a script on the remote Windows server
it would be just as easy to check the OS rather than deploying the script ;)

Thanks