atc0005 / todo

A collection of TODO items not specific to any one project
MIT License
0 stars 0 forks source link

Create Nagios plugin to look for common Windows Update related issues #38

Open atc0005 opened 3 years ago

atc0005 commented 3 years ago

For example, check for paused Windows Updates. The default behavior could be to trigger a state change if paused, but allow this to "pass" if the expiration is within 24 hours?

What appears to be related keys on Windows 10 Version 20H2:

atc0005 commented 3 years ago

https://docs.microsoft.com/en-us/windows/deployment/update/waas-wu-settings

atc0005 commented 3 years ago

There are 4 registry keys that will let you know if there are pending updates. HopelessN00b was on the right track, though you have to go up one level to see the keys.

HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update

The keys you want are:

UpdatesAvailableForDownloadLogon - Updates pending download(important updates)
UpdatesAvailableForInstallLogon - Downloaded updates pending install
UpdatesAvailableWithUiLogon - Pending updates that need interaction to install
UpdatesAvailableWithUiOrEulaLogon - Similar to above but you also have to accept a EULA

This should do the trick for your inventory software. Another one I tweak remotely is; NextDetectionTime This way if it is not going to check WU for a while or a security patch is out that I want to grab, I edit the date to today and the current time +1 minute.

atc0005 commented 3 years ago

See also https://github.com/atc0005/notes/issues/46

atc0005 commented 3 years ago

Review https://github.com/iamacarpet/go-win64api

atc0005 commented 3 years ago

Review https://github.com/iamacarpet/go-win64api

Not sure of viability for this specific plugin (this one is about WU "problems"), but some needed hooks may be there.