• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Getting information about disk/mail space and trafic from Plesk!

A

AnastasiyaK

Guest
Hello,

I need to get a information about disk/mail space and trafic from Plesk. This information we will put to our shopping cart system which use our clients and for each client we'll show unique own information, which using on our server.

We want to show to clients, dynamic information from Plesk on their own ecommerce panel.

Please somebody can help me, how and where i can get this information for to use and to put to our ecommerce panel.

Best Regards, Anastasiya
 
Hi,

I'm not sure how this information is supposed to get to your panel, but getting it out of Plesk is not that hard.
There are two ways I can suggest right away:

To parse the output of the "domain" utility:

/usr/local/psa/bin/domain --info <domain_name>

, the details are here:
http://download1.parallels.com/Plesk/PPP9/Doc/en-US/plesk-9.2-unix-cli/index.htm?fileName=37768.htm

However, this is rather slow and troublesome, so you might prefer to get information directly from Plesk database.

For instance, domain traffic usage information can be grabbed from DomainsTraffic table, and disk usage (separately for databases, mailbox, etc) can be found in disk_usage table.

A query like that would obtain outgoing HTTP traffic information for a given domain:

select domains.name, DomainsTraffic.http_out from domains join DomainsTraffic on (domains.id = DomainsTraffic.dom_id) where domains.name = '<domain_name>';

You can access the database from cli as described here -- http://kb.odin.com/en/170 , plesk database name is 'psa'. But you will probably want to create a separate MySQL account your e-commerce application will use and grant it read-only access to the needed tables in Plesk database (for security reasons), and access the database either locally or remotely (if your e-commerce panel is hosted on some other machine than Plesk).
 
Back
Top