Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

listsuspended XML/JSON output but without authentication

Discussion in 'cPanel Developers' started by teh, Nov 20, 2009.

  1. teh

    teh Member

    Joined:
    Jul 13, 2008
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    51
    Hello,

    I need to get the output from listsuspended (JSON or XML - doesn't matter) but without authentication when called locally by root. I need to use the output in a script. Is there something that can do this or it'll be easier to just parse /var/cpanel/suspended/ in some way?
     
  2. MattDees

    MattDees Well-Known Member

    Joined:
    Apr 29, 2005
    Messages:
    416
    Likes Received:
    1
    Trophy Points:
    243
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    well, parsing /var/cpanel/suspended would probably be your easiest route for this, however I do have a script written for this.

    This requires that the server has /root/.accesshash setup (got to "Setup Remote Access Keys" in WHM to generate the file this uses)

    To use this script, run it f.ex. "./hash_query.pl /xml-api/listsuspended"

    and it should return the correct data.
     

    Attached Files:

    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice