[Mailman-Users] list statistics

Jon Carnes jonc at nc.rr.com
Fri Apr 12 21:00:54 CEST 2002

Here is the final list stats script.  If you use this script as is, then you 
should run the script just before rotating your Mailman log files.

If you want to run it right after rotating your log files, and your log files 
rotate by adding a .1 to the end of post (so the rotated file would be 
"post.1") then simply change the line:
  POST= ...
and point it to your rotated log file.

Any suggestions or modifications are welcome,

Jon Carnes


#! /bin/bash
# Run monthly stats on Meeting maker logs
#  - top 10 users of each list
#  - Number of attempted posts (per list)
#  - Number of Successful posts (per list)
#  - Total bytes sent (per list)

echo "Stats from local Mailman lists:"
  echo -n "   Starting:  "
  head -1 $POST |cut -f1-3 "-d "
  echo -n "   Ending:    "
  tail -1 $POST |cut -f1-3 "-d "
LIST="`/home/mailman/bin/list_lists |awk '{print $1}' |sed -n '2,$p'`"
echo " "
for i in $LIST
  echo ====== $i ======
  echo -n "Total posts to the list: "
  grep -i "post to $i " $POST |wc -l
  echo -n "Total SUCCESSFUL posts to the list: "
  grep -i "post to $i " $POST |grep success |wc -l
  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
  echo " "
  echo "Top 10 posters to the list:"
  grep -i "post to $i " $POST |cut -f 10 "-d " |sort |uniq -c \
     |sort -bgr |head -10
  echo " "

More information about the Mailman-Users mailing list