diff -Nur -x '*.orig' -x '*.rej' smeserver-zabbix-agent-0.1/createlinks mezzanine_patched_smeserver-zabbix-agent-0.1/createlinks --- smeserver-zabbix-agent-0.1/createlinks 2009-04-24 15:05:29.000000000 +0200 +++ mezzanine_patched_smeserver-zabbix-agent-0.1/createlinks 2009-04-24 14:56:56.000000000 +0200 @@ -7,6 +7,7 @@ templates2events("/etc/zabbix/zabbix_agentd.conf", qw(zabbix-agent-update bootstrap-console-save)); templates2events("/etc/sudoers", "zabbix-agent-update"); templates2events("/etc/rc.d/init.d/masq", "zabbix-agent-update"); +templates2events("/etc/crontab", "zabbix-agent-update"); # Services to restart safe_symlink("restart", "root/etc/e-smith/events/zabbix-agent-update/services2adjust/zabbix-agent"); diff -Nur -x '*.orig' -x '*.rej' smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/crontab/zabbix_mail_stats mezzanine_patched_smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/crontab/zabbix_mail_stats --- smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/crontab/zabbix_mail_stats 1970-01-01 01:00:00.000000000 +0100 +++ mezzanine_patched_smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/crontab/zabbix_mail_stats 2009-04-24 14:55:58.000000000 +0200 @@ -0,0 +1,11 @@ +{ +if ((${'zabbix-agent'}{'status'} || 'disabled') eq 'enabled'){ +$OUT .=<<"HERE"; + +# Parse mail logs and write stats in zabbix tmp directory +*/10 * * * * root /var/lib/zabbix/bin/mail_in.sh +*/10 * * * * root /var/lib/zabbix/bin/mail_out.sh + +HERE +} +} diff -Nur -x '*.orig' -x '*.rej' smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/sudoers/00zabbixAgentAlias mezzanine_patched_smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/sudoers/00zabbixAgentAlias --- smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/sudoers/00zabbixAgentAlias 2009-04-24 15:05:29.000000000 +0200 +++ mezzanine_patched_smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/sudoers/00zabbixAgentAlias 2009-04-24 15:05:04.000000000 +0200 @@ -7,6 +7,4 @@ $OUT .= 'Cmnd_Alias ZABBIX_AGENT_ROOT = '.$runasroot } Cmnd_Alias ZABBIX_AGENT_MYSQL = /usr/bin/du -s /var/lib/mysql -Cmnd_Alias ZABBIX_AGENT_SMELOG = /var/lib/zabbix/bin/logtail.pl /var/log/qpsmtpd/current /var/lib/zabbix/tmp/* -Cmnd_Alias ZABBIX_AGENT_QMAIL = /var/lib/zabbix/bin/logtail.pl /var/log/qmail/current /var/lib/zabbix/tmp/* diff -Nur -x '*.orig' -x '*.rej' smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/sudoers/30zabbixAgent mezzanine_patched_smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/sudoers/30zabbixAgent --- smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/sudoers/30zabbixAgent 2009-04-24 15:05:29.000000000 +0200 +++ mezzanine_patched_smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/sudoers/30zabbixAgent 2009-04-24 15:05:20.000000000 +0200 @@ -1,5 +1,3 @@ zabbix ALL=(root) NOPASSWD: ZABBIX_AGENT_ROOT zabbix ALL=(mysql) NOPASSWD: ZABBIX_AGENT_MYSQL -zabbix ALL=(smelog) NOPASSWD: ZABBIX_AGENT_SMELOG -zabbix ALL=(qmaill) NOPASSWD: ZABBIX_AGENT_QMAIL diff -Nur -x '*.orig' -x '*.rej' smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/90UserParameters_mailIn mezzanine_patched_smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/90UserParameters_mailIn --- smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/90UserParameters_mailIn 2009-04-24 15:05:29.000000000 +0200 +++ mezzanine_patched_smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/90UserParameters_mailIn 2009-04-24 12:19:12.000000000 +0200 @@ -2,7 +2,7 @@ # Description: Incoming Mail # Type: Agent or Agent (active) -# Key: mail.in. (for example mail.in.denied.dnsbl) +# Key: mail.in[] (for example mail.in[dnsbl]) # Type of information: Numeric (integer 64bit) # Units: mails/h # Use multiplier: Custom multiplier @@ -11,21 +11,5 @@ # Store Value: As is # Show Value: As is -# Choosing 6 as custom muliplier and 600 as interval allow you to get stats in mails/h -# In fact, each key retrieve the number of emails since the last run. If you retrieve each value every 600 sec -# (10 Min), you'll have stats in mails/10min. If you multiply this by 6 (6x10min), you'll get it in mails/h - -UserParameter=mail.in.denied.dnsbl,/var/lib/zabbix/bin/mail_in.sh dnsbl -UserParameter=mail.in.denied.rhsbl,/var/lib/zabbix/bin/mail_in.sh rhsbl -UserParameter=mail.in.denied.clamav,/var/lib/zabbix/bin/mail_in.sh clamav -UserParameter=mail.in.denied.earlytalker,/var/lib/zabbix/bin/mail_in.sh check_earlytalker -UserParameter=mail.in.denied.basicheaders,/var/lib/zabbix/bin/mail_in.sh check_basicheaders -UserParameter=mail.in.denied.goodrcptto,/var/lib/zabbix/bin/mail_in.sh check_goodrcptto -UserParameter=mail.in.denied.spamhelo,/var/lib/zabbix/bin/mail_in.sh check_spamhelo -UserParameter=mail.in.denied.total,/var/lib/zabbix/bin/mail_in.sh total_denied -UserParameter=mail.in.denied.spam,/var/lib/zabbix/bin/mail_in.sh spam_denied -UserParameter=mail.in.denied.other,/var/lib/zabbix/bin/mail_in.sh other_denied -UserParameter=mail.in.queued.spam,/var/lib/zabbix/bin/mail_in.sh spam_queued -UserParameter=mail.in.queued,/var/lib/zabbix/bin/mail_in.sh queued -UserParameter=mail.in.total,/var/lib/zabbix/bin/mail_in.sh total +UserParameter=mail.in[*],cat /var/lib/zabbix/tmp/mail.in.$1 diff -Nur -x '*.orig' -x '*.rej' smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/90UserParameters_mailOut mezzanine_patched_smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/90UserParameters_mailOut --- smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/90UserParameters_mailOut 2009-04-24 15:05:29.000000000 +0200 +++ mezzanine_patched_smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/90UserParameters_mailOut 2009-04-24 12:18:09.000000000 +0200 @@ -2,7 +2,7 @@ # Description: Incoming Mail # Type: Agent or Agent (active) -# Key: mail.out. (for example mail.out.total) +# Key: mail.out.[] (for example mail.out[total]) # Type of information: Numeric (integer 64bit) # Units: mails/h # Use multiplier: Custom multiplier @@ -11,13 +11,6 @@ # Store Value: As is # Show Value: As is -# Choosing 6 as custom muliplier and 600 as interval allow you to get stats in mails/h -# In fact, each key retrieve the number of emails since the last run. If you retrieve each value every 600 sec -# (10 Min), you'll have stats in mails/10min. If you multiply this by 6 (6x10min), you'll get it in mails/h - -UserParameter=mail.out.total,/var/lib/zabbix/bin/mail_out.sh total -UserParameter=mail.out.success,/var/lib/zabbix/bin/mail_out.sh success -UserParameter=mail.out.deferral,/var/lib/zabbix/bin/mail_out.sh deferral -UserParameter=mail.out.failure,/var/lib/zabbix/bin/mail_out.sh failure +UserParameter=mail.out[*],cat /var/lib/zabbix/tmp/mail.out.$1 diff -Nur -x '*.orig' -x '*.rej' smeserver-zabbix-agent-0.1/root/var/lib/zabbix/bin/mail_in.sh mezzanine_patched_smeserver-zabbix-agent-0.1/root/var/lib/zabbix/bin/mail_in.sh --- smeserver-zabbix-agent-0.1/root/var/lib/zabbix/bin/mail_in.sh 2009-04-24 15:05:29.000000000 +0200 +++ mezzanine_patched_smeserver-zabbix-agent-0.1/root/var/lib/zabbix/bin/mail_in.sh 2009-04-24 14:46:22.000000000 +0200 @@ -1,11 +1,15 @@ #!/bin/bash -WHAT=$1 BINDIR='/var/lib/zabbix/bin' LOGTAIL=$BINDIR'/logtail.pl' PARSER=$BINDIR'/parse_mail_in.pl' LOGFILE='/var/log/qpsmtpd/current' -TMPDIR='/var/lib/zabbix/tmp/smelog' +TMPDIR='/var/lib/zabbix/tmp/' -/usr/bin/sudo -u smelog $LOGTAIL $LOGFILE $TMPDIR/mailin.$WHAT.offset | $PARSER $WHAT + +for WHAT in dnsbl rhsbl clamav check_earlytalker check_basicheaders \ + check_goodrcptto check_spamhelo total_denied spam_denied \ + other_denied spam_queued queued total; do + $LOGTAIL $LOGFILE $TMPDIR/mail.in.$WHAT.offset | $PARSER $WHAT > $TMPDIR/mail.in.$WHAT +done diff -Nur -x '*.orig' -x '*.rej' smeserver-zabbix-agent-0.1/root/var/lib/zabbix/bin/mail_out.sh mezzanine_patched_smeserver-zabbix-agent-0.1/root/var/lib/zabbix/bin/mail_out.sh --- smeserver-zabbix-agent-0.1/root/var/lib/zabbix/bin/mail_out.sh 2009-04-24 15:05:29.000000000 +0200 +++ mezzanine_patched_smeserver-zabbix-agent-0.1/root/var/lib/zabbix/bin/mail_out.sh 2009-04-24 14:46:03.000000000 +0200 @@ -1,10 +1,11 @@ #!/bin/bash -WHAT=$1 BINDIR='/var/lib/zabbix/bin' LOGTAIL=$BINDIR'/logtail.pl' PARSER=$BINDIR'/parse_mail_out.pl' LOGFILE='/var/log/qmail/current' -TMPDIR='/var/lib/zabbix/tmp/qmail' +TMPDIR='/var/lib/zabbix/tmp/' -/usr/bin/sudo -u qmaill $LOGTAIL $LOGFILE $TMPDIR/mailout.$WHAT.offset | $PARSER $WHAT +for WHAT in failure deferral success total; do + $LOGTAIL $LOGFILE $TMPDIR/mail.out.$WHAT.offset | $PARSER $WHAT > $TMPDIR/mail.out.$WHAT +done