keliix06 Posted January 6, 2009 Share Posted January 6, 2009 We only wanted to show servers that users had an active or suspended account on on the server status page, so I whipped together this code. This is just the 3.8.1 serverstatus.tpl file with a couple of changes <p>{$LANG.serverstatusheadingtext}</p> <table class="clientareatable" align="center" cellspacing="1"> <tr class="clientareatableheading"> <td>{$LANG.servername}</td> <td>HTTP</td> <td>FTP</td> <td>POP3</td> <td>{$LANG.serverstatusphpinfo}</td> <td>{$LANG.serverstatusserverload}</td> <td>{$LANG.serverstatusuptime}</td> </tr> {foreach key=num item=server from=$servers} {php} $query = ''; $server = $this->get_template_vars('server'); $servername = $server['name']; $serverip = $server['ipaddress']; $query = "SELECT s.* FROM tblservers AS s LEFT JOIN tblhosting AS h ON h.server=s.id WHERE h.userid = ".$_SESSION['uid']." AND (h.domainstatus = 'Active' OR h.domainstatus = 'Suspended') AND s.name = '$servername'"; $result = mysql_query($query); if(mysql_num_rows($result) > 0){ {/php} <tr class="clientareatableactive"> <td>{$server.name}</td> <td>{get_port_status num="$num" port="80"}</td> <td>{get_port_status num="$num" port="21"}</td> <td>{get_port_status num="$num" port="110"}</td> <td><a href="{$server.phpinfourl}" target="_blank">{$LANG.serverstatusphpinfo}</a></td> <td>{$server.serverload}</td> <td>{$server.uptime}</td> </tr> {php}}{/php} {foreachelse} <tr class="clientareatableactive"> <td colspan="7">{$LANG.serverstatusnoservers}</td> </tr> {/foreach} </table> All I added was the stuff in the {php} tags. We also removed the phpinfo link and changed the intro text a bit so people didn't think that the one server they could see was "our servers". 0 Quote Link to comment Share on other sites More sharing options...
mcraedesigns Posted January 7, 2009 Share Posted January 7, 2009 (edited) nice, works great! Edited January 7, 2009 by mcraedesigns 0 Quote Link to comment Share on other sites More sharing options...
keliix06 Posted January 8, 2009 Author Share Posted January 8, 2009 Ok, I wasn't happy with these improvements, so I've rewritten basically everything. This is ony compatible with PHP5 as I used SimpleXML. The attachment contains a new status/index.php file which outputs the load/uptime/etc as valid xml. The new serverstatus.php uses SimpleXML to grab/parse the data. It checks only for servers that the logged in user has active/suspended accounts on, grabs the status data for those and outputs it. This only works with users who are logged in. The new serverstatus.tpl does not have the phpinfo link as we don't use that, so if you do just add it back in. This is probably the last update I'll make, and it's somewhat customized for what we needed it to do, but it should work with anyone's setup. status.zip 0 Quote Link to comment Share on other sites More sharing options...
cobrastrike Posted January 28, 2009 Share Posted January 28, 2009 Could anyone provide a screenshot of what this modification does? 0 Quote Link to comment Share on other sites More sharing options...
romes Posted January 30, 2009 Share Posted January 30, 2009 A screenshot would be nice as well. 0 Quote Link to comment Share on other sites More sharing options...
keliix06 Posted January 30, 2009 Author Share Posted January 30, 2009 It looks identical to the WHMCS status. But it only shows servers for logged in users and only those that users have an account on. 0 Quote Link to comment Share on other sites More sharing options...
N1CK3RS0N Posted February 4, 2009 Share Posted February 4, 2009 Do you know if Uptime % is possible on this page? 0 Quote Link to comment Share on other sites More sharing options...
flip Posted March 4, 2009 Share Posted March 4, 2009 I just wrote a rather detailed submission and was logged out... When logging back in, everything I'd typed dissapeared.... Well.. Here goes again.... ------------------- How plausible would it be to write something like this..(see below)..? I already have written this, but is in a seperate PHP file, (well 3 PHP files in total). Perhaps a 'simple' and 'detailed' button could be used.... 1.Potential Customer, i.e. has no service (not logged in). Wanting to see server specifications of 1 or more servers, would see these stats: - Server Name - Server Location - Server IP - Server's network / datacenter - Server Services Stats - 1 Tick (simple view -- The tick could be either: Green / Orange / Red (Green 0 problems. Orange 1-2 problems. Red 3+ problems) - Server Specifications (CPU Type, Speed, Cache etc, Manufacturer (dell etc..) -- might need to be manually entered for those without access to STAT path... etc.) - Server Spec's: -- HDD Storage Size (total GB) -- HDD Storage Use (percentage) -- Memory Size (total GB) -- Memory Use (percentage) - Server uptime (Days, Hours, Minutes (optional seconds)) 2. Customer who already has a service and is logged in, would see info in more detail, and also more private info. - Servers Name (DNS and Nickname) - Server I.P. Address (public shared / private) - Servers Location (Datacenter + City / State / Country) - Servers Network Provider / Backbone etc.... - Server Stats - Several Ticks (or Crosses) with different colours against the service... -- Show which services are up/down. (PHP, MySQL, FTP, POP3, SMTP, IMAP?, SSH, DNS, HTTP, HTTPS) -- Indicate by colour too, i.e. Green, Orange and Red or just Green and Red. - Server Specifications (CPU Type, Speed, Cache, http app, e.g. cgi... etc, Manufacturer (dell etc..) - might need to be manually entered for those without access to STAT path... etc.) - Server Spec's: -- HDD Storage Size (total GB) -- HDD Storage Use (percentage + GB) -- Memory Size (total GB) -- Memory Use (percentage + GB) -- CPU Utilization (percentage) - Server uptime (Days, Hours, Minutes (optional seconds)) I already have the detailed view written, but have not had much success incorporating it into the current system, e.g. by using "INCLUDE ('file.php');" for example... Getting a little confused. I think something like this could really benefit everybody! Here's a screenshot of what i'm using currently. It simply refreshes ever 30 seconds to update the statistics. emma. (: 0 Quote Link to comment Share on other sites More sharing options...
jasonhk Posted March 4, 2009 Share Posted March 4, 2009 I just wrote a rather detailed submission and was logged out...When logging back in, everything I'd typed dissapeared.... Well.. Here goes again.... ------------------- How plausible would it be to write something like this..(see below)..? I already have written this, but is in a seperate PHP file, (well 3 PHP files in total). Perhaps a 'simple' and 'detailed' button could be used.... 1.Potential Customer, i.e. has no service (not logged in). Wanting to see server specifications of 1 or more servers, would see these stats: - Server Name - Server Location - Server IP - Server's network / datacenter - Server Services Stats - 1 Tick (simple view -- The tick could be either: Green / Orange / Red (Green 0 problems. Orange 1-2 problems. Red 3+ problems) - Server Specifications (CPU Type, Speed, Cache etc, Manufacturer (dell etc..) -- might need to be manually entered for those without access to STAT path... etc.) - Server Spec's: -- HDD Storage Size (total GB) -- HDD Storage Use (percentage) -- Memory Size (total GB) -- Memory Use (percentage) - Server uptime (Days, Hours, Minutes (optional seconds)) 2. Customer who already has a service and is logged in, would see info in more detail, and also more private info. - Servers Name (DNS and Nickname) - Server I.P. Address (public shared / private) - Servers Location (Datacenter + City / State / Country) - Servers Network Provider / Backbone etc.... - Server Stats - Several Ticks (or Crosses) with different colours against the service... -- Show which services are up/down. (PHP, MySQL, FTP, POP3, SMTP, IMAP?, SSH, DNS, HTTP, HTTPS) -- Indicate by colour too, i.e. Green, Orange and Red or just Green and Red. - Server Specifications (CPU Type, Speed, Cache, http app, e.g. cgi... etc, Manufacturer (dell etc..) - might need to be manually entered for those without access to STAT path... etc.) - Server Spec's: -- HDD Storage Size (total GB) -- HDD Storage Use (percentage + GB) -- Memory Size (total GB) -- Memory Use (percentage + GB) -- CPU Utilization (percentage) - Server uptime (Days, Hours, Minutes (optional seconds)) I already have the detailed view written, but have not had much success incorporating it into the current system, e.g. by using "INCLUDE ('file.php');" for example... Getting a little confused. I think something like this could really benefit everybody! Here's a screenshot of what i'm using currently. It simply refreshes ever 30 seconds to update the statistics. emma. (: Pretty cool, but where's the screenshot ? 0 Quote Link to comment Share on other sites More sharing options...
flip Posted March 4, 2009 Share Posted March 4, 2009 (edited) I was having all sorts of trouble with the site, where it would spit out an error code about line xxx of ____.php It was doing it for around 45 minutes with the login.php file only.... login.php?login... All fixed now by the look of it! edit: forgot to mention i have it set to a meta refresh every 30 seconds. e Edited March 4, 2009 by flip 0 Quote Link to comment Share on other sites More sharing options...
jasonhk Posted March 4, 2009 Share Posted March 4, 2009 Is that currently in WHMCS or your current script that you want to implement in WHMCS? 0 Quote Link to comment Share on other sites More sharing options...
flip Posted March 5, 2009 Share Posted March 5, 2009 implement into whmcs is the goal... I have just spent quite a bit of time trying to get it in... i'm not the 'best' coder but there were a few bugs, and then when i added doctype above the header, everything went hay-wire! LOL.... Everything is fine now. But this will be great once in! But also to add a simple / detailed view will be good. What does everyone think? 0 Quote Link to comment Share on other sites More sharing options...
jasonhk Posted March 5, 2009 Share Posted March 5, 2009 It seems like a good idea, remember that some clients have shared accounts spread over multiple servers. A simple view of services up and down on those servers is sufficient for checking of servers status. This additional information could be displayed when a user clicks on the server name.. 0 Quote Link to comment Share on other sites More sharing options...
wiszmaster Posted March 17, 2009 Share Posted March 17, 2009 I was having all sorts of trouble with the site, where it would spit out an error code about line xxx of ____.php It was doing it for around 45 minutes with the login.php file only.... login.php?login... All fixed now by the look of it! edit: forgot to mention i have it set to a meta refresh every 30 seconds. e I like the looks of your script. Are you planning on sharing what you already have? If so, I'd be interested in looking at it. Thanks, marco 0 Quote Link to comment Share on other sites More sharing options...
flip Posted March 24, 2009 Share Posted March 24, 2009 I'd be more than happy to share it and see it evolve. But first we need to find someone to migrate it over to WHMCS to work. I'm not much of a WHMCS expert, and am not familiar with the template files etc... Please let me know if we have some volunteers! REPLY: Yes, as i said above, if we had a simple view, then if you click more info, it could simply pop-up a new window with this info in it. As i currently have a meta refresh set to 30 seconds, so it automatically updates. That's entirely optional i guess, you can use the reload button.... Thanks again guys! (: em. 0 Quote Link to comment Share on other sites More sharing options...
flip Posted April 6, 2009 Share Posted April 6, 2009 (edited) Still no one interested in integrating this into WHMCS?? I.e. have the status page, and when you click on MORE perhaps, it would have either an AJAX or other pop-up, and display this degree of information. The current summary and info status's are a little.... breif. It would be great to be able to view detailed info if logged in, otherwise, simple stat's if just a guest or not logged in. (: EDIT: Will post the current changes i've made here soon. Lets see what other people's Server Status page looks like! Edited April 6, 2009 by flip 0 Quote Link to comment Share on other sites More sharing options...
redrat Posted April 7, 2009 Share Posted April 7, 2009 Impressive though this advanced spec seems, I would not like to see it implemented in WHMCS as a standard feature because there is way too much information included that I would just not like made public. 0 Quote Link to comment Share on other sites More sharing options...
flip Posted April 7, 2009 Share Posted April 7, 2009 But that's the point. You can remove what you wish, or add more as you please. Most users rarely log in to their Client Area, as very few have issues, or need invoices etc. It is simply a tool for "advanced" users to be able to monitor their account on a server. Even if you made it only available admin users. Easy enough to do, just create a new section and change the If loggedin=1 to If admin=1 etc... As i said earlier, you wouldn't make this info public, you make the current status screen public, then for clients/admins logged in, they could see more services with Ticks, and an option for each server they have to click MORE, pop-up a page, and view a single page with details stats. oh well... 0 Quote Link to comment Share on other sites More sharing options...
redrat Posted April 7, 2009 Share Posted April 7, 2009 Oh, I see flip. lol Thanks for correcting me. I did completely miss that point and can now see how useful this could be. Excellent in fact. 0 Quote Link to comment Share on other sites More sharing options...
moonsoft Posted April 7, 2009 Share Posted April 7, 2009 I would really like to see the information contained in Cpanel's server status screen ported into WHMCS, this would solve the problem i think because you already have access to this screen in webhost manager, and you can set the allow functions from there. It would list services as well, instead of just port numbers. I guess the only concern is to have a script in case that server is completely down to parse some downtime message since the data wouldn;t be available from cpanel. 0 Quote Link to comment Share on other sites More sharing options...
xandih Posted April 9, 2009 Share Posted April 9, 2009 Hello The change is working awesome in my domain, but with a client that have 20 servers to display, it tooks 90+ seconds to show the output. What can be done to take this faster? Thank you 0 Quote Link to comment Share on other sites More sharing options...
keliix06 Posted April 10, 2009 Author Share Posted April 10, 2009 Nothing. That was the original point of making this, so users don't have to load all of the servers, just ones they are on. 0 Quote Link to comment Share on other sites More sharing options...
moonsoft Posted April 16, 2009 Share Posted April 16, 2009 I am having a problem with this mod, i have some clients who have thier own servers but their server status page doesn't show anything what do i need to do to make this work? 0 Quote Link to comment Share on other sites More sharing options...
flip Posted April 16, 2009 Share Posted April 16, 2009 ?? Login to admin area Click settings Click servers Add your web hosting servers, details, ns's, and admin/pass or admin/key. SSL = yes/no Save. Is this what you meant? 0 Quote Link to comment Share on other sites More sharing options...
Strik Posted October 9, 2009 Share Posted October 9, 2009 Module from 3th post is not work correctly, see screenshot: http://gyazo.com/b9242b1c2cc3d90511460c6af8b78cc1.png Code from first post work great, thank you. 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.