Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I configure Zabbix to report for Linux servers that have out of date packages?

The following shell command reports if package updates are available:

/usr/bin/yum --debuglevel 2 --security check-update 2>/dev/null \
    | grep -P '(?<! 0 packages) available$'

If no updates is returns an empty string. If updates are available returns:

10 packages available
share|improve this question
up vote 0 down vote accepted

You should create a user parameter with content similar to the following:

UserParameter=yum.updates,/usr/bin/yum --debuglevel 2 --security check-update 2>/dev/null | grep -P '(?<! 0 packages) available$'

Place this line either into the main configuration file for Zabbix agent (zabbix_agentd.conf) or into a separate file (which might be better if you are planning on distributing this user parameter on a lot of servers) and include it or its directory using Include directive.

In the current form, you have a user parameter than returns a string, so in Zabbix frontend you would configure an item with key yum.updates and type of "Character". A trigger would then be:


However, the problem with string items is that they cannot be graphed. It would be nice to have an item that returns an integer with the number of updates available, like so (note the trailing part):

UserParameter=yum.updates,/usr/bin/yum --debuglevel 2 --security check-update 2>/dev/null | grep -P '...' || echo 0

You will also have to change the regular expression in the grep so that it returns only an integer.

The benefit of this approach is that the number of available updates can be graphed and you can also set a higher threshold for the trigger:


See also official documentation on user parameters for full details.

share|improve this answer
Update count comes from: /usr/bin/yum --debuglevel 2 --security check-update 2>/dev/null | egrep '(.i386|.x86_64|.noarch|.src)' | wc -l – Greg Pagendam-Turner Mar 20 '14 at 3:42
@Greg: Is there anything more I can help you with? – asaveljevs Mar 20 '14 at 9:13
After changing the agent config file and restarting Zabbix my Zabbix server reports that the agent is done. Nothing obvious in the /var/log/zabbix/zabbix_agentd.log log file. – Greg Pagendam-Turner Mar 21 '14 at 22:46
Had to change the timeout in zabbix_agentd.conf to 10 seconds – Greg Pagendam-Turner Mar 24 '14 at 4:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.