We’re currently using Nagios as our main monitoring system at the Department. There’s actually no need to change that (even though I tried SCOM 2012). Things that I’ve been missing in our current Nagios setup are notifications about Windows Updates. Well, honestly I haven’t even looked into that specific “problem” before now. That said, I decided to give it a try.
I started by doing some googling and found a nice solution which uses NSClient++ (http://www.nsclient.org/nscp/) and a script (http://zeldor.biz/2012/02/icinganagios-check-windows-updates/) which checks for updates. I followed the steps with some minor changes:
- Installed NSClient++ on the Windows Server(s)
- Edited nsclient.ini (NSC.ini is for older versions):
[/modules]
NRPEServer = 1[/settings/NRPE/server]
port=5667 (default port wouldn’t work for some reason)
command_timeout=90
allow_arguments=0
use_ssl=1
socket_timeout=90[/settings/external scripts/scripts]
check_win_updates=cscript.exe //T:90 //NoLogo scripts\\check_windows_updates.wsf /w:1 /c:10[/settings/default]
; ALLOWED HOSTS – A comaseparated list of allowed hosts. You can use netmasks (/ syntax) or * to create ranges.
allowed hosts = abcdef.abo.fi
- On server side:
commands.cfg:
define command {
command_name check_win_updates
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -p 5667 -c check_win_updates -t 120
}
services.cfg:
define service {
hostgroup_name check-win-updates
service_description Windows Updates
check_command check_win_updates
use generic-service
check_interval 2880
}
host-groups.cfg:
define hostgroup {
hostgroup_name check-win-updates
alias Windows Updates
members server1,server2 (Lets call the servers server1 and server2 in this example)
}
Play around with the timers ( –t) and see what suit your needs. If you want to check other stuff as well (harddisk space, cpu usage and so on) you have to configure a bit more.
Examples:
http://nagios.sourceforge.net/docs/3_0/monitoring-windows.html
http://awaseroot.wordpress.com/2012/11/23/monitoring-windows-with-nagios/
In our case it was enough with Windows Updates checking however.
Here’s a screenshot (Fig 1) from nagstamon running on my Windows 8 client:
Fig 1. nagstamon
There’s currently no information about Windows Updates as all our servers were already updated before the screenshot 🙂 The other information is from different linux servers and printers. Here’s another screenshot (fig 2) from the Nagios web interface:
Fig 2. Host information/status detail for host in Nagios
Here you can see that the Windows Update check is running and that no updates are waiting or installing.
So, there you have it – Windows Updates in Nagios.
Pingback: Monitoring Windows Updates with Nagios | Dave Umrysh