Skip to main content

Per User Bandwidth

Comments

8 comments

  • 24x7server
    No, You can not check this with your command line. You will have to check this through WHM >> Account Information >> View Bandwidth Usage
    0
  • cPanelMichael
    Hello, You can use the Bandwidth::query UAPI function to view an account's bandwidth via the command line. EX:
    uapi --user=user123 Bandwidth query grouping=domain interval=daily protocols=http%7Cimap%7Csmtp timezone=America%2FChicago
    It's documented at: UAPI Functions - Bandwidth::query - Software Development Kit - cPanel Documentation Thank you.
    0
  • Osama Tariq
    Getting error while run command:
    root@server [~]# uapi --user=username Bandwidth query grouping=domain.com interval=daily protocols=http%7Cimap%7Csmtp timezone=America%2FChicago --- apiversion: 3 func: query module: Bandwidth result: data: ~ errors: - "Invalid "grouping": "domain.com"! at /usr/local/cpanel/Cpanel/BandwidthDB/Read.pm line 239, line 1.\n" messages: ~ metadata: {} status: 0
    0
  • cPanelMichael
    New Getting error while run command:

    You entered an actual domain name instead of "domain" under the grouping parameter. The example uses "domain" as the actual entry, as documented at:
    0
  • Osama Tariq
    I have added actual domain name and username instead of domain and username.
    0
  • cPanelMichael
    New I have added actual domain name and username instead of domain and username.

    Yes, that is the mistake:
    grouping=domain.com
    Should be:
    grouping=domain
    Don't use an actual domain name. Instead, use "domain" or another grouping parameter documented at:
    0
  • Osama Tariq
    Now it shows nothing in no result:
    # uapi --user=ghckteum Bandwidth query grouping=domain interval=daily protocols=http%7Cimap%7Csmtp timezone=America%2FChicago--- apiversion: 3 func: query module: Bandwidth result: data: {} errors: ~ messages: ~ metadata: {} status: 1
    0
  • cPanelMichael
    Hello, You may find a command like this is more useful and easier to formulate for what you need:
    uapi --user=$username Bandwidth query grouping=domain interval=daily
    This shows the total bandwidth usage for the account instead of choosing specific protocols. Thank you.
    0

Please sign in to leave a comment.