/[smecontribs]/rpms/smeserver-zabbix-agent/contribs9/smeserver-zabbix-agent-0.1-mail_stats_via_cron.patch
ViewVC logotype

Contents of /rpms/smeserver-zabbix-agent/contribs9/smeserver-zabbix-agent-0.1-mail_stats_via_cron.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Tue Feb 9 23:18:26 2016 UTC (8 years, 9 months ago) by stephdl
Branch: MAIN
CVS Tags: smeserver-zabbix-agent-0_1-53_el6_sme, smeserver-zabbix-agent--, HEAD
* Wed Feb 10 stephane de Labrusse <stephdl@de-labrusse.fr> - 0.1-53.sme
- New rpm for sme9

1 diff -Nur -x '*.orig' -x '*.rej' smeserver-zabbix-agent-0.1/createlinks mezzanine_patched_smeserver-zabbix-agent-0.1/createlinks
2 --- smeserver-zabbix-agent-0.1/createlinks 2009-04-24 15:05:29.000000000 +0200
3 +++ mezzanine_patched_smeserver-zabbix-agent-0.1/createlinks 2009-04-24 14:56:56.000000000 +0200
4 @@ -7,6 +7,7 @@
5 templates2events("/etc/zabbix/zabbix_agentd.conf", qw(zabbix-agent-update bootstrap-console-save));
6 templates2events("/etc/sudoers", "zabbix-agent-update");
7 templates2events("/etc/rc.d/init.d/masq", "zabbix-agent-update");
8 +templates2events("/etc/crontab", "zabbix-agent-update");
9
10 # Services to restart
11 safe_symlink("restart", "root/etc/e-smith/events/zabbix-agent-update/services2adjust/zabbix-agent");
12 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
13 --- smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/crontab/zabbix_mail_stats 1970-01-01 01:00:00.000000000 +0100
14 +++ 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
15 @@ -0,0 +1,11 @@
16 +{
17 +if ((${'zabbix-agent'}{'status'} || 'disabled') eq 'enabled'){
18 +$OUT .=<<"HERE";
19 +
20 +# Parse mail logs and write stats in zabbix tmp directory
21 +*/10 * * * * root /var/lib/zabbix/bin/mail_in.sh
22 +*/10 * * * * root /var/lib/zabbix/bin/mail_out.sh
23 +
24 +HERE
25 +}
26 +}
27 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
28 --- smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/sudoers/00zabbixAgentAlias 2009-04-24 15:05:29.000000000 +0200
29 +++ mezzanine_patched_smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/sudoers/00zabbixAgentAlias 2009-04-24 15:05:04.000000000 +0200
30 @@ -7,6 +7,4 @@
31 $OUT .= 'Cmnd_Alias ZABBIX_AGENT_ROOT = '.$runasroot
32 }
33 Cmnd_Alias ZABBIX_AGENT_MYSQL = /usr/bin/du -s /var/lib/mysql
34 -Cmnd_Alias ZABBIX_AGENT_SMELOG = /var/lib/zabbix/bin/logtail.pl /var/log/qpsmtpd/current /var/lib/zabbix/tmp/*
35 -Cmnd_Alias ZABBIX_AGENT_QMAIL = /var/lib/zabbix/bin/logtail.pl /var/log/qmail/current /var/lib/zabbix/tmp/*
36
37 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
38 --- smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/sudoers/30zabbixAgent 2009-04-24 15:05:29.000000000 +0200
39 +++ mezzanine_patched_smeserver-zabbix-agent-0.1/root/etc/e-smith/templates/etc/sudoers/30zabbixAgent 2009-04-24 15:05:20.000000000 +0200
40 @@ -1,5 +1,3 @@
41 zabbix ALL=(root) NOPASSWD: ZABBIX_AGENT_ROOT
42 zabbix ALL=(mysql) NOPASSWD: ZABBIX_AGENT_MYSQL
43 -zabbix ALL=(smelog) NOPASSWD: ZABBIX_AGENT_SMELOG
44 -zabbix ALL=(qmaill) NOPASSWD: ZABBIX_AGENT_QMAIL
45
46 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
47 --- 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
48 +++ 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
49 @@ -2,7 +2,7 @@
50
51 # Description: Incoming Mail <key>
52 # Type: Agent or Agent (active)
53 -# Key: mail.in.<key> (for example mail.in.denied.dnsbl)
54 +# Key: mail.in[<key>] (for example mail.in[dnsbl])
55 # Type of information: Numeric (integer 64bit)
56 # Units: mails/h
57 # Use multiplier: Custom multiplier
58 @@ -11,21 +11,5 @@
59 # Store Value: As is
60 # Show Value: As is
61
62 -# Choosing 6 as custom muliplier and 600 as interval allow you to get stats in mails/h
63 -# In fact, each key retrieve the number of emails since the last run. If you retrieve each value every 600 sec
64 -# (10 Min), you'll have stats in mails/10min. If you multiply this by 6 (6x10min), you'll get it in mails/h
65 -
66 -UserParameter=mail.in.denied.dnsbl,/var/lib/zabbix/bin/mail_in.sh dnsbl
67 -UserParameter=mail.in.denied.rhsbl,/var/lib/zabbix/bin/mail_in.sh rhsbl
68 -UserParameter=mail.in.denied.clamav,/var/lib/zabbix/bin/mail_in.sh clamav
69 -UserParameter=mail.in.denied.earlytalker,/var/lib/zabbix/bin/mail_in.sh check_earlytalker
70 -UserParameter=mail.in.denied.basicheaders,/var/lib/zabbix/bin/mail_in.sh check_basicheaders
71 -UserParameter=mail.in.denied.goodrcptto,/var/lib/zabbix/bin/mail_in.sh check_goodrcptto
72 -UserParameter=mail.in.denied.spamhelo,/var/lib/zabbix/bin/mail_in.sh check_spamhelo
73 -UserParameter=mail.in.denied.total,/var/lib/zabbix/bin/mail_in.sh total_denied
74 -UserParameter=mail.in.denied.spam,/var/lib/zabbix/bin/mail_in.sh spam_denied
75 -UserParameter=mail.in.denied.other,/var/lib/zabbix/bin/mail_in.sh other_denied
76 -UserParameter=mail.in.queued.spam,/var/lib/zabbix/bin/mail_in.sh spam_queued
77 -UserParameter=mail.in.queued,/var/lib/zabbix/bin/mail_in.sh queued
78 -UserParameter=mail.in.total,/var/lib/zabbix/bin/mail_in.sh total
79 +UserParameter=mail.in[*],cat /var/lib/zabbix/tmp/mail.in.$1
80
81 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
82 --- 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
83 +++ 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
84 @@ -2,7 +2,7 @@
85
86 # Description: Incoming Mail <key>
87 # Type: Agent or Agent (active)
88 -# Key: mail.out.<key> (for example mail.out.total)
89 +# Key: mail.out.[<key>] (for example mail.out[total])
90 # Type of information: Numeric (integer 64bit)
91 # Units: mails/h
92 # Use multiplier: Custom multiplier
93 @@ -11,13 +11,6 @@
94 # Store Value: As is
95 # Show Value: As is
96
97 -# Choosing 6 as custom muliplier and 600 as interval allow you to get stats in mails/h
98 -# In fact, each key retrieve the number of emails since the last run. If you retrieve each value every 600 sec
99 -# (10 Min), you'll have stats in mails/10min. If you multiply this by 6 (6x10min), you'll get it in mails/h
100 -
101 -UserParameter=mail.out.total,/var/lib/zabbix/bin/mail_out.sh total
102 -UserParameter=mail.out.success,/var/lib/zabbix/bin/mail_out.sh success
103 -UserParameter=mail.out.deferral,/var/lib/zabbix/bin/mail_out.sh deferral
104 -UserParameter=mail.out.failure,/var/lib/zabbix/bin/mail_out.sh failure
105 +UserParameter=mail.out[*],cat /var/lib/zabbix/tmp/mail.out.$1
106
107
108 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
109 --- smeserver-zabbix-agent-0.1/root/var/lib/zabbix/bin/mail_in.sh 2009-04-24 15:05:29.000000000 +0200
110 +++ mezzanine_patched_smeserver-zabbix-agent-0.1/root/var/lib/zabbix/bin/mail_in.sh 2009-04-24 14:46:22.000000000 +0200
111 @@ -1,11 +1,15 @@
112 #!/bin/bash
113 -WHAT=$1
114 BINDIR='/var/lib/zabbix/bin'
115 LOGTAIL=$BINDIR'/logtail.pl'
116 PARSER=$BINDIR'/parse_mail_in.pl'
117 LOGFILE='/var/log/qpsmtpd/current'
118 -TMPDIR='/var/lib/zabbix/tmp/smelog'
119 +TMPDIR='/var/lib/zabbix/tmp/'
120
121 -/usr/bin/sudo -u smelog $LOGTAIL $LOGFILE $TMPDIR/mailin.$WHAT.offset | $PARSER $WHAT
122 +
123 +for WHAT in dnsbl rhsbl clamav check_earlytalker check_basicheaders \
124 + check_goodrcptto check_spamhelo total_denied spam_denied \
125 + other_denied spam_queued queued total; do
126 + $LOGTAIL $LOGFILE $TMPDIR/mail.in.$WHAT.offset | $PARSER $WHAT > $TMPDIR/mail.in.$WHAT
127 +done
128
129
130 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
131 --- smeserver-zabbix-agent-0.1/root/var/lib/zabbix/bin/mail_out.sh 2009-04-24 15:05:29.000000000 +0200
132 +++ mezzanine_patched_smeserver-zabbix-agent-0.1/root/var/lib/zabbix/bin/mail_out.sh 2009-04-24 14:46:03.000000000 +0200
133 @@ -1,10 +1,11 @@
134 #!/bin/bash
135 -WHAT=$1
136 BINDIR='/var/lib/zabbix/bin'
137 LOGTAIL=$BINDIR'/logtail.pl'
138 PARSER=$BINDIR'/parse_mail_out.pl'
139 LOGFILE='/var/log/qmail/current'
140 -TMPDIR='/var/lib/zabbix/tmp/qmail'
141 +TMPDIR='/var/lib/zabbix/tmp/'
142
143 -/usr/bin/sudo -u qmaill $LOGTAIL $LOGFILE $TMPDIR/mailout.$WHAT.offset | $PARSER $WHAT
144 +for WHAT in failure deferral success total; do
145 + $LOGTAIL $LOGFILE $TMPDIR/mail.out.$WHAT.offset | $PARSER $WHAT > $TMPDIR/mail.out.$WHAT
146 +done
147

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed