Thanks Chaly !! i took the liberty of changing it a bit as we use unattended-upgrade to our Linux hosts and wanted to monitor this only if it fails. Also when you simulate the update request there is no need to install anything if you do a count (-c) on the available updates. The triggers in the template will alert if the unattended-upgrade process is longer present that the days configured, thats how you know the process is not working anymore. See below the details (change trigger accordingly):
1. Activate the unattended-upgrade process and configure it with your needs (e.g. update security only and reboot at 02:00AM if needed)
2. Install zabbix agent
3. Create configuration file with the below UserParameters: sudo nano /etc/zabbix/zabbix_agent2.d/90-ubuntu-updates.conf
UserParameter=ubuntu_updates.package,apt-get upgrade -s | grep -c ^Inst
UserParameter=ubuntu_updates.security,apt-get upgrade -s | grep ^Inst | grep -c security
4. Restart the zabbix agent: sudo systemctl restart zabbix-agent2
Import template and assign to your server.
1. Activate the unattended-upgrade process and configure it with your needs (e.g. update security only and reboot at 02:00AM if needed)
2. Install zabbix agent
3. Create configuration file with the below UserParameters: sudo nano /etc/zabbix/zabbix_agent2.d/90-ubuntu-updates.conf
UserParameter=ubuntu_updates.package,apt-get upgrade -s | grep -c ^Inst
UserParameter=ubuntu_updates.security,apt-get upgrade -s | grep ^Inst | grep -c security
4. Restart the zabbix agent: sudo systemctl restart zabbix-agent2
Import template and assign to your server.
Comment