Results 1 to 3 of 3

Thread: script for account reporting?

  1. #1
    saraxxin is offline New Member
    Join Date
    Apr 2013
    Posts
    3
    Rep Power
    1

    Default script for account reporting?

    Hey guys.

    I have been struggling to get a script together for reporting of accounts.
    Basically I need a script that will do the following.

    Get all accounts on the server, by domain.
    Then once it has all the accounts by domain, it must get the following information:
    Account quota, account quota in use, account active state (active / suspended), archving (yes / no)

    Please if you could help I would appreciate it.

    Thanks in advance.

  2. #2
    lfasci is offline Trained Alumni
    Join Date
    Jul 2006
    Location
    Pisa
    Posts
    134
    Rep Power
    8

    Default

    You can start from /opt/zimbra/bin/zmaccts and add the info you want, you can merge info from zmprov gquo servername

  3. #3
    saraxxin is offline New Member
    Join Date
    Apr 2013
    Posts
    3
    Rep Power
    1

    Default

    I found a script on the forums and have edited it slightly.
    The script is creating all the files but is not populating it. The script does work without the loop. But as soon as the loop is added, the files come out blank.

    Here is the script.

    #!/bin/sh
    var=`cat domains`
    domain=$var
    server=pitbull.centx.co.za
    output="/home/reports/$var"
    SendTo="email@domain.com"

    rm -f $output
    touch $output
    do
    /opt/zimbra/bin/zmprov gqu $server|grep $var|awk {'print $1" "$3" "$2'}|sort|while read line
    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 ($status account)" >> $output
    done
    cat $output | mail $SendTo -s"Mailbox Usages for $var"

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. ZD account setup from logon script
    By poncho in forum General Questions
    Replies: 0
    Last Post: 04-02-2012, 05:35 AM
  2. Script started when account created
    By deletek in forum Developers
    Replies: 2
    Last Post: 11-25-2009, 12:02 AM
  3. [SOLVED] script to change setting for bulk users account
    By brainocide in forum Administrators
    Replies: 5
    Last Post: 09-29-2009, 04:19 AM
  4. Backup Reporting
    By jonesrn in forum Administrators
    Replies: 0
    Last Post: 02-09-2009, 06:28 AM
  5. :: mailbox reporting ::
    By kapshure in forum Administrators
    Replies: 0
    Last Post: 06-18-2008, 10:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •