SpookOz / zabbix-winupdates

A template for Zabbix that monitors and (optionally) applies Windows updates - for active agents
23 stars 15 forks source link

zabbix-winupdates

This is a Zabbix template to monitor and (optionally) run Windows updates for active Windows agents. It has been tested on Zabbix 4.4.8 to v5.2 with Windows 8.1, 10 and server 2019. Currently needs testing with other Windows versions and other Zabbix versions.

Features

Requirements

Files Included

Zabbix Agents >v5

Zabbix Agents >v5

Installing

  1. Ensure your Windows hosts have the agent installed and configured correctly and they are communicating with the Zabbix server.
  2. Make sure you have edited the zabbix_agentd.conf file to include the line: EnableRemoteCommands=1 (<v5) or AllowKey=system.run[*] (>v5)
  3. Download Winupdates.xml or WinupdatesV5.xml template from Github and import the template in Zabbix and apply it to one or more Windows Hosts.

Option 1 - Deply Powershell Script Manually

Choose this option if you want to make any changes to the PowerShell script. You may want to change the report path, or you may need to change the agent install path if you don't have a default install (C:\Program Files\Zabbix Agent).

You also need to choose this option if you want to disable the auto-update feature.

  1. Create a sub-folder called "plugins" in your Zabbix Agent install folder (eg: C:\Program Files\Zabbix Agent\plugins).
  2. Download check_win_updates2020.ps1 (<v5) or check_win_updates-v5.ps1 (>v5) from Github and make any changes you need to it. Check the .ps file for instructions on making changes.
  3. Copy check_win_updates2020.ps1 (<v5) or check_win_updates-v5.ps1 (>v5) to the plugins directory.

Option 2 - Automatic Deployment of the Powershell script

This is a good option if you have a number of hosts you want to monitor but don't have an easy way to deploy the PS script to them all.

  1. Edit the template in Zabbix (Configuration / Templates / WinUpdates).
  2. Go to the "Items" tab.
  3. You will see an item called "Deploy PS Script". Click on it to edit it.
  4. Click the button to enable (if not ticked already) the item and click "Update".
  5. Once all hosts have received the script, disable this item again, or it will re-download the script every day.

The item has a 1d update interval, so it may take up to a day for the PowerShell script to download. You can shorten this if you like.

Dashboard

You can add a widget to your Dashboard by choosing type: Data overview and application "Winupdates-Panel".