Svann Posted April 3, 2008 Share Posted April 3, 2008 I know I had troubles getting this to work on mine. I went ahead and modified it to my needs. It shows the standard Server Stats along with a login form. If you are logged in, it shows you standard stats plus detailed stats for each domain. this one working verry good for me rest of version not working thanks dude. 0 Quote Link to comment Share on other sites More sharing options...
SilverNodashi Posted April 3, 2008 Share Posted April 3, 2008 hi guys, not sure why is showing not ok for you, is working for me and for "cyberneticos" too as far as i can see. Make sure you do not have something blocking in your firewall or you have disabled fsockopen in your php.ini. So it needs fsockopen enabled in php.ini to work? This is one mod i wont be doing, i love the server status link, makes sense so that potential customers can see how things are running on you server, plus they can see your uptime True, the uptime could be a problem, and also the server load. But then again, only those who really want to know will take notice. Just to clarify, when the user is not logged in, this is showing the server status on all servers. We currently have just over 120 servers in operation, so we don't display status of ALL servers to ALL users, and only want to display the individual servers for whatever an account may be hosted on. Any thoughts? I'd like to have this option as well. Does anyone know how todo it? Probably a simple if / while script looping through the accounts, getting the server FQDN where the account is located, and then display that server's IP. But I think this may cause a problem on a DB with a few thousand clients? 0 Quote Link to comment Share on other sites More sharing options...
arteryplanet Posted April 5, 2008 Author Share Posted April 5, 2008 Just to clarify, when the user is not logged in, this is showing the server status on all servers. We currently have just over 120 servers in operation, so we don't display status of ALL servers to ALL users, and only want to display the individual servers for whatever an account may be hosted on. Any thoughts? Just remove the part of the code that show the status when you are not logged in, the rest of the code will take care to show the server where the logged in client have hosting accounts. 0 Quote Link to comment Share on other sites More sharing options...
shed Posted April 8, 2008 Share Posted April 8, 2008 Bit of a tangent... has anyone developed a server status that displays historical uptime as a percentage. e.g. Server Uptime March: 99.98% April: 100% or something similar? 0 Quote Link to comment Share on other sites More sharing options...
JasonO Posted April 8, 2008 Share Posted April 8, 2008 You could do this with a database, a simple script to grab the data out of the status folder and with a cron job. When it's the last day of the month, calculate each day of the month as an average and save it for that month. 0 Quote Link to comment Share on other sites More sharing options...
SilverNodashi Posted April 9, 2008 Share Posted April 9, 2008 wouldn't it be better to use munin or MRTG for this kind of thing then? 0 Quote Link to comment Share on other sites More sharing options...
shed Posted April 22, 2008 Share Posted April 22, 2008 Anyone know how this might be achieved? 0 Quote Link to comment Share on other sites More sharing options...
djgimx Posted April 29, 2008 Share Posted April 29, 2008 Thx a mil mate tip top . Hope to see more from you 0 Quote Link to comment Share on other sites More sharing options...
carlsilver Posted October 4, 2008 Share Posted October 4, 2008 Perfect, many thanks 0 Quote Link to comment Share on other sites More sharing options...
carlsilver Posted October 4, 2008 Share Posted October 4, 2008 (edited) I know I had troubles getting this to work on mine. I went ahead and modified it to my needs. It shows the standard Server Stats along with a login form. If you are logged in, it shows you standard stats plus detailed stats for each domain. This is brilliant - tweaked it a little to remove the PHP info for none-logged in users and added cPanel and Webmail status for logged in users I REALLY wanna have the server and domain's in different colums, but i just cant get it working - never the less, Great share, many thanks Here's how mine finished up: me need more servers now :twisted: Edited October 4, 2008 by carlsilver 0 Quote Link to comment Share on other sites More sharing options...
Inetbiz Posted December 5, 2008 Share Posted December 5, 2008 (edited) Ok I am stuck. This is what I edited for /go/status/index.php <?PHP define("CLIENTAREA",true); require("../dbconnect.php"); require("../includes/functions.php"); $pagetitle = $_LANG['clientareatitle']; $pageicon = "../images/support/clientarea.gif"; $breadcrumbnav = '<a href="index.php">'.$_LANG['globalsystemname'].'</a> > | <a href="serverstatus.php">Status Page</a>'; require("../init.php"); if ($_SESSION['uid']) { <table class="clientareatable" align="center" cellspacing="1"> <tr class="clientareatableheading"> <td>{$LANG.servername}</td> <td>Hosting</td> <td>HTTP</td> <td>FTP</td> <td>POP3</td> <td>SMTP</td> </tr> <tr> {php} $query1 = "SELECT * FROM tblservers ORDER BY name"; $result1 = mysql_query($query1); while ($row1 = mysql_fetch_array($result1)) { $serverid = $row1['id']; $servername = $row1['name']; $host = $row1['ipaddress']; $hosteddomains=""; $query2 = "SELECT * FROM tblhosting WHERE userid='".$_SESSION["uid"]."' AND domainstatus='Active' AND server='".$serverid."'"; $result2 = mysql_query($query2); while ($row2 = mysql_fetch_array($result2)) { $hosteddomain = $row2['domain']; $hosteddomains.=$hosteddomain."<br>"; } if ($hosteddomains) { $hosteddomains=substr($hosteddomains,0,-4); if ($host) { //HTTP $port = 80; $fp = fsockopen($host,$port,$errno,$errstr,10); if(!$fp) { echo "<tr class=\"clientareatableactive\">"; echo "<td><b>".$servername."</b> [".$host."]</td>"; echo "<td>" .$hosteddomains."</td>"; echo "<td rowspan=\"2\"><strong><font color=\"#FF0000\">Not OK</font></strong></td>"; } else{ echo "<tr class=\"clientareatableactive\">"; echo "<td>".$servername." [".$host."]</td>"; echo "<td>" .$hosteddomains."</td>"; echo "<td rowspan=\"2\"><strong>OK</strong></td>"; fclose($fp); } //FTP $port = 21; $fp = fsockopen($host,$port,$errno,$errstr,10); if(!$fp) { echo "<td rowspan=\"2\"><strong><font color=\"#FF0000\">Not OK</font></strong></td>"; }else{ echo "<td rowspan=\"2\"><strong>OK</strong></td>"; fclose($fp); } //POP3 $port = 110; $fp = fsockopen($host,$port,$errno,$errstr,10); if(!$fp) { echo "<td rowspan=\"2\"><strong><font color=\"#FF0000\">Not OK</font></strong></td>"; }else{ echo "<td rowspan=\"2\"><strong>OK</strong></td>"; fclose($fp); } //SMTP $port = 25; $fp = fsockopen($host,$port,$errno,$errstr,10); if(!$fp) { echo "<td rowspan=\"2\"><strong><font color=\"#FF0000\">Not OK</font></strong></td><tr>"; }else{ echo "<td rowspan=\"2\"><strong>OK</strong></td></tr>"; fclose($fp); } $this->assign('serverid',$serverid); $this->assign('servername',$servername); echo "<tr class=\"clientareatablepending\">"; echo "<td colspan=\"2\">"; {/php} {foreach key=num item=server from=$servers} {if $server.name == $servername} <b>Uptime:</b> {$server.uptime} - <b>Load Average:</b> {$server.serverload}<br> {/if} {/foreach} {php} echo "</td></tr>"; } else { echo "<tr class=\"clientareatableactive\">"; echo "<td>".$servername."</td>"; echo "<td>" .$hosteddomains."</td>"; echo "<td colspan=\"5\"><strong><font color=\"#AAAAAA\">Not Monitored Here</font></strong></td>"; }}} {/php} </table> {else} <p>{$LANG.loginintrotext}</p> <form action="../dologin.php?goto=serverstatus" method="post"> <table align="center"> <tr><td align="right">{$LANG.loginemail}:</td><td><input type="text" name="username" size="40" value="{$username}"></td></tr> <tr><td align="right">{$LANG.loginpassword}:</td><td><input type="password" name="password" size="25" value="{$password}"></td></tr> </table> <p align="center"><input type="submit" value="{$LANG.loginbutton}"><br><input type="checkbox" name="rememberme"{$rememberme}> {$LANG.loginrememberme}</p> </form> <p><b>{$LANG.loginforgotten}</B> <a href="passwordreminder.php">{$LANG.loginforgotteninstructions}</a>.</p> {/if} } # Define the template filename to be used without the .tpl extension $templatefile = "serverstatus"; # To assign variables in Smarty use the following syntax. This can then be used as {$variablename} in the template // $smartyvalues["variablename"] = $value; require("../display.php"); ?> Now what do I put in the template file? Edited December 5, 2008 by Inetbiz 0 Quote Link to comment Share on other sites More sharing options...
wiszmaster Posted December 31, 2008 Share Posted December 31, 2008 Works in the latest 3.8.1 ! 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.