Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

From Windows Server 2008+, wuauserv is no longer a service that's ran all of the time and is instead ran as a scheduled task. I'm not sure of the exact behavior of how the scheduled task is created as it seems the schedule is generated and edited by another service. Prior to this, we setup nagios to just check for the running service to ensure it was accepting updates.

My question is, how does one utilize nagios to track the proper execution/running of wuauserv service in Windows Server 2008+ to ensure it is accepting updates?

share|improve this question
up vote 4 down vote accepted

It looks like there are a number of plugins at Nagios Exchange to check for available updates--for example, this one. I've used this one in the past, I believe. That's not precisely what you're asking, though; those are whether updates exist, and you're asking whether or not the system is checking for updates.

What might be closer to what you're looking for is something like this PowerShell script:

$lastcheck = Get-ItemProperty -Path Registry::"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\Results\Detect" 

$currdate = (Get-Date)
$status = new-timespan -start $lastdate -end $currdate

If ($status.days -eq 0 -and $lastcheck.LastError -eq 0) {
    Write-Host "OK:  Wuauserv last ran $lastdate."
    $exitcode = $status.Days
elseif ($status.days -eq 1 -and $lastcheck.LastError -eq 0) {
    Write-Host "WARNING:  Wuauserv last ran $lastdate."
    $exitcode = $status.Days
} else {
    Write-Host "CRITICAL:  Wuauserv last ran $lastdate."
    $exitcode = 2
exit $exitcode

(You'd want to check that the date was within the last 24 hours (the default interval is 22 hours) and that the last error was 0.)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.