All details about a cPanel user in a single command

How does it possible?

Ans: By simply using the cPanel API script whmapi1 🙂

We already discussed one of the great feature of whmapi1 for creating WHM root session.
We can create any user login sessions (WHM (root), WHM (resellers), cPanel, Webmail etc) by using this command.

Refer –> How to access WHM panel without root password?

Here I’m investigating, how to identify all details about a cPanel user from a single command. Yeah, this can be done by using the argument “listaccts” to “whmapi1” along with some other parameters.

How to use this in command line interface?

It’s simple. Do the following steps:

1, SSH to server.

2, Execute the command as follows:

whmapi1 listaccts search=username searchtype=user

If you do not specify a value for both the “searchtype” and “search” parameters, the function returns all of the server’s accounts. By using these parameters, you will get a clean output as you are expecting.

From this command, we can findout almost all details about a particular cpanel user without log into the cPanel/WHM user interface.

We will get the details about backup, disklimit, diskused, domain, email, inodeslimit, inodesused, details about ip (both ipv4 and ipv6), email accounts related stuffs (like mailbox_format, max_defer_fail_percentage, max_email_per_hour), accounts limits (like maxaddons, maxftp, maxlst, maxparked, maxpop, maxsql, maxsub), email accounts’ status (outgoing_mail_hold, outgoing_mail_suspended), current plan, account suspension details (suspended, suspendreason, suspendtime) and some core information (owner, partition, shell, startdate, theme, uid, unix_startdate, user etc) etc in a single line command.

Cool…!

Sample screenshot. Not added

Some usages.

How to list disk quota allocated and current usage quickly?

We can simply grep it out from the above command. See the syntax pasted below:

# whmapi1 listaccts search=crybit searchtype=user| grep disk
      disklimit: 5120M
      diskused: 1417M

Or

# whmapi1 listaccts search=crybit searchtype=user want=diskused
--- 
data: 
  acct: 
    - 
      diskused: 1417M

How to check inode limit and current usage for a single cPanel account via command line?

Use the following commands to get idea about inode usages:

# whmapi1 listaccts search=crybit searchtype=user| grep inode
      inodeslimit: unlimited
      inodesused: 16318

Or

# whmapi1 listaccts search=crybit searchtype=user want=inodesused --- data: acct: - inodesused: 16318

You can use the parameter “want” to fetch details separately.

Try karo!! 🙂

Arunlal Ashok

Linux Server Administrator. I'm managing Linux servers since 2012. I started this blog to share and discuss my ideas. Any questions? Write to arun (@) crybit.com

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *