[Mailman-Users] Mailman stat's

Larry Hansford lhansfor at lch-assoc.com
Fri Feb 7 04:40:38 CET 2003


At 09:08 PM 2/5/2003, you wrote:
>Here is a stat's script that we use.  It sends out monthly status
>reports to the Mailman admins as well as to each lists admin.
>
>#For the number of lists:
>  ~mailman/bin/list_lists -b |wc -l
>
>#For the number of users in each list:
>   for i in `~mailman/bin/list_lists -b`;
>   do
>     j=`~mailman/bin/list_members $i |wc -l`
>     echo "list $i has $j members"
>   done
>
>
>=== mm_stats script ===
>#! /bin/bash
># Run monthly stats on Meeting maker logs
>#  - top 10 users of each list
>#  - Number of attempted posts (per list)
>#  - Total bytes sent (per list)
>#
># Mailman's log file to be examined for stats
># We rotate the logs monthly and run this script
># around 6am on the first of each month.
># The newly rotated monthly file is post.1
>POST=~mailman/logs/post.1
>
># create temp file to collect stats
>TMPFILE=`mktemp /tmp/mm_stats.XXXXXX` || exit 1
>
>LIST="`/home/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 -n "   Starting:  " >> $TMPFILE
>   head -1 $POST |cut -f1-3 "-d " >> $TMPFILE
>   echo -n "   Ending:    " >> $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 collected stats off to the list admin and cc the mailman user
>   mail -s "Mailman Stats for List: $i" -c mailman $i-admin <$TMPFILE
>done
>
># remove the temp file
>rm $TMPFILE
>=== end of mm_stats script ===
>
>Hope these help - Jon Carnes

Thanks for the script, Joh!  Looks great.

I've trying to develop a script to run the "bin/list_members --nomail" for 
each mailing list once a month, with the results mailed to the list 
administrator.  Does anyone have an easy way to accomplish that?    The 
reason I want to generate those reports is to allow the list owners to see 
which members have been set to nomail due to bounces and need attention.

Again, thanks!

Larry






More information about the Mailman-Users mailing list