Page 1 of 1

monitoring windows updates with check_windows_updates.wsf

Posted: Tue Mar 20, 2012 10:10 am
by mfdoom
Hello,

i´m somewhat stuck in trying to get the
check_windows_updates.wsf
from the website
to work. Maybe someone can shed some insight on me. I d/l the wsf-file and put it on in the /scripts folder on the windowsmachine.

how do i call the script from the nsc.ini (i´m using version 0.38)?

is this correct?:
check_windows_updates=scripts\check_windows_updates.wsf w:1 c:2
and how do i create the checkcommand on the nagios server?

thx for the input

Re: monitoring windows updates with check_windows_updates.ws

Posted: Tue Mar 20, 2012 10:18 am
by mfdoom
I´ve found a solution posted on another board where a reference is made to "c:\nrpe\bin". i don´t have an NRPE folder but only the NSClient++ dir under program files. With which program can i test the script local?
U:\>c:\windows\system32\cscript.exe -NoLogo -T:120 C:\NRPE\bin\check_windows_updates.wsf /w:0 /c:1

Re: monitoring windows updates with check_windows_updates.ws

Posted: Tue Mar 20, 2012 10:27 am
by mfdoom
I tested it and it seemed that this works:
Input:
c:\windows\system32\cscript.exe -NoLogo -T:120 "C:\Program Files\NSClient++\scripts\check_windows_updates.wsf" /w:0 /c:1
Output:
reboot required
How do i have to enter the command in the nsc.ini? And how do i set up the check command on the nagios server to call the external command?

thx in forward

Re: monitoring windows updates with check_windows_updates.ws

Posted: Tue Mar 20, 2012 6:08 pm
by jsmurphy
You were so close, the command should look something like this:
command[check_windows_updates]=cscript.exe //T:30 //NoLogo scripts\check_windows_updates.wsf /w:0 /c:1

The command[] part is optional, I normally leave it in to keep it in line with the Linux NRPE, cscript acts as a wrapper for executing the script the //T:30 is a 30 second time out for the script and NoLogo suppresses some unnecessary cscript output. The scripts\scriptname is the path to the script, you could alternatively use "C:\Program Files\NSClient++\scripts\check_windows_updates.wsf" explicitly if you didn't want to use a relative path.

Re: monitoring windows updates with check_windows_updates.ws

Posted: Wed Mar 21, 2012 4:38 am
by mfdoom
Hello jsmurphy,

thank you. Now i got the command tested and running local. Can you tell me with which plugin on the nagios-server can i test the functionality? Is it check_nrpe? since i read that nrpe is integrated in nsclient++

Thanks for the advice.

Re: monitoring windows updates with check_windows_updates.ws

Posted: Wed Mar 21, 2012 4:41 am
by mfdoom
i tried this on the server but failed:
/usr/lib/nagios/plugins/check_nrpe -H myserver -c check_windows_updates
the output is:

UNKNOWN: No handler for that command