Skip to main content

The easiest way to get CPU, RAM usage and Mail Queue

Comments

3 comments

  • cPanelMichael
    Hello, The following WHM API 1 function is available if you want to obtain the server's load average: WHM API 1 Functions - loadavg - Software Development Kit - cPanel Documentation You may also find this WHM API 1 function helpful: WHM API 1 Functions - servicestatus - Software Development Kit - cPanel Documentation As far as fetching the number of emails in the mail queue, you could develop your script to provide the output from the following bash command:
    exim -bpc
    This will output the number of emails currently queued. Thank you.
    0
  • Ovidiu Sopa
    Thank you for the reply. As for the API I haven't found how I will authentificate to the server before requesting the loadavg using JSON. But if I won't be able to get the queue using the API I think I will focus on a script, as you showed me the command exim -bpc, I could use some other commands to get CPU and RAM usage, and save the informations in either a local database on the server, or directly in the remote database, I have in my office. I think a single script setup in the cron should be ok for what I want.
    0
  • cPanelMichael
    I think a single script setup in the cron should be ok for what I want.

    That's likely the best approach. That said, should you have interest in API authentication in the future, we document the available methods at: Guide to API Authentication - Software Development Kit - cPanel Documentation Thank you.
    0

Please sign in to leave a comment.