MarkEliasen Posted February 25, 2012 Share Posted February 25, 2012 Hi Everyone I have been searching around but without luck (most likely because I am not sure exactly what to search for), but I am looking for a way to get the resource limits (space + bandwidth) from the user who's running WHMCS (eg. their reseller account limits). Any way this is possible either via WHMCS or the WHM API? Any directions on how to achieve this would be greatly appreciated! Thanks 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted February 25, 2012 Share Posted February 25, 2012 Theres a disklimit and bwlimit database field in tblhosting. That may be what you need. Otherwise, its fairly easy to grab these values using the WHM API. 0 Quote Link to comment Share on other sites More sharing options...
MarkEliasen Posted February 25, 2012 Author Share Posted February 25, 2012 Theres a disklimit and bwlimit database field in tblhosting. That may be what you need. Otherwise, its fairly easy to grab these values using the WHM API. It is not for the individual users but for the admin/owner of the WHMCS. I have been looking at the WHM API, but I am just staring myself bind, any directions on which API calls to make? Thanks ! 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted February 25, 2012 Share Posted February 25, 2012 This should be what you're looking for, assuming you're trying to get the values for a specific reseller: http://etwiki.cpanel.net/twiki/bin/view/SoftwareDevelopmentKit/ListResellersAccountsInformation 0 Quote Link to comment Share on other sites More sharing options...
MarkEliasen Posted February 25, 2012 Author Share Posted February 25, 2012 (edited) This should be what you're looking for, assuming you're trying to get the values for a specific reseller: http://etwiki.cpanel.net/twiki/bin/view/SoftwareDevelopmentKit/ListResellersAccountsInformation Oh, I believe that is exactly what I am after.. not sure how I could have missed it. This now leads me to my second question, can I use the WHM API through WHMCS or do I need to do it "myself" in the module I am trying to make? Sorry I have only just started WHMCS module development, am I am just interested in what could be considered "best practise" hehe . I really appreciate you help! Edited February 25, 2012 by MarkEliasen 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted February 25, 2012 Share Posted February 25, 2012 Well, that all depends on what you want to do with the information. Where are you trying to display it? Are you looking to just have some kind of dashboard widget to display their limits/usage? 0 Quote Link to comment Share on other sites More sharing options...
MarkEliasen Posted February 25, 2012 Author Share Posted February 25, 2012 (edited) Well, that all depends on what you want to do with the information. Where are you trying to display it? Are you looking to just have some kind of dashboard widget to display their limits/usage? I want to display my limits and current usage on the admin font page as a widget, just so I can keep an eye on when to expand . Edited February 25, 2012 by MarkEliasen 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted February 25, 2012 Share Posted February 25, 2012 I'm feeling charitable today, See attached. Like any other widget, you'll need to enable it in the Administrator Roles. resellerstats.zip 0 Quote Link to comment Share on other sites More sharing options...
bear Posted February 25, 2012 Share Posted February 25, 2012 I'd like to see this info also, just like the account stats available in 4x versions of WHMCS. In each resellers WHMCS info, on the package page (Usage Statistics). Currently for resellers it shows: Disk Usage: 0 MB, Disk Limit: Unlimited MB, BW Usage: 0 MB, BW Limit: Unlimited MB That isn't right, obviously. For hosted accounts, these values are pulled from Cpanel/WHM and helps see issues sooner. 0 Quote Link to comment Share on other sites More sharing options...
MarkEliasen Posted February 25, 2012 Author Share Posted February 25, 2012 (edited) I'm feeling charitable today, See attached. Like any other widget, you'll need to enable it in the Administrator Roles. You. Are. A. Star! Thank you very much! , I really appreciate you help! Will give this a swing in an hour when I get a little time off Edited February 25, 2012 by MarkEliasen 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted February 25, 2012 Share Posted February 25, 2012 I'd like to see this info also, just like the account stats available in 4x versions of WHMCS. In each resellers WHMCS info, on the package page (Usage Statistics). Currently for resellers it shows: Disk Usage: 0 MB, Disk Limit: Unlimited MB, BW Usage: 0 MB, BW Limit: Unlimited MB That isn't right, obviously. For hosted accounts, these values are pulled from Cpanel/WHM and helps see issues sooner. Yeah, for accounts, I believe its updated daily via cron (which updates the database fields), but there is no global usage statistic for the reseller (or root user, even). The widget I attached I was only able to test with root credentials, but I believe it should work fine for resellers as well. When viewing as root it displays "0" for both BW and storage limits for obvious reasons, but for resellers it should show the actual values. Maybe Matt can include this (or something like it) in a future version of WHMCS? 0 Quote Link to comment Share on other sites More sharing options...
MarkEliasen Posted February 26, 2012 Author Share Posted February 26, 2012 Yeah, for accounts, I believe its updated daily via cron (which updates the database fields), but there is no global usage statistic for the reseller (or root user, even). The widget I attached I was only able to test with root credentials, but I believe it should work fine for resellers as well. When viewing as root it displays "0" for both BW and storage limits for obvious reasons, but for resellers it should show the actual values. Maybe Matt can include this (or something like it) in a future version of WHMCS? It does not seem to work on my installation of WHMCS for some reason... I'll give it a few more tests and see what is happening. This is the result I get back: object(SimpleXMLElement)[3] nothing more than that. Anyway, will let you know what happens - Appreciate the help ! 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted February 26, 2012 Share Posted February 26, 2012 It does not seem to work on my installation of WHMCS for some reason... I'll give it a few more tests and see what is happening. This is the result I get back: object(SimpleXMLElement)[3] nothing more than that. Anyway, will let you know what happens - Appreciate the help ! weird, it should work. You copied the includes/cpanel_xmlapi.php file right? You might want to add a var_dump on the api call variable to see what its actually returning. 0 Quote Link to comment Share on other sites More sharing options...
othellotech Posted February 26, 2012 Share Posted February 26, 2012 I'd like to see this info also, just like the account stats available in 4x versions of WHMCS. In each resellers WHMCS info, on the package page (Usage Statistics). Currently for resellers it shows: Disk Usage: 0 MB, Disk Limit: Unlimited MB, BW Usage: 0 MB, BW Limit: Unlimited MB That isn't right, obviously. Its showing the assigments to "their" account (rather than for their whole reseller a/c) - a known/reported bug to WHMCS which still isnt fixed 0 Quote Link to comment Share on other sites More sharing options...
MarkEliasen Posted February 26, 2012 Author Share Posted February 26, 2012 weird, it should work. You copied the includes/cpanel_xmlapi.php file right? You might want to add a var_dump on the api call variable to see what its actually returning. I did yes, the var_dump() just output: object(SimpleXMLElement)[3] However I do believe it is something to do with my WHM account, and not the script itself as even WHMCS cannot create new accounts apparently. I'll let you know what happens 0 Quote Link to comment Share on other sites More sharing options...
bear Posted February 26, 2012 Share Posted February 26, 2012 Its showing the assigments to "their" account (rather than for their whole reseller a/c) In my case that doesn't seem to be what it's doing. No reseller has those specs and usage. They definitely have an account on the server they're installed on, and it uses space and bandwidth, just no stats are shown about it. Maybe just how mine is set up... 0 Quote Link to comment Share on other sites More sharing options...
othellotech Posted February 27, 2012 Share Posted February 27, 2012 It also depends on who "owns" their account (root, reseller, a-n-other-user) - the way we have it setup is that WHMCS by default shows the resellers own account, and then we cron overwriting that with the right values for the "whole" reseller 0 Quote Link to comment Share on other sites More sharing options...
bear Posted February 27, 2012 Share Posted February 27, 2012 It also depends on who "owns" their account (root, reseller, a-n-other-user) - the way we have it setup is that WHMCS by default shows the resellers own account, and then we cron overwriting that with the right values for the "whole" reseller They do own their own, and it shows as above. I'd be interested in learning how you're getting it to show the reseller values via cron. 0 Quote Link to comment Share on other sites More sharing options...
MarkEliasen Posted February 28, 2012 Author Share Posted February 28, 2012 The reason it didn't work for me was because I am not allowed to use that API with my current host, oh well . I will be moving to my own dedicated hopefully soon, so that should take care of things (though then it obviously wouldn't be useful for me to use that call... oh well) Thanks 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted February 28, 2012 Share Posted February 28, 2012 The reason it didn't work for me was because I am not allowed to use that API with my current host, oh well . I will be moving to my own dedicated hopefully soon, so that should take care of things (though then it obviously wouldn't be useful for me to use that call... oh well) Thanks Well that would certainly explain things. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.