[Mailman-Users] Re: mm_stats question
I just double checked and it works fine on all my sites... Do you have any lists with = in the name? If that is the case, then you would need to modify the first line and add in an additional cut: SIZ=`grep -i post to $i $POST |grep success |cut -f2- -d, | \ cut -f2 -d= |cut -f1 -d,` k=0; for j in $SIZ; do k=$(( j + k )); done echo Total bytes = $k $TMPFILE This additional cut will remove the listname from the line before using the = to isolate the size of the message If that doesn't do it for you, then drop a copy of your post log and the name of the list with the problems and I'll see what needs to be modified. Hope this is helpful - Jon Carnes On Fri, 2004-02-27 at 10:24, Al Black wrote: Hi Jon, I trying out the mm_stats script you wrote (see http://www.mail-archive.com/[EMAIL PROTECTED]/msg15378.html) and have a couple of little bugs you might be able to help me with. I'm using version 2.1.4 of mailman. I get two errors running the script from command line. The first is: ===: not found I'm pretty sure this happens when the script hits a list we have that has no traffic. The second one is the one I'm more concerned with: /usr/home/lamps/test/mm_stats: arith: syntax error: j + k What seems to be happening is that the lines: # SIZ=`grep -i post to $i $POST |grep success |cut -f2 -d= |cut -f1 -d,` # k=0; for j in $SIZ; do k=$(( j + k )); done isn't cutting the size=field properly. Any suggestions for a fix? Otherwise the script is running great, and it will make my list members happy. (In fact maybe it, or a bunch of variations on it, could be included in the mailman 3 suite.) Thanks in advance, al # Mailman's log file to be examined for stats POST=/usr/home/lamps/usr/local/mailman/logs/post # create temp file to collect stats TMPFILE=`mktemp /tmp/mm_stats.XX` || exit 1 LIST=`/usr/home/lamps/usr/local/mailman/bin/list_lists |awk '{print $1}' |sed -n '2,$p'` for i in $LIST do echo Stats from local Mailman list: $i $TMPFILE echo $TMPFILE echo -nStarting:$TMPFILE head -1 $POST |cut -f1-3 -d $TMPFILE echo -nEnding: $TMPFILE tail -1 $POST |cut -f1-3 -d $TMPFILE echo === $TMPFILE echo -n Total posts to the list: $TMPFILE grep -i post to $i $POST |wc -l $TMPFILE echo -n Total SUCCESSFUL posts to the list: $TMPFILE grep -i post to $i $POST |grep success |wc -l $TMPFILE # SIZ=`grep -i post to $i $POST |grep success |cut -f2 -d= |cut -f1 -d,` # k=0; for j in $SIZ; do k=$(( j + k )); done echo Total bytes = $k $TMPFILE echo $TMPFILE echo Top 10 posters to the list: $TMPFILE grep -i post to $i $POST |cut -f 10 -d |sort |uniq -c \ |sort -bgr |head -10 $TMPFILE echo$TMPFILE # Mail the collected stats off to the list admin and cc the mailman user # mail -s Mailman Stats for List: $i -c mailman $i-admin $TMPFILE # mail the collected Stats for lists to the server admin mail -s Mailman Stats for List: $i server-admin $TMPFILE done -- Mailman-Users mailing list [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ This message was sent to: [EMAIL PROTECTED] Unsubscribe or change your options at http://mail.python.org/mailman/options/mailman-users/archive%40jab.org
[Mailman-Users] Re: mm_stats question
Hey John, At 01:08 PM 2/27/2004 -0500, Jon Carnes wrote: I just double checked and it works fine on all my sites... Do you have any lists with = in the name? If that doesn't do it for you, then drop a copy of your post log and the name of the list with the problems and I'll see what needs to be modified. Nope didn't do the trick. None of the lists have an = in them but all but two have - lls test lls-business lls-ts lls-12step-men lls-12step-women I've attached the post logs, although there's not much in it because I rotated them a while ago. If its better I can un pack one, and send it along. The bug still happens though, even with the limited set. Thanks. al Feb 27 10:52:19 2004 (42920) post to test from [EMAIL PROTECTED], size=950, message-id=[EMAIL PROTECTED], 1 failures Feb 27 10:54:51 2004 (42920) post to test from [EMAIL PROTECTED], size=950, message-id=[EMAIL PROTECTED], 1 failures Feb 27 10:55:32 2004 (42920) post to lls from [EMAIL PROTECTED], size=1549, message-id=[EMAIL PROTECTED], success Feb 27 11:11:16 2004 (42920) post to lls from [EMAIL PROTECTED], size=1388, message-id=[EMAIL PROTECTED], success Feb 27 11:25:29 2004 (42920) post to lls from [EMAIL PROTECTED], size=2461, message-id=[EMAIL PROTECTED], success Feb 27 11:43:31 2004 (42920) post to lls from [EMAIL PROTECTED], size=3733, message-id=[EMAIL PROTECTED], success Feb 27 11:45:54 2004 (42920) post to 12-step-women from [EMAIL PROTECTED], size=1495, message-id=[EMAIL PROTECTED], success Feb 27 11:51:38 2004 (42920) post to 12-step-women from [EMAIL PROTECTED], size=1234, message-id=[EMAIL PROTECTED], success Feb 27 12:01:55 2004 (42920) post to lls from [EMAIL PROTECTED], size=1949, message-id=[EMAIL PROTECTED], success Feb 27 12:02:45 2004 (42920) post to lls from [EMAIL PROTECTED], size=2310, message-id=[EMAIL PROTECTED], success Feb 27 12:27:07 2004 (42920) post to lls from [EMAIL PROTECTED], size=3337, message-id=[EMAIL PROTECTED], success Feb 27 12:35:53 2004 (42920) post to lls from [EMAIL PROTECTED], size=1622, message-id=!~!UENERkVCMDkAAQACABgA2BrmIb0c1EOFE7B/[EMAIL PROTECTED], success Feb 27 12:45:14 2004 (42920) post to lls from [EMAIL PROTECTED], size=1370, message-id=[EMAIL PROTECTED], success -- Mailman-Users mailing list [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ This message was sent to: [EMAIL PROTECTED] Unsubscribe or change your options at http://mail.python.org/mailman/options/mailman-users/archive%40jab.org
[Mailman-Users] Re: mm_stats question
On Fri, 2004-02-27 at 15:25, Al Black wrote: Hey John, At 01:08 PM 2/27/2004 -0500, Jon Carnes wrote: I just double checked and it works fine on all my sites... Do you have any lists with = in the name? If that doesn't do it for you, then drop a copy of your post log and the name of the list with the problems and I'll see what needs to be modified. Nope didn't do the trick. None of the lists have an = in them but all but two have - lls test lls-business lls-ts lls-12step-men lls-12step-women I've attached the post logs, although there's not much in it because I rotated them a while ago. If its better I can un pack one, and send it along. The bug still happens though, even with the limited set. Thanks. al Sorry, Al Your sample worked just fine - no errors. I checked it against all your list names. Check your script for typos. You can also run each part of the script and see what results you get: grep -i post to lls post # this will show you all the attempted posts to list lls grep -i post to lls post |grep success # this will show you all successful posts to the list lls grep -i post to lls post |grep success |cut -f2 -d= # this will remove all info on the left side of the message size # the output will like like this: 1549, message-id 1388, message-id 2461, message-id 3733, message-id 1949, message-id 2310, message-id 3337, message-id 1622, message-id 1370, message-id grep -i post to lls post |grep success |cut -f2 -d= |cut -f1 -d, # this drops the info to the right of the message size # the message size is now isolated on each line: 1549 1388 2461 3733 1949 2310 3337 1622 1370 It worked just fine here. Good luck again Jon Carnes -- Mailman-Users mailing list [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ This message was sent to: [EMAIL PROTECTED] Unsubscribe or change your options at http://mail.python.org/mailman/options/mailman-users/archive%40jab.org