jack10k Posted February 27, 2008 Share Posted February 27, 2008 not that key ok, let's try this again. Find all <strong>OK and replace with <strong><font color=\"#00FF00\">OK 0 Quote Link to comment Share on other sites More sharing options...
Roger Posted February 27, 2008 Share Posted February 27, 2008 Ok i have a fix for you guys who are having problems with the "NOT OK" ok the script he wrote reads from the server name from within whmcs most likely you dont have the server name to the actually host name for example you might have it set as "Server 1" to make the script work you have to make the name of the server config in whmcs the quailified domain name for instance: "server1.domain.net" That's it. I did this: around line 23 change: $servername = $row2['name']; to $servername = $hosteddomain; Seems to work. Thanks gasmoney ... 0 Quote Link to comment Share on other sites More sharing options...
gasmoney Posted March 1, 2008 Share Posted March 1, 2008 That's it. I did this: around line 23 change: $servername = $row2['name']; to $servername = $hosteddomain; Seems to work. Thanks gasmoney ... No problem .. Also the way you put the code it actually uses the domain of the user logged in so my adivce would be to use the servers ip address which can be called like this. $servername = $row2['name']; to $servername = $row2['ipaddress']; This will actually check the whole server in general instead of putting the customers hosted domain in the field 0 Quote Link to comment Share on other sites More sharing options...
Roger Posted March 2, 2008 Share Posted March 2, 2008 Thanks bud... 0 Quote Link to comment Share on other sites More sharing options...
Unspecific Posted March 3, 2008 Share Posted March 3, 2008 it partly works, methinks this needs recoding 0 Quote Link to comment Share on other sites More sharing options...
gasmoney Posted March 3, 2008 Share Posted March 3, 2008 I will recode if he gives me permission and also you guys tell me what you think should be improved , etc. 0 Quote Link to comment Share on other sites More sharing options...
arteryplanet Posted March 3, 2008 Author Share Posted March 3, 2008 Hi gasmoney, sure go ahead you have permission. Sorry guys but im not an expert in php. Something to keep in mind gasmoney is the code do not work when is a dedi server plan, will be great if you could get the mysql query to check this first and then find a way to add the dedi server hostname instead the shared server hostname, i wasnt able to do this because the dedi servers info is in another table and not in the same as the shared hosting one. Thanx! 0 Quote Link to comment Share on other sites More sharing options...
gasmoney Posted March 3, 2008 Share Posted March 3, 2008 Ok yea ill probably add dedicated support and a option in the admin panel to add extra ports that you want to monitor. Any other ideas? Make it dynamic 0 Quote Link to comment Share on other sites More sharing options...
Unspecific Posted March 3, 2008 Share Posted March 3, 2008 Ok yea ill probably add dedicated support and a option in the admin panel to add extra ports that you want to monitor. Any other ideas? Make it dynamic Hey. PM me your MSN or something. I'll help too. 0 Quote Link to comment Share on other sites More sharing options...
Roger Posted March 3, 2008 Share Posted March 3, 2008 Ok yea ill probably add dedicated support and a option in the admin panel to add extra ports that you want to monitor. Any other ideas? Make it dynamic Minor, but maybe separate the the single column "(<domain-name>) - serverIP" into two columns. 0 Quote Link to comment Share on other sites More sharing options...
ganesh.rao Posted March 5, 2008 Share Posted March 5, 2008 Add an IF statement and then see if you can find the dedicated server's IP, else print the shared hosting's monitor. 0 Quote Link to comment Share on other sites More sharing options...
arteryplanet Posted March 6, 2008 Author Share Posted March 6, 2008 Add an IF statement and then see if you can find the dedicated server's IP, else print the shared hosting's monitor. Is not that simple, dedicated servers information is not in the same table than the shared one. Anyway, i guess with a good php/mysql knowledge that is not a problem. 0 Quote Link to comment Share on other sites More sharing options...
eekdood Posted March 10, 2008 Share Posted March 10, 2008 I'd like to get in on this. I am fairly proficient with PHP/MySQL and have a need for this script. Does anyone have an update on it? Thanks, Eric 0 Quote Link to comment Share on other sites More sharing options...
Berenguer IV Posted March 19, 2008 Share Posted March 19, 2008 I Like this. Portal Templates Folder/serverstatus.tpl See attached image. {if $loggedin} <table class="clientareatable" align="center" cellspacing="1"> <tr class="clientareatableheading"> <td>{$LANG.servername}</td> <td>HTTP</td> <td>FTP</td> <td>POP3</td> <td><div align="center">WEBMAIL</div></td> <td>SMTP</td> <td><div align="center">DNS</div></td> <td><div align="center">cPanel</div></td> <td><div align="center">{$LANG.serverstatusuptime}</div></td> </tr> {foreach key=num item=server from=$servers} <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><div align="center">{get_port_status num="$num" port="2095"}</div></td> <td>{get_port_status num="$num" port="25"}</td> <td><div align="center">{get_port_status num="$num" port="53"}</div></td> <td><div align="center">{get_port_status num="$num" port="2083"}</div></td> <td><div align="center">{$server.uptime}</div></td> </tr> {foreachelse} <tr class="clientareatableactive"> <td colspan="9">{$LANG.serverstatusnoservers}</td> </tr> {/foreach} </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} 0 Quote Link to comment Share on other sites More sharing options...
swg Posted March 19, 2008 Share Posted March 19, 2008 Berenguer IV, Very Nice!! 0 Quote Link to comment Share on other sites More sharing options...
columbusgeek Posted March 21, 2008 Share Posted March 21, 2008 Yeah cool modification. Uptime fails for me, but I assume that is a Hostgator security issue. 0 Quote Link to comment Share on other sites More sharing options...
s1rk3ls Posted March 22, 2008 Share Posted March 22, 2008 I like it! There were a few things I wanted done differently, namely a single call to each server to check status as opposed to multiple if the customer had more than one domain on a single server. I also have some services which I do not track the status of ... I could make another slight change to just exclude them from the status listing - but then, customers may wonder why that domain is missing. Anywho, here's my slightly modified version... The only thing different since this screenshot is the list is now sorted alphabetically by server name (so Server 1, Server 2, etc. instead of Server 5, Server 3...) {if $loggedin} <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} 0 Quote Link to comment Share on other sites More sharing options...
tsiedsma Posted March 26, 2008 Share Posted March 26, 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. {if $loggedin} <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} <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> {foreachelse} <tr class="clientareatableactive"> <td colspan="7">{$LANG.serverstatusnoservers}</td> </tr> {/foreach} </table> <p>The table below shows the status of your domains and which server they are hosted on.</p> <table class="clientareatable" align="center" cellspacing="1"> <tr class="clientareatableheading"> <td>{$LANG.servername}</td> <td>HTTP</td> <td>HTTPS</td> <td>FTP</td> <td>POP3</td> <td>SMTP</td> <td>IMAP</td> </tr> <tr> {php} //echo "<pre>"; //print_r($_SESSION); //echo "</pre>"; $query = "SELECT * FROM tblhosting WHERE userid='".$_SESSION["uid"]."' AND domainstatus='Active'"; $result = mysql_query($query); while ($row = mysql_fetch_array($result)) { // echo "<pre>"; // print_r($row); // echo "</pre>"; $activeserver = $row['server']; $hosteddomain = $row['domain']; $query2 = "SELECT * FROM tblservers WHERE id='".$activeserver."'"; $result2 = mysql_query($query2); $row2 = mysql_fetch_array($result2); // echo "<pre>"; // print_r($row2); // echo "</pre>"; //HTTP $fp = fsockopen($row['domain'],80,$errno,$errstr,10); if(!$fp) { echo '<tr class="clientareatableactive">'; echo "<td>( " .$row['domain']. " ) - " .$row2['name']."</td>"; echo "<td><img src=\"images/status/ball_red.gif\"></td>"; }else{ echo "<tr class=\"clientareatableactive\">"; echo "<td>( " .$row['domain']. " ) - " .$row2['name']."</td>"; echo "<td><img src=\"images/status/ball_green.gif\"></td>"; fclose($fp); } //SSL $fp = fsockopen('ssl://'.$row['domain'],443,$errno,$errstr,10); if(!$fp) { echo "<td><img src=\"images/status/ball_red.gif\"></td>"; }else{ echo "<td><img src=\"images/status/ball_green.gif\"></td>"; fclose($fp); } //FTP $fp = fsockopen($row['domain'],21,$errno,$errstr,10); if(!$fp) { echo "<td><img src=\"images/status/ball_red.gif\"></td>"; }else{ echo "<td><img src=\"images/status/ball_green.gif\"></td>"; fclose($fp); } //POP3 $fp = fsockopen($row['domain'],110,$errno,$errstr,10); if(!$fp) { echo "<td><img src=\"images/status/ball_red.gif\"></td>"; }else{ echo "<td><img src=\"images/status/ball_green.gif\"></td>"; fclose($fp); } //SMTP $fp = fsockopen($row['domain'],25,$errno,$errstr,10); if(!$fp) { echo "<td><img src=\"images/status/ball_red.gif\"></td>"; }else{ echo "<td><img src=\"images/status/ball_green.gif\"></td>"; fclose($fp); } //IMAP $fp = fsockopen($row['domain'],143,$errno,$errstr,10); if(!$fp) { echo "<td><img src=\"images/status/ball_red.gif\"></td>"; }else{ echo "<td><img src=\"images/status/ball_green.gif\"></td>"; fclose($fp); } } {/php} </tr> </table> {else} <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} <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> {foreachelse} <tr class="clientareatableactive"> <td colspan="7">{$LANG.serverstatusnoservers}</td> </tr> {/foreach} </table> <p>You must login to view detailed Server Statistics! These login details differ from your websites control panel username and password. </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} Preview Not Logged In: Preview Logged In: 0 Quote Link to comment Share on other sites More sharing options...
columbusgeek Posted March 26, 2008 Share Posted March 26, 2008 I wanna be a baller and have 13 servers. 0 Quote Link to comment Share on other sites More sharing options...
tsiedsma Posted March 26, 2008 Share Posted March 26, 2008 I wanna be a baller and have 13 servers. hahaha. That is a list of domains. Sadly I only have the one server for now. One thing to note is that it will show all of your servers in the top table and then list the domains and what server they are on in the second table. Obviously it is user based. 0 Quote Link to comment Share on other sites More sharing options...
sky2k4 Posted March 27, 2008 Share Posted March 27, 2008 Very nice.. every one, we still couldn't get the server status to show and the uptime, if anyone has this for a dedicated server please pm us, Thanks.. 0 Quote Link to comment Share on other sites More sharing options...
handsonwebhosting Posted March 28, 2008 Share Posted March 28, 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? 0 Quote Link to comment Share on other sites More sharing options...
arteryplanet Posted March 29, 2008 Author Share Posted March 29, 2008 great modification handsonwebhosting, alot better than my original one, i have modified it anyway to my needs and is working great, thank you! 0 Quote Link to comment Share on other sites More sharing options...
arteryplanet Posted March 29, 2008 Author Share Posted March 29, 2008 handsonwebhosting will be great if you add what s1rk3ls did above, show as many as domains/accounts the user have on each server instead to show different fields for the same server with different domains if the client have more than 1 account in the same server. Thanx! 0 Quote Link to comment Share on other sites More sharing options...
handsonwebhosting Posted March 30, 2008 Share Posted March 30, 2008 Just to clarify Arteryplanet - I think this was supposed to be addressed to "tsiedsma". Personally, I've not made any modifications to the code and posted them here - mine was just a thought process on the expandability, so the credit goes to the other programmers that have posted here thus far. All postings have been great improvements, and I look forward to seeing more! 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.