| | 45 | |
| | 46 | === Check available updates === |
| | 47 | This script enables you to check how many Windows updates there are available for the server. |
| | 48 | It does this by communicating with the Windows Update Agent API. It will check all applicable updates. I haven't been able to figure out how to check for critical updates only. |
| | 49 | |
| | 50 | As with the previous example, this script accepts none OR two arguments. Specifying only one or more then two arguments will return an error.[[BR]] |
| | 51 | If no arguments are given, only the applicable updates are returned as an 'OK' state. Specifying a warning and critical number will return a warning or a critical state if the amount of updates exceeds the threshold. |
| | 52 | |
| | 53 | ==== Sample command ==== |
| | 54 | {{{ |
| | 55 | check_updates_available=scripts\check_updates_available $ARG1$ $ARG2$ |
| | 56 | }}} |
| | 57 | |
| | 58 | {{{ |
| | 59 | check_nrpe_updates_available,40 50 |
| | 60 | OK: applicable updates: 1|'updates'=1;40;50; |
| | 61 | }}} |
| | 62 | |
| | 63 | ==== Nagios configuration ==== |
| | 64 | {{{ |
| | 65 | define command { |
| | 66 | command_name <<CheckUpdatesAvailable>> |
| | 67 | command_line check_nrpe -H $HOSTADDRESS$ -p 5666 -c check_updates_available -a 40 50 |
| | 68 | } |
| | 69 | <<CheckUsersLoggedIn>> |
| | 70 | }}} |