I use Zabbix as an alert/monitoring system for my servers and applications. When it comes to a django application, I work with virtual environments and pip. It is easy to have the list of outdated packages. I wanted to be alerted with zabbix when a new package is outdated.

Create your script

$ cat /etc/zabbix/plugins/pip_outdated

source path_to_virtualenv
PACKAGE_NUMBER="$(pip list --no-cache-dir  --outdated | wc -l)"

Create your zabbix custom agent

$ cat /etc/zabbix/zabbix_agentd.d/pip_outdated.conf

Increase the timeout

The pip list outdated command may take some time. It can be necessary to increase the timeout in the zabbix agent configuration (/etc/zabbix/zabbix_agentd.conf)


Test your new zabbix agent command

$ sudo zabbix_agentd -t pipOutdated
pipOutdated                                   [t|20]

Create a new item on your Zabbix server

Create a new item in “Configuration > Host > Item > Create item”


Create a new trigger on your Zabbix server

Create a new trigger in “Configuration > Host > Triggers > Create trigger”