1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

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

Discussion in 'Plesk 9.x for Linux Issues, Fixes, How-To' started by AnastasiyaK, Sep 28, 2009.

  1. AnastasiyaK

    AnastasiyaK Guest


    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
  2. GreedyGopher

    GreedyGopher Guest


    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:

    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).