/[smecontribs]/rpms/smeserver-smeadmin/contribs10/smeserver-smeadmin-1.6-bz12447-auth-qpsmtpd.patch
ViewVC logotype

Contents of /rpms/smeserver-smeadmin/contribs10/smeserver-smeadmin-1.6-bz12447-auth-qpsmtpd.patch

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


Revision 1.1 - (show annotations) (download)
Mon Dec 18 16:25:40 2023 UTC (11 months ago) by jpp
Branch: MAIN
CVS Tags: smeserver-smeadmin-1_6-13_el7_sme, smeserver-smeadmin-1_6-12_el7_sme, smeserver-smeadmin-1_6-14_el7_sme, smeserver-smeadmin-1_6-11_el7_sme, HEAD
* Mon Dec 18 2023 Jean-Philippe Pialasse <tests@pialasse.com> 1.6-11.sme
- add accounting of auth_failed [SME: 12447]
  adding php8* services

1 diff -Nur --no-dereference smeserver-smeadmin-1.6.old/root/etc/e-smith/templates/etc/e-smith/sql/init/smeadmin smeserver-smeadmin-1.6/root/etc/e-smith/templates/etc/e-smith/sql/init/smeadmin
2 --- smeserver-smeadmin-1.6.old/root/etc/e-smith/templates/etc/e-smith/sql/init/smeadmin 2023-12-17 22:31:19.074000000 -0500
3 +++ smeserver-smeadmin-1.6/root/etc/e-smith/templates/etc/e-smith/sql/init/smeadmin 2023-12-18 11:05:59.742000000 -0500
4 @@ -61,6 +61,7 @@
5 DS:check_spamhelo:GAUGE:600:0:U \
6 DS:uribl:GAUGE:600:0:U \
7 DS:dmarc:GAUGE:600:0:U \
8 + DS:auth_failed:GAUGE:600:0:U \
9 DS:total_denied:GAUGE:600:0:U \
10 DS:spam_denied:GAUGE:600:0:U \
11 DS:other_denied:GAUGE:600:0:U \
12 @@ -85,6 +86,12 @@
13 RRA:MIN:0.5:6:336 \
14 RRA:MIN:0.5:24:372 \
15 RRA:MIN:0.5:288:365
16 +
17 + else
18 + /usr/bin/rrdinfo /var/lib/smeadmin/qpsmtpd.rrd|grep auth_failed > /dev/null
19 + if [ $? -eq 1 ]; then
20 + /usr/share/doc/smeserver-smeadmin/add_ds_to_rrd.pl /var/lib/smeadmin qpsmtpd.rrd auth_failed:GAUGE:600:0:U
21 + fi
22 fi
23 if [[ ! -f /var/lib/smeadmin/qmail.rrd ]]; then
24 # nombre et raisons de connexions refusées ou acceptées et file d'attente
25 diff -Nur --no-dereference smeserver-smeadmin-1.6.old/root/etc/e-smith/web/functions/smeadmin smeserver-smeadmin-1.6/root/etc/e-smith/web/functions/smeadmin
26 --- smeserver-smeadmin-1.6.old/root/etc/e-smith/web/functions/smeadmin 2023-12-17 22:31:19.243000000 -0500
27 +++ smeserver-smeadmin-1.6/root/etc/e-smith/web/functions/smeadmin 2023-12-18 11:05:49.545000000 -0500
28 @@ -367,7 +367,7 @@
29
30
31 #liste des services et classification
32 - my @services = ("#".gettext("Web services"),"httpd-e-smith","httpd-admin","httpd-bkpc","httpd-fpbx","httpd-pki","httpd-isoqlog","squid","php-fpm", "php55-php-fpm", "php56-php-fpm", "php70-php-fpm", "php71-php-fpm", "php72-php-fpm", "php73-php-fpm", "php74-php-fpm", "php80-php-fpm", "php81-php-fpm",
33 + my @services = ("#".gettext("Web services"),"httpd-e-smith","httpd-admin","httpd-bkpc","httpd-fpbx","httpd-pki","httpd-isoqlog","squid","php-fpm", "php55-php-fpm", "php56-php-fpm", "php70-php-fpm", "php71-php-fpm", "php72-php-fpm", "php73-php-fpm", "php74-php-fpm", "php80-php-fpm", "php81-php-fpm", "php82-php-fpm", "php83-php-fpm",
34 "#".gettext("Administrative services"), "sshd", "smeadmind",
35 "#".gettext("Network services"),"wan","dhcpd","pptpd","ippp","bridge","openvpn-s2s","openvpn-routed","openvpn-bridge","wireguard","ipsec","vpnserver",
36 "#".gettext("File-sharing services"),"smb","smbd","nmbd","ftp","nfs","madsonic",
37 @@ -1963,6 +1963,7 @@
38 "DEF:clamav=$rrddir/qpsmtpd.rrd:clamav:AVERAGE","DEF:maxclamav=$rrddir/qpsmtpd.rrd:clamav:MAX","DEF:minclamav=$rrddir/qpsmtpd.rrd:clamav:MIN",
39 "DEF:karma=$rrddir/qpsmtpd.rrd:karma:AVERAGE","DEF:maxkarma=$rrddir/qpsmtpd.rrd:karma:MAX","DEF:minkarma=$rrddir/qpsmtpd.rrd:karma:MIN",
40 "DEF:tls_failed=$rrddir/qpsmtpd.rrd:tls_failed:AVERAGE","DEF:maxtls_failed=$rrddir/qpsmtpd.rrd:tls_failed:MAX","DEF:mintls_failed=$rrddir/qpsmtpd.rrd:tls_failed:MIN",
41 + "DEF:auth_failed=$rrddir/qpsmtpd.rrd:auth_failed:AVERAGE","DEF:maxauth_failed=$rrddir/qpsmtpd.rrd:auth_failed:MAX","DEF:minauth_failed=$rrddir/qpsmtpd.rrd:auth_failed:MIN",
42 "DEF:rhsbl=$rrddir/qpsmtpd.rrd:rhsbl:AVERAGE","DEF:maxrhsbl=$rrddir/qpsmtpd.rrd:rhsbl:MAX","DEF:minrhsbl=$rrddir/qpsmtpd.rrd:rhsbl:MIN",
43 "DEF:check_earlytalker=$rrddir/qpsmtpd.rrd:check_earlytalker:AVERAGE","DEF:maxcheck_earlytalker=$rrddir/qpsmtpd.rrd:check_earlytalker:MAX","DEF:mincheck_earlytalker=$rrddir/qpsmtpd.rrd:check_earlytalker:MIN",
44 "DEF:resolvable_fromhost=$rrddir/qpsmtpd.rrd:resolvable_fromhost:AVERAGE","DEF:maxresolvable_fromhost=$rrddir/qpsmtpd.rrd:resolvable_fromhost:MAX","DEF:minresolvable_fromhost=$rrddir/qpsmtpd.rrd:resolvable_fromhost:MIN",
45 @@ -1991,6 +1992,7 @@
46 "COMMENT:\\n", "AREA:check_spamhelo#007a7a:".gettext("Denied e-mails")."\\: ".gettext("check_spamhelo").":STACK","COMMENT:\\u","GPRINT:check_spamhelo:LAST:%4.0lf ","GPRINT:mincheck_spamhelo:MIN:%4.0lf ","GPRINT:check_spamhelo:AVERAGE:%4.0lf ","GPRINT:maxcheck_spamhelo:MAX:%4.0lf \\r",
47 "COMMENT:\\n", "AREA:other_denied#666666:".gettext("Denied e-mails")."\\: ".gettext("other reasons").":STACK","COMMENT:\\u","GPRINT:other_denied:LAST:%4.0lf ","GPRINT:minother_denied:MIN:%4.0lf ","GPRINT:other_denied:AVERAGE:%4.0lf ","GPRINT:maxother_denied:MAX:%4.0lf \\r",
48 "COMMENT:\\n", "AREA:tls_failed#990099:".gettext("Denied e-mails")."\\: ".gettext("tls failed").":STACK","COMMENT:\\u","GPRINT:tls_failed:LAST:%4.0lf ","GPRINT:mintls_failed:MIN:%4.0lf ","GPRINT:tls_failed:AVERAGE:%4.0lf ","GPRINT:maxtls_failed:MAX:%4.0lf \\r",
49 + "COMMENT:\\n", "AREA:auth_failed#FFA500:".gettext("Denied e-mails")."\\: ".gettext("auth failed").":STACK","COMMENT:\\u","GPRINT:auth_failed:LAST:%4.0lf ","GPRINT:minauth_failed:MIN:%4.0lf ","GPRINT:auth_failed:AVERAGE:%4.0lf ","GPRINT:maxauth_failed:MAX:%4.0lf \\r",
50 "COMMENT:\\n", "AREA:spf#00004f:".gettext("Denied e-mails")."\\: ".gettext("spf").":STACK","COMMENT:\\u","GPRINT:spf:LAST:%4.0lf ","GPRINT:minspf:MIN:%4.0lf ","GPRINT:spf:AVERAGE:%4.0lf ","GPRINT:maxspf:MAX:%4.0lf \\r",
51 "COMMENT:\\n", "AREA:resolvable_fromhost#ff99ff:".gettext("Denied e-mails")."\\: ".gettext("resolvable_fromhost").":STACK","COMMENT:\\u","GPRINT:resolvable_fromhost:LAST:%4.0lf ","GPRINT:minresolvable_fromhost:MIN:%4.0lf ","GPRINT:resolvable_fromhost:AVERAGE:%4.0lf ","GPRINT:maxresolvable_fromhost:MAX:%4.0lf \\r",
52 "COMMENT:\\n", "AREA:karma#ffff00:".gettext("Denied e-mails")."\\: ".gettext("karma").":STACK","COMMENT:\\u","GPRINT:karma:LAST:%4.0lf ","GPRINT:minkarma:MIN:%4.0lf ","GPRINT:karma:AVERAGE:%4.0lf ","GPRINT:maxkarma:MAX:%4.0lf \\r",
53 diff -Nur --no-dereference smeserver-smeadmin-1.6.old/root/usr/bin/smeadmind smeserver-smeadmin-1.6/root/usr/bin/smeadmind
54 --- smeserver-smeadmin-1.6.old/root/usr/bin/smeadmind 2023-12-17 22:31:19.142000000 -0500
55 +++ smeserver-smeadmin-1.6/root/usr/bin/smeadmind 2023-12-18 11:05:45.621000000 -0500
56 @@ -152,6 +152,7 @@
57 # This is the list of plugins we can get stats for
58 # you can set the regex used to identify a line in the logs
59 my %denied = (
60 + auth_failed => qr{auth::(auth_imap|auth_cvm_unix_local)\s+90},
61 dnsbl => qr{(dnsbl\s+90|naughty\s+90\d\s+\(dnsbl\))},
62 rhsbl => qr{rhsbl\s+90},
63 uribl => qr{uribl\s+90},
64 @@ -1417,11 +1418,9 @@
65 debug "squid cpu=$squid_cpu, mem=$squid_mem, nb=$squid_nbproc\n";
66 debug "sessions_ftp=$sessions_ftp,sessions_ssh=$sessions_ssh,";
67 debug "sessions_vpn=$sessions_vpn,sessions_netbios=$sessions_netbios\n";
68 -# debug "check_basicheaders=$mail_in_check_basicheaders,check_earlytalker=$mail_in_check_earlytalker,check_goodrcptto=$mail_in_check_goodrcptto,check_spamhelo=$mail_in_check_spamhelo,"
69 -#."clamav=$mail_in_clamav,dmarc=$mail_in_dmarc,dnsbl=$mail_in_dnsbl,fcrdns=$mail_in_fcrdns,karma=$mail_in_karma,other_denied=$mail_in_other_denied,queued=$mail_in_queued,resolvable_fromhost=$mail_in_resolvable_fromhost,"
70 -#."rhsbl=$mail_in_rhsbl,spam_denied=$mail_in_spam_denied,spam_queued=$mail_in_spam_queued,spf=$mail_in_spf,tls_failed=$mail_in_tls_failed,total=$mail_in_total,total_denied=$mail_in_total_denied,uribl=$mail_in_uribl\n";
71 + my $listqp=join(':', map {$_} keys %denied,@others);
72 foreach (keys %denied,@others){ debug "$_: $cnt{$_},";}; debug "\n";
73 - # print join(':', map {$cnt{$_}} keys %denied,@others); print "\n";
74 + #print join(':', map {$_,$cnt{$_}} keys %denied,@others); print "\n";
75 debug "qmail ";
76 foreach (@resultsqm){ debug "local_$_:$cntqmlocal{$_},";}; foreach (@resultsqm){ debug "$_:$cntqm{$_},";};
77 debug "localqueue=$localqueue,remotequeue=$remotequeue\n";
78 @@ -1454,7 +1453,14 @@
79 my $error;
80
81 foreach my $rrd (keys %rrds) {
82 - RRDs::update ("$rrddir/$rrd.rrd","N:$rrds{$rrd}");
83 + if ( $rrd eq "qpsmtpd") {
84 + # TODO: would be great to use template for all of them rather than assuming we are putting value in the right DS
85 + # was needed for qpsmtpd when adding auth_failed, which could be anywhere.
86 + RRDs::update ("$rrddir/$rrd.rrd","--template", "$listqp" ,"N:$rrds{$rrd}");
87 + }
88 + else {
89 + RRDs::update ("$rrddir/$rrd.rrd","N:$rrds{$rrd}");
90 + }
91 $error=RRDs::error;
92 print gettext("Error at RRDs::update"),"($rrd.rrd) :$error\n" if $error;
93 }
94 diff -Nur --no-dereference smeserver-smeadmin-1.6.old/root/usr/share/doc/smeserver-smeadmin/create-rrd.sh smeserver-smeadmin-1.6/root/usr/share/doc/smeserver-smeadmin/create-rrd.sh
95 --- smeserver-smeadmin-1.6.old/root/usr/share/doc/smeserver-smeadmin/create-rrd.sh 2020-10-15 07:31:28.000000000 -0400
96 +++ smeserver-smeadmin-1.6/root/usr/share/doc/smeserver-smeadmin/create-rrd.sh 2023-12-18 11:07:22.080000000 -0500
97 @@ -448,6 +448,7 @@
98 DS:check_spamhelo:GAUGE:600:0:U \
99 DS:uribl:GAUGE:600:0:U \
100 DS:dmarc:GAUGE:600:0:U \
101 + DS:auth_failed:GAUGE:600:0:U \
102 DS:total_denied::GAUGE:600:0:U \
103 DS:spam_denied::GAUGE:600:0:U \
104 DS:other_denied::GAUGE:600:0:U \

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