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!

XML API Callback's for bandwidth and disk quota exceeded/warning it will exceed

Discussion in 'cPanel Developers' started by jordan120, Oct 17, 2009.

  1. jordan120

    jordan120 Registered

    Jan 6, 2007
    Likes Received:
    Trophy Points:
  2. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Nov 5, 2008
    Likes Received:
    Trophy Points:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    At the present time we do not provide functionality that is like what you've described. The end goal might still be possible but it is dependent upon creating a custom script that performs the requested functions, including checking for the desired information and passing it on (in a "call-back"); a cron entry could be used to automate the process of having the custom script perform its checks at predefined intervals.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. jdelsman

    jdelsman Registered

    Nov 11, 2006
    Likes Received:
    Trophy Points:
    I have actually been told by two separate cPanel staff that this is being looked into. Is this actually in the roadmap, or not? If not, can this be entered as a feature request? I think I can clarify what Jordan is asking a bit better...

    Ideally, I envision an area in cPanel where an administrator could enter a callback URL, let's say http://remote.application/callbacks/cpanel.json, with which cPanel would send a POST request on a few configurable actions. A couple that come to mind are:

    - When a user goes over their bandwidth limit
    - When a user is suspended
    - When a user is unsuspended
    - When a user is terminated
    - etc.

    Basically, it is hard for developers to build software applications which need to call to cPanel every hour or more to get this type of information, or build a separate cron task for every server... not to mention costly in terms of load required to perform the actions. The alternative, which is what I am proposing, would send a simple XML/JSON string in a POST request letting the remote application know that something happened. Here is an example:

        <created-at>Sun Oct 18 00:22:23 BST 2009</created-at>
          <reason>Bandwidth overage</reason>
    Attributes pertaining specifically to the notification would go inside the attributes node. This would be a much less resource intensive way to gather data from a server when events occur, it would make tonnes of developers ecstatic, and I have a feeling it would not be that hard to implement.

    What do you guys think?
  4. MattDees

    MattDees Well-Known Member

    Apr 29, 2005
    Likes Received:
    Trophy Points:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    At this point, this feature is not on our roadmap, we agree that a feature like this may be useful, however there are some ways to get (some) of the information that you are talking about. Please open a feature request in the feature request forum so that other users can comment on this idea and we can see the demand/public discussion of a feature like this.

    If you look at our functionhooks feature it does something very similiar to this, however this only exists for the cPanel interface and not the WHM interface.

    For some of the actions you are talking about, script hooks do exist (please review ScriptHooks < DevHooks < TWiki )

    These can be used to create a callback like what you are describing.

    As for things like bandwidth notifications, nothing is able to hook into that system at this time, I am adding a feature request (for review by our development to decide of feasibility, roadmap, etc) to add in hooks for bandwidth & diskspace processing.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

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