ispCP - Board - Support
[Patch] Pop3 statistics with dovecot not created - Printable Version

+- ispCP - Board - Support (http://www.isp-control.net/forum)
+-- Forum: ispCP Omega Support Area (/forum-30.html)
+--- Forum: System Setup & Installation (/forum-32.html)
+--- Thread: [Patch] Pop3 statistics with dovecot not created (/thread-5000.html)



[Patch] Pop3 statistics with dovecot not created - aseques - 11-24-2008 11:43 PM

Recently I realized that no POP3 statistics were being generated in case you use dovecot.
Since most of the traffic is POP3 I just fixed that for my server.
Basically I tweaked some values from dovecot output to match the pattern that ispcp needs:

user=user@example.com top=0 retr=size

I know it won't be in next rc, but if someone could have a look at it, I'd be glad to add the patch to the documentation ...

Cheers


RE: [Patch] Pop3 statistics with dovecot not created - aseques - 11-29-2008 02:06 AM

Since the forums ate my patch. I post it in plain ...

Quote:--- /root/ispcp-vrl-traff 2008-11-24 12:12:25.000000000 +0100
+++ /var/www/ispcp/engine/traffic/ispcp-vrl-traff 2008-11-24 14:38:22.000000000 +0100
@@ -498,10 +498,15 @@

# POP3
# courierpop3login is for Debian. pop3d for Fedora.
- $rs = sys_command("$cat $rlog|$grep -E '(courierpop3login|pop3d).+user=.+top='|$grep -v 'ip=\\[::ffff:127.0.0.1\\]'|"
- ."$awk '/courierpop3login/ {print \$7,\$9,substr(\$10,1,length(\$10)-1);} "
- ."/pop3d/ {print \$7,\$10,substr(\$11,1,length(\$11)-1);}'"
- ." 1>$pop3_log");
+ #$rs = sys_command("$cat $rlog|$grep -E '(courierpop3login|pop3d).+user=.+top='|$grep -v 'ip=\\[::ffff:127.0.0.1\\]'|"
+ # ."$awk '/courierpop3login/ {print \$7,\$9,substr(\$10,1,length(\$10)-1);} "
+ # ."/pop3d/ {print \$7,\$10,substr(\$11,1,length(\$11)-1);}'"
+ # ." 1>$pop3_log");
+ # POP3 accounting fixed for Dovecot
+ $rs = sys_command("$cat $rlog|$grep 'POP3'| $grep 'Disconnected: Logged out' |"
+ ."$awk '/POP3/ {split(\$10,array,\"\/\"); print \"user=\"substr(\$6,6,length(\$6)-7) "
+ ."\", top=\"substr(array[2],0,length(array[2])) \", retr=\"substr(\$13,6,length(\$13)) ;}'"
+ ." 1>$pop3_log");
return $rs if ($rs != 0);

$res = open(F, '<', $pop3_log);



RE: [Patch] Pop3 statistics with dovecot not created - UncleSam - 04-15-2010 06:37 PM

sorry to ask, but how to use this diff?


RE: [Patch] Pop3 statistics with dovecot not created - aseques - 04-15-2010 07:10 PM

(04-15-2010 06:37 PM)UncleSam Wrote:  sorry to ask, but how to use this diff?
Don't worry, this is quite old, and has been fixed a long ago.
For the current issues, you can follow the thread in
http://www.isp-control.net/forum/thread-8721.html