A way to get an emailable report of all mailboxes in a domain, their quota, usage and account status, so a domain admin can review their accounts without having to login to zimbra. (most of this is the same as viewing quota usage in zimbra admin, but this was easier, as it can then be emailed on a schedule)
I saved this file in /opt/zimbra/backup/scripts/ as usagereport.sh, owned by zimbra.zimbra chmod 755 accountusage.sh
#!/bin/bash
SMTP="10.0.0.2"
FROM="user@yourdomain.com"
TO="user@yourdomain.com"
SUB="Mailbox Usages"
MSG="Mailbox Usages"
output="/tmp/accountusage.csv"
domain="yourdomain.com"
SendTo="user@yourdomain.com"
rm -f $output
touch $output
server=`zmhostname`
/opt/zimbra/bin/zmprov gqu $server|grep $domain|awk {'print $1" "$3" "$2'}|sort|while read line
do
usage=`echo $line|cut -f2 -d " "`
quota=`echo $line|cut -f3 -d " "`
user=`echo $line|cut -f1 -d " "`
#status=`/opt/zimbra/bin/zmprov ga $user | grep ^zimbraAccountStatus | cut -f2 -d " "`
#with status
#echo "$user; `expr $usage / 1024 / 1024`MB; `expr $quota / 1024 / 1024`MB; ($status account)" >> $output
# without status
echo "$user; `expr $usage / 1024 / 1024`MB; `expr $quota / 1024 / 1024`MB" >> $output
done
#cat $output | mail @SendTo -s"Mailbox Usages for $domain"
sendemail -q -o tls=no -f $FROM -t $TO -u $SUB -m $MSG -s $SMTP:25 -a $output
View expiration date of DNSSEC signature
dig SOA yourdomain.com @nameserver +dnssec
Mais vistos
-
Java Keytool Command These commands allow you to generate a new Java Keytool keystore file, create a CSR, and import certificates. A...
-
Kaspersky seems to be storing windows update files on the C Drive: Here -> C:\ProgramData\KasperskyLab\adminkit\1093\.working Change fo...
-
A few cmds to help with the DFS troubleshooting aspects, keep in mind all should be run from an elevated PowerShell Dfsdiag /TestDCs D...