Check updates

Overview

Checks the number of pending Windows updates using the Windows Update COM API.

Data Collection:

  • Uses the Microsoft.Update.Session COM object to query for updates where IsInstalled=0

  • Lists all pending updates with their title and last deployment change time

Fact Sheet

Fact

Value

Check Plugin Download

https://github.com/Linuxfabrik/monitoring-plugins/tree/main/check-plugins/updates

Nagios/Icinga Check Name

check_updates

Check Interval Recommendation

Every day

Can be called without parameters

Yes

Runs on

Windows

Compiled for Windows

Yes

Help

usage: updates [-h] [-V] [--always-ok] [-c CRIT] [-w WARN]

Checks the number of pending Windows updates. Alerts when the update count
exceeds the configured thresholds.

options:
  -h, --help           show this help message and exit
  -V, --version        show program's version number and exit
  --always-ok          Always returns OK.
  -c, --critical CRIT  Threshold for the number of pending updates. Default:
                       50
  -w, --warning WARN   Threshold for the number of pending updates. Default: 2

Usage Examples

updates.exe --critical 10

Output:

There are 3 pending updates:

* Windows Malicious Software Removal Tool x64 - v5.98 (KB890830) [2/8/2022 12:00:00 AM]
* 2022-02 Cumulative Update Preview for .NET Framework 3.5, 4.7.2 and 4.8 for Windows Server 2019 for x64 (KB5011267) [2/15/2022 12:00:00 AM]
* 2022-02 Cumulative Update for Windows Server 2019 (1809) for x64-based Systems (KB5010351) [2/8/2022 12:00:00 AM]

States

  • OK if no pending updates or the count is below the warning threshold.

  • WARN if the number of pending updates is >= --warning (default: 2).

  • CRIT if the number of pending updates is >= --critical (default: 50).

  • --always-ok suppresses all alerts and always returns OK.

Perfdata / Metrics

Name

Type

Description

pending_updates

Number

Number of pending updates

Credits, License