How to check cPanel User Resource usage using UAPI

  Uncategorized

1️⃣ Introduction

The command:

$ uapi --output=jsonpretty --user=<cpanel_username> ResourceUsage get_usages

is used to retrieve detailed hosting resource usage information for a specific cPanel user account.

It queries the ResourceUsage module in cPanel using UAPI and returns structured data about how much of the allocated hosting resources the user is currently consuming.

This command is commonly used by system administrators for monitoring, auditing, and troubleshooting hosting accounts.


2️⃣ Prerequisites

Before running this command, ensure:

  • ✅ cPanel & WHM is installed on the server
  • ✅ You have root or sufficient administrative privileges
  • ✅ The cPanel username is valid and exists
  • ✅ UAPI is available on the server

3️⃣ What Information We Get from This Command

The command provides a detailed summary of the following resource categories:

📦 Disk Usage

Shows how much disk space the account is currently using.
This includes website files, emails, databases, and other stored data.


🌐 Bandwidth Usage

Displays the total data transferred by the account (incoming + outgoing traffic).
Useful for monitoring traffic limits in hosting plans.


🌍 Domain Limits

Provides information about:

  • Addon domains
  • Subdomains
  • Alias (Parked) domains

It shows both:

  • Current usage
  • Maximum allowed limit

📧 Email Resources

Displays usage details for:

  • Email accounts
  • Mailing lists
  • Autoresponders
  • Forwarders
  • Email filters

Helps track whether the user has reached email-related limits.


🗄 Database Usage

Shows:

  • Number of MySQL databases created
  • Maximum databases allowed

Useful for checking database allocation in shared hosting plans.


📁 FTP Accounts

Displays:

  • Number of FTP accounts created
  • Maximum allowed FTP accounts

🔢 Resource Limits

For each resource, the command typically provides:

  • Current usage
  • Maximum allowed limit
  • Whether the limit is unlimited (if no maximum is set)

4️⃣ Why This Command Is Important

This command helps administrators to:

  • Monitor user resource consumption
  • Identify accounts close to their limits
  • Troubleshoot disk or bandwidth issues
  • Audit hosting plans
  • Automate reporting and monitoring systems
  • Ensure fair usage in shared environments

5️⃣ Conclusion

The ResourceUsage get_usages UAPI command provides a complete overview of a cPanel user’s hosting resource consumption and limits.

It is a powerful administrative tool for maintaining server stability, preventing resource overuse, and managing hosting accounts efficiently.

By using this command, administrators can proactively manage resources and ensure optimal performance of hosted environments.

LEAVE A COMMENT