Zabbix on Postfix machines

On Client

apt-get install logtail pflogsumm

Create /opt/zabbix/postfix-zabbix-stats.bash (see attachment)

Create /etc/zabbix/zabbix_agent.d/postfix with the following:

UserParameter=postfix[*],/opt/zabbix/postfix-zabbix-stats.bash $1

Create a cron job, /etc/cron.d/zabbix

# Things which help the zabbix agents out
# Get postfix stats every 5 minutes
*/5 * * * * root /opt/zabbix/postfix-zabbix-stats.bash

 On Server

Add "Template App Postfix" to your server.

What this Does

 postfix-zabbix-stats.bash is a modified version of someone elses script. I'll have to find out so I can attribute it correctly.

pflogsumm is designed to give statistical information on a postfix mail log. The script parses that information and stores it in /tmp/postfix_statsfile.dat, which is a semicolon delimited file containing keys and values. One of my modifications was to add the ability to read the mail queue for postfix which the original did not do (pflogsumm does not do that).

When the Zabbix Server calls and asks for a postfix key, it passes a parameter to the same script. In this case, the script acts differently and it looks up the key in the data file and returns the value.

Attached files: postfix-zabbix-stats.bash

Last update:
2015-08-07 23:46
Average rating:0 (0 Votes)

You cannot comment on this entry

Chuck Norris has counted to infinity. Twice.