Results 1 to 4 of 4

Thread: best way to count accounts per server and in total?

Hybrid View

  1. #1
    Join Date
    Apr 2010
    Posts
    57
    Rep Power
    5

    Question best way to count accounts per server and in total?

    Hi,

    I'm making a munin plugin to track the total number of Zimbra accounts and number of accounts per server. I'm looking for any command line ways to get those numbers.

    I know a few ways to get the total number of accounts, including these two:

    Code:
    zmsoap -z GetLicenseRequest | grep TotalAccounts
    or
    zmprov -l gaa | wc -l
    but for getting the number of accounts per server, the only thing I have so far is this:
    Code:
    zmprov -l gaa -s `zmhostname` | wc -l
    Anyone got other ways to get that data from Zimbra? Thanks!

  2. #2
    Join Date
    Jul 2007
    Posts
    343
    Rep Power
    8

    Default

    Use ldapsearch. It will return accounts available on all servers in multinode environment as per your query.

    ldapsearch -h
    ~=Prashant=~

  3. #3
    Join Date
    Apr 2010
    Posts
    57
    Rep Power
    5

    Default

    Thanks, but while ldapsearch is a less friendly alternative to zmprov, they both just count the number of lines to get the number of accounts on a mailbox.

    The most efficient way to get this number is probably by looking in the mailbox's local database:
    Code:
    echo "select count(id) from mailbox;" | mysql zimbra;
    However, that will list active accounts PLUS accounts that have been migrated but not yet purged from the server.

    The current plugin can be found here: https://github.com/JohnSpeno/zimbra-...imbra_accounts

  4. #4
    Join Date
    Jul 2007
    Posts
    343
    Rep Power
    8

    Default

    It depends on what query you put to get the data from ldap. Anyways your approach also seems to be fine.

    Thanks.
    ~=Prashant=~

Similar Threads

  1. How to count user accounts
    By waseemz in forum Administrators
    Replies: 1
    Last Post: 05-27-2010, 06:27 AM
  2. Replies: 2
    Last Post: 04-07-2010, 06:33 AM
  3. HSP how to count/declare archiving accounts
    By djeebee in forum Administrators
    Replies: 2
    Last Post: 07-30-2008, 08:46 AM
  4. Replies: 3
    Last Post: 07-28-2008, 01:20 AM
  5. total message count
    By OfMacAndMen in forum Administrators
    Replies: 2
    Last Post: 04-07-2008, 03:52 PM

Posting Permissions

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