Menampilkan Account Status Dengan Info Account Quota di Zimbra
Menampilkan Account Status Dengan Info Account Quota di Zimbra berfungsi untuk mengetahui akun-akun yang berstatus close atau active dengan total Account quota mailbox, berapa banyak quota yang sudah di pakai user dan waktu terakhir user login. Ini menggunakan script yang dapat dijalankan pada user zimbra.
1. Status Account Closed
1. Buat file closed-accounts.sh dan simpan pada /opt
cd /opt nano closed-accounts.sh
2. Masukkan code berikut, copy + paste, simpan file
#!/bin/bash echo "Username | Total Quota(byte) | Usage(MB) | Server | Last Login Time" echo "===================================================================" zmaccts | grep closed | grep @ | awk '{ print $1 }' | while read ACCOUNT do QUOTA_TOTAL=`zmprov ga ${ACCOUNT} | grep "zimbraMailQuota" | cut -d ":" -f2` QUOTA_USAGE=`zmmailbox -z -m ${ACCOUNT} gms` HOSTED_ON=`zmprov ga ${ACCOUNT} | grep zimbraMailHost | awk -F: '{ print $2 }'` LAST_ON=`zmprov ga ${ACCOUNT} | grep zimbraLastLogonTimestamp: | awk -F: '{ print $2 }' ` echo "${ACCOUNT} ${QUOTA_TOTAL} ${QUOTA_USAGE} ${HOSTED_ON} ${LAST_ON} " done
3. Ubah permission script
chown zimbra.zimbra /opt/closed-accounts.sh chmod +x /opt/closed-accounts.sh
4. Jalankan script dengan perintah berikut
su - zimbra sh /opt/closed-accounts.sh
2. Status Account Active
1. Buat file active-accounts.sh dan simpan pada /opt
cd /opt nano active-accounts.sh
2. Masukkan code berikut, copy + paste, simpan file
#!/bin/bash echo "Username | Total Quota(byte) | Usage(MB) | Server | Last Login Time" echo "===================================================================" zmaccts | grep active | grep @ | awk '{ print $1 }' | while read ACCOUNT do QUOTA_TOTAL=`zmprov ga ${ACCOUNT} | grep "zimbraMailQuota" | cut -d ":" -f2` QUOTA_USAGE=`zmmailbox -z -m ${ACCOUNT} gms` HOSTED_ON=`zmprov ga ${ACCOUNT} | grep zimbraMailHost | awk -F: '{ print $2 }'` LAST_ON=`zmprov ga ${ACCOUNT} | grep zimbraLastLogonTimestamp: | awk -F: '{ print $2 }' ` echo "${ACCOUNT} ${QUOTA_TOTAL} ${QUOTA_USAGE} ${HOSTED_ON} ${LAST_ON} " done
3. Ubah permission script
chown zimbra.zimbra /opt/active-accounts.sh chmod +x /opt/active-accounts.sh
4. Jalankan script dengan perintah berikut
su - zimbra sh /opt/active-accounts.sh
Selamat mencoba..