Changes

Jump to navigation Jump to search
1,976 bytes added ,  15:05, 12 April 2014
use split() instead of substr() (old script always reported max=9). Add example showing how to scan "x" days of log files.
Line 35: Line 35:  
2008-11-08 06:37:31.730609500 26398 logging::logterse plugin: ` 87.103.146.91 pmsn.91.146.103.87.sable.dsl.krasnet.ru pmsn.91.146.103.87.sable.dsl.krasnet.ru <dwweem@wee.com> dnsbl 903 http://www.spamhaus.org/query/bl?ip=87.103.146.91 msg denied before queued
 
2008-11-08 06:37:31.730609500 26398 logging::logterse plugin: ` 87.103.146.91 pmsn.91.146.103.87.sable.dsl.krasnet.ru pmsn.91.146.103.87.sable.dsl.krasnet.ru <dwweem@wee.com> dnsbl 903 http://www.spamhaus.org/query/bl?ip=87.103.146.91 msg denied before queued
 
2008-11-08 06:37:41.211401500 26409 logging::logterse plugin: ` 87.103.146.91 pmsn.91.146.103.87.sable.dsl.krasnet.ru pmsn.91.146.103.87.sable.dsl.krasnet.ru <dwtrupsm@trups.com> dnsbl 903 http://www.spamhaus.org/query/bl?ip=87.103.146.91 msg denied before queued</nowiki>
 
2008-11-08 06:37:41.211401500 26409 logging::logterse plugin: ` 87.103.146.91 pmsn.91.146.103.87.sable.dsl.krasnet.ru pmsn.91.146.103.87.sable.dsl.krasnet.ru <dwtrupsm@trups.com> dnsbl 903 http://www.spamhaus.org/query/bl?ip=87.103.146.91 msg denied before queued</nowiki>
 +
 +
==== Monitor simultaneous in-bound SMTP connections ====
 +
The command below will show the maximum number of simultaneous in-bound SMTP connections to your server since the last time the qpsmtpd log was rotated.  Replace "/current" with "/*" to get the maximum connection count in all existing qpsmtpd log files.
 +
 +
(The single quotes on the first and last line make this a single command):
 +
<nowiki>awk -v INSTANCES="/"$(config getprop smtpd Instances) 'BEGIN {max=0}
 +
$0 ~ INSTANCES {split($5, count, "/"); count[1]>max?max=count[1]:max}
 +
END {print max}' /var/log/qpsmtpd/current</nowiki>
 +
 +
Show the maximum connections in any log file closed in the last 3 days, and include the configured "qpsmtpd Instances" for your system:
 +
<nowiki>awk -v INSTANCES="/"$(config getprop smtpd Instances) 'BEGIN {max=0}
 +
$0 ~ INSTANCES {split($5, count, "/"); count[1]>max?max=count[1]:max}
 +
END {print max INSTANCES}' $(find /var/log/qpsmtpd/ -name "@*" -ctime -3)</nowiki>
 +
 +
===Allow for individual configuration of qpsmtpd and sqpsmtpd log file retention ===
 +
Some users find that they want to be able to research email problems further back in time than the window covered by the default qpsmtpd logfile retention settings (10 logfiles retained, 5,000,000 bytes each). See [[Bugzilla: 6293]] and [[Bugzilla: 2862]]
 +
 +
Beginning with smeserver-qpsmtpd-2.2.0-12.el5.sme (SME 8) you can increase the number of logfiles retained by qpsmtpd (to 20 in the examples below) using:
 +
<nowiki>config setprop qpsmtpd KeepLogFiles 20
 +
sv stop qpsmtpd
 +
kill -HUP `cat /var/service/qpsmtpd/log/supervise/pid`
 +
sv start qpsmtpd</nowiki>
 +
 +
The same method will work to change the logfile rentention for sqpsmtpd:
 +
<nowiki>config setprop sqpsmtpd KeepLogFiles 20
 +
sv stop sqpsmtpd
 +
kill -HUP `cat /var/service/sqpsmtpd/log/supervise/pid`
 +
sv start sqpsmtpd</nowiki>
 +
 +
{{Warning box|Using a KeepFiles setting of 1 is an extreme setting only to be used for a specific test system with a low volume of emails.}}
    
== qmail: Outgoing SMTP traffic ==
 
== qmail: Outgoing SMTP traffic ==
Line 193: Line 223:  
----
 
----
 
[[Category:Howto]]
 
[[Category:Howto]]
[[Category:Administration]]
+
[[Category:Administration:Monitoring]]
 
[[Category:Mail]]
 
[[Category:Mail]]

Navigation menu