Bu yazıda Zimbra Server üzerinde yer alan e-posta hesaplarının kota ve kullanım bilgilerini çekebilmemiz için bir bash script paylaşacağım.
#!/bin/bash
output="/tmp/kota_kullanim.txt"
domain="example.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 " "`
echo "$user `expr $usage / 1024 / 1024`" "MB `expr $quota / 1024 / 1024`" "MB" >> $output
done
cat $output
Scriptte yer alan domain değişkenine, hangi domaine ait hesapların kota ve kullanım bilgisine erişmek istiyorsanız o domaini yazabilirsiniz.
Teşekkürler…