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 --- smeserver-smeadmin-1.6.old/root/etc/e-smith/templates/etc/e-smith/sql/init/smeadmin 2023-12-17 22:31:19.074000000 -0500 +++ smeserver-smeadmin-1.6/root/etc/e-smith/templates/etc/e-smith/sql/init/smeadmin 2023-12-18 11:05:59.742000000 -0500 @@ -61,6 +61,7 @@ DS:check_spamhelo:GAUGE:600:0:U \ DS:uribl:GAUGE:600:0:U \ DS:dmarc:GAUGE:600:0:U \ + DS:auth_failed:GAUGE:600:0:U \ DS:total_denied:GAUGE:600:0:U \ DS:spam_denied:GAUGE:600:0:U \ DS:other_denied:GAUGE:600:0:U \ @@ -85,6 +86,12 @@ RRA:MIN:0.5:6:336 \ RRA:MIN:0.5:24:372 \ RRA:MIN:0.5:288:365 + + else + /usr/bin/rrdinfo /var/lib/smeadmin/qpsmtpd.rrd|grep auth_failed > /dev/null + if [ $? -eq 1 ]; then + /usr/share/doc/smeserver-smeadmin/add_ds_to_rrd.pl /var/lib/smeadmin qpsmtpd.rrd auth_failed:GAUGE:600:0:U + fi fi if [[ ! -f /var/lib/smeadmin/qmail.rrd ]]; then # nombre et raisons de connexions refusées ou acceptées et file d'attente 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 --- smeserver-smeadmin-1.6.old/root/etc/e-smith/web/functions/smeadmin 2023-12-17 22:31:19.243000000 -0500 +++ smeserver-smeadmin-1.6/root/etc/e-smith/web/functions/smeadmin 2023-12-18 11:05:49.545000000 -0500 @@ -367,7 +367,7 @@ #liste des services et classification - 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", + 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", "#".gettext("Administrative services"), "sshd", "smeadmind", "#".gettext("Network services"),"wan","dhcpd","pptpd","ippp","bridge","openvpn-s2s","openvpn-routed","openvpn-bridge","wireguard","ipsec","vpnserver", "#".gettext("File-sharing services"),"smb","smbd","nmbd","ftp","nfs","madsonic", @@ -1963,6 +1963,7 @@ "DEF:clamav=$rrddir/qpsmtpd.rrd:clamav:AVERAGE","DEF:maxclamav=$rrddir/qpsmtpd.rrd:clamav:MAX","DEF:minclamav=$rrddir/qpsmtpd.rrd:clamav:MIN", "DEF:karma=$rrddir/qpsmtpd.rrd:karma:AVERAGE","DEF:maxkarma=$rrddir/qpsmtpd.rrd:karma:MAX","DEF:minkarma=$rrddir/qpsmtpd.rrd:karma:MIN", "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", + "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", "DEF:rhsbl=$rrddir/qpsmtpd.rrd:rhsbl:AVERAGE","DEF:maxrhsbl=$rrddir/qpsmtpd.rrd:rhsbl:MAX","DEF:minrhsbl=$rrddir/qpsmtpd.rrd:rhsbl:MIN", "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", "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", @@ -1991,6 +1992,7 @@ "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", "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", "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", + "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", "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", "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", "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", diff -Nur --no-dereference smeserver-smeadmin-1.6.old/root/usr/bin/smeadmind smeserver-smeadmin-1.6/root/usr/bin/smeadmind --- smeserver-smeadmin-1.6.old/root/usr/bin/smeadmind 2023-12-17 22:31:19.142000000 -0500 +++ smeserver-smeadmin-1.6/root/usr/bin/smeadmind 2023-12-18 11:05:45.621000000 -0500 @@ -152,6 +152,7 @@ # This is the list of plugins we can get stats for # you can set the regex used to identify a line in the logs my %denied = ( + auth_failed => qr{auth::(auth_imap|auth_cvm_unix_local)\s+90}, dnsbl => qr{(dnsbl\s+90|naughty\s+90\d\s+\(dnsbl\))}, rhsbl => qr{rhsbl\s+90}, uribl => qr{uribl\s+90}, @@ -1417,11 +1418,9 @@ debug "squid cpu=$squid_cpu, mem=$squid_mem, nb=$squid_nbproc\n"; debug "sessions_ftp=$sessions_ftp,sessions_ssh=$sessions_ssh,"; debug "sessions_vpn=$sessions_vpn,sessions_netbios=$sessions_netbios\n"; -# 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," -#."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," -#."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"; + my $listqp=join(':', map {$_} keys %denied,@others); foreach (keys %denied,@others){ debug "$_: $cnt{$_},";}; debug "\n"; - # print join(':', map {$cnt{$_}} keys %denied,@others); print "\n"; + #print join(':', map {$_,$cnt{$_}} keys %denied,@others); print "\n"; debug "qmail "; foreach (@resultsqm){ debug "local_$_:$cntqmlocal{$_},";}; foreach (@resultsqm){ debug "$_:$cntqm{$_},";}; debug "localqueue=$localqueue,remotequeue=$remotequeue\n"; @@ -1454,7 +1453,14 @@ my $error; foreach my $rrd (keys %rrds) { - RRDs::update ("$rrddir/$rrd.rrd","N:$rrds{$rrd}"); + if ( $rrd eq "qpsmtpd") { + # TODO: would be great to use template for all of them rather than assuming we are putting value in the right DS + # was needed for qpsmtpd when adding auth_failed, which could be anywhere. + RRDs::update ("$rrddir/$rrd.rrd","--template", "$listqp" ,"N:$rrds{$rrd}"); + } + else { + RRDs::update ("$rrddir/$rrd.rrd","N:$rrds{$rrd}"); + } $error=RRDs::error; print gettext("Error at RRDs::update"),"($rrd.rrd) :$error\n" if $error; } 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 --- smeserver-smeadmin-1.6.old/root/usr/share/doc/smeserver-smeadmin/create-rrd.sh 2020-10-15 07:31:28.000000000 -0400 +++ smeserver-smeadmin-1.6/root/usr/share/doc/smeserver-smeadmin/create-rrd.sh 2023-12-18 11:07:22.080000000 -0500 @@ -448,6 +448,7 @@ DS:check_spamhelo:GAUGE:600:0:U \ DS:uribl:GAUGE:600:0:U \ DS:dmarc:GAUGE:600:0:U \ + DS:auth_failed:GAUGE:600:0:U \ DS:total_denied::GAUGE:600:0:U \ DS:spam_denied::GAUGE:600:0:U \ DS:other_denied::GAUGE:600:0:U \