Windows update monitoring

There is an simple method to help keep your PC safer and running smoothly. I mean by using  Windows Update of course. All you have to do is turn it on, and you will get the latest security and other important updates from Microsoft automatically.

However, running it on a mission critical server is the last thing you want. You do not get a chance to evaluate updates before installing them and nor are you protected when Windows Update decides its time to reboot. You may have just rebooted in the middle of your latest back up for example. Most people set updates and backups in the same early hours of the morning to avoid disruption.

So in the majority of cases administrators often disable automatic updating all together. Making plans to check them on a regular basis and install them within a reasonable time frame. But the best-laid plans of mice and men often go awry.

Its forgotten, pushed back or simple delayed due to other issues. And before you know it there are potentially 100’s of critical updates waiting to be installed. Mainly security updates meaning your servers are susceptible.

 

So we created a Logicmodule, CriticalUpdateCheckPS, which checks your servers using Powershell for any available updates, and alerts you by email, text or voice using Logicmonitor.

In its first version it suffered a huge drawback in that the time taken to establish a Microsoft Update Session and then interrogate it for updates was so long scripts were tying up threads and using collector resources more rapidly than required.

So back to the drawing board, we wrote a script that runs locally on the servers, called it using task scheduler once per day and that script quizzes the update site for the number of critical updates and writes this number to a file stored on the server.

Then we created the CriticalUpdateCheckPS datasource with a much simpler script that simply logs onto the server being monitored for updates and reads the contents of the file written by the scheduled script. This allowed us to collect the data in seconds.

You can set your thresholds however you want  we suggest > 5 10 20, so you get an warning alert on 5 or more, an error alert on 10 or more, a critical alert on 20 or more. But this is of course your choice.

An example alert is shown here:-

  • ID: LMD12345
  • This server, APP013XYZ, has 17 outstanding critical updates to be installed. 

By alerting you to the fact and reminding you (also known as nagging!) you are more likely to deal with it.

The datasource applies to any device that has a system category of “CheckUpdates”

  1. Navigate to the Devices tab
  2. Navigate to the level that you want to set the property – the root level for your device tree, a group, or a device
  3. Click the Manage button for that group or device
  4. From the Manage dialog you can change the value for  system category by clicking on the value field and adding CheckUpdates. It there is already values in there remember to separate them with a comma.
  5. You will also need two new properties PS.USER and PS.PASS (credentials which allow you to run remote scripts in Powershell)

 

 

Additionally you will need to deploy the local script, a folder (c:/LMCriticalUpdates) which contains the local script, and set it to run once per day.

Your servers must be set for remote Powershell scripts as per Logicmonitor’s help page.

Leave a Reply

Your email address will not be published. Required fields are marked *