I wrote a simple script that parses yesterday's log file for ZWC access and prints a comma-separated list of users and IP addresses:
Code:
#!/bin/bash
PATH="/usr/bin:/bin"
# Find yesterday's log file
logfile=`ls -1 /opt/zimbra/log/mailbox.log.*|sort | tail -n 1`
# Find NoOpRequest entries in the log and output as comma-separated list
cat $logfile | grep "ZimbraWebClient" | grep "name=" | grep "NoOpRequest" | cut -d " " -f 6 | tr ";" " " |tr "=" " " | cut -d " " -f 2,6 | sort | uniq | tr " " ","
There are probably more elegant ways to do it, but this seems to work. You could call this from your crontab any time after midnight when the log file is rotated.