Zabbix Agent Debian Enhancements

Here are some extra UserParameters that I have found useful to add to my Debian systems for Zabbix Monitoring.

The first allows the agent to return the version of Debian that the system is currently running, so if you want to see what all your systems are running at once.  It just cats the contents of /etc/debian_version.

The second returns the number of packages that currently need to be updated.  You can use this to notify you when new updates are released.  You need to also be running apt-get update via cron or some other method.  You may also want to look at the apticron package if you want to get notified about new updates.

The third returns a comma separated list of all the packages that need updates.  In case you want to track that, or if you want the alert to show you which packages need to be updated.

#Debian Version
UserParameter=system.sw.debianversion,cat /etc/debian_version

#Debian updates available
UserParameter=system.sw.debianupdates,apt-get dist-upgrade -s  |sed -n 's/^\([0-9]\+\) upgraded.*/\1/p'

UserParameter=system.sw.debianupdates-list,apt-get dist-upgrade -s  |sed -n 's/^Inst \(.*\) (.*/\1,/p' | tr '\n' ' '

 

So just put these in a file under /etc/zabbix/zabbix_agentd.conf.d/, then run 'zabbix_agentd -p' to see the results.