arteryplanet Posted December 10, 2007 Share Posted December 10, 2007 Hi guys, The server status in whmcs wasnt working for me as i wish show the server status only when the client is logged in and also i wanted show only the servers if the client have any Active hosted domain in that server and also show which of the clients domain is hosted in which server. So just replace the serverstatus.tpl with the code below. Enjoy!! {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>SMTP</td> </tr> <tr> {php} $query = "SELECT * FROM tblhosting WHERE userid='".$_SESSION["uid"]."' AND domainstatus='Active'"; $result = mysql_query($query); while ($row = mysql_fetch_array($result)) { $activeserver = $row['server']; $hosteddomain = $row['domain']; $query2 = "SELECT * FROM tblservers WHERE id='".$activeserver."'"; $result2 = mysql_query($query2); $row2 = mysql_fetch_array($result2); $servername = $row2['name']; //HTTP $site = $servername; $port = 80; $fp = fsockopen($site,$port,$errno,$errstr,10); if(!$fp) { echo "<tr class=\"clientareatableactive\">"; echo "<td>( " .$hosteddomain. " ) - " .$servername."</td>"; echo "<td><strong><font color=\"#FF0000\">Not OK</font></strong></td>"; } else{ echo "<tr class=\"clientareatableactive\">"; echo "<td>( " .$hosteddomain. " ) - " .$servername."</td>"; echo "<td><strong>OK</strong></td>"; fclose($fp); } //FTP $port = 21; $fp = fsockopen($site,$port,$errno,$errstr,10); if(!$fp) { echo "<td><strong><font color=\"#FF0000\">Not OK</font></strong></td>"; } else{ echo "<td><strong>OK</strong></td>"; fclose($fp); } //POP3 $port = 110; $fp = fsockopen($site,$port,$errno,$errstr,10); if(!$fp) { echo "<td><strong><font color=\"#FF0000\">Not OK</font></strong></td>"; } else{ echo "<td><strong>OK</strong></td>"; fclose($fp); } //SMTP $port = 25; $fp = fsockopen($site,$port,$errno,$errstr,10); if(!$fp) { echo "<td><strong><font color=\"#FF0000\">Not OK</font></strong></td>"; } else{ echo "<td><strong>OK</strong></td>"; fclose($fp); } } {/php} </tr> </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...
cyberneticos Posted December 23, 2007 Share Posted December 23, 2007 Excellent ! Thanks for this contrib. It makes no sense to allow anyone to view anything other than what they are supposed to. Also a security risk. Cheers 0 Quote Link to comment Share on other sites More sharing options...
arteryplanet Posted December 23, 2007 Author Share Posted December 23, 2007 You are welcome! 0 Quote Link to comment Share on other sites More sharing options...
Daniel Posted December 23, 2007 Share Posted December 23, 2007 I've just tried this and it is reporting all services on all servers as "Not OK". Any idea why? Thanks for the mod! 0 Quote Link to comment Share on other sites More sharing options...
arteryplanet Posted December 26, 2007 Author Share Posted December 26, 2007 are you using it to display dedicated server packages? do not work for dedicated servers, only shared and reseller hosting plans. 0 Quote Link to comment Share on other sites More sharing options...
Daniel Posted December 26, 2007 Share Posted December 26, 2007 Nope, shared hosting accounts. The default whmcs template works fine but the changes here don't. I swapped the code around to force it to say 'OK' but don't know if it will report an error when a service goes down. 0 Quote Link to comment Share on other sites More sharing options...
ddg8176 Posted December 30, 2007 Share Posted December 30, 2007 I tried it too and got "NOT OK". 0 Quote Link to comment Share on other sites More sharing options...
5wayshost Posted January 4, 2008 Share Posted January 4, 2008 any fix yet on this 0 Quote Link to comment Share on other sites More sharing options...
arteryplanet Posted January 6, 2008 Author Share Posted January 6, 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. 0 Quote Link to comment Share on other sites More sharing options...
swannie@hotpepper.co.za Posted January 8, 2008 Share Posted January 8, 2008 I have done that but get the following error: HTTP FTP POP3 SMTP Not OK Not OK Not OK Not OK Please assist? 0 Quote Link to comment Share on other sites More sharing options...
arteryplanet Posted January 8, 2008 Author Share Posted January 8, 2008 is showing your server hostname and the hosted domain in the left side? Contact me through PM Please note i have not tested it in the V 3.5 so im not sure if it works on this version, i have tested it on 3.4.1 only Thanx! 0 Quote Link to comment Share on other sites More sharing options...
cyberneticos Posted January 9, 2008 Share Posted January 9, 2008 I'm getting the same thing. Got 3.5.1 0 Quote Link to comment Share on other sites More sharing options...
railto Posted January 9, 2008 Share Posted January 9, 2008 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 0 Quote Link to comment Share on other sites More sharing options...
arteryplanet Posted January 12, 2008 Author Share Posted January 12, 2008 Ill check it out once i got 3.5.1 installed and let you know guys. Outhost: if you have 50 servers no make sense show to a client that have one hosting account with you the 50 servers status, most probably you will confuse him. just my 2 cents. Thanx! 0 Quote Link to comment Share on other sites More sharing options...
Miron Posted January 15, 2008 Share Posted January 15, 2008 Hi, Script is great, it's working fine for me (v3.5.1). But will be better if you can add server load and uptime. 0 Quote Link to comment Share on other sites More sharing options...
5wayshost Posted February 25, 2008 Share Posted February 25, 2008 hi there, Will this work for the latest whmcs version 3.6.0??? 0 Quote Link to comment Share on other sites More sharing options...
Roger Posted February 25, 2008 Share Posted February 25, 2008 Hey guys... ver 3.6.1 here. Same Not OK problem. 0 Quote Link to comment Share on other sites More sharing options...
PPH Posted February 25, 2008 Share Posted February 25, 2008 Hey guys... ver 3.6.1 here. Same Not OK problem. 3.6.1? A pre release testing? 0 Quote Link to comment Share on other sites More sharing options...
railto Posted February 25, 2008 Share Posted February 25, 2008 3.6.1? A pre release testing? was thinking same myself, maybe he means 3.5.1, who knows 0 Quote Link to comment Share on other sites More sharing options...
PPH Posted February 25, 2008 Share Posted February 25, 2008 Yep, unless maybe he is testing for Matt, which I guess is possible. 0 Quote Link to comment Share on other sites More sharing options...
Jordan Posted February 25, 2008 Share Posted February 25, 2008 3.6.1? A pre release testing? I think he means 3.6, and he's saying that he's still receiving the "Not Ok" messages when using this customized server status template. See: http://forum.whmcs.com/showpost.php?p=42445&postcount=11 0 Quote Link to comment Share on other sites More sharing options...
Roger Posted February 25, 2008 Share Posted February 25, 2008 3.6.1? A pre release testing? Sorry, 3.6.0 .... 0 Quote Link to comment Share on other sites More sharing options...
PPH Posted February 25, 2008 Share Posted February 25, 2008 Sorry, 3.6.0 .... I was quite puzzled. Nice to know this mod is giving problems with the latest release. 0 Quote Link to comment Share on other sites More sharing options...
Shimmy Posted February 25, 2008 Share Posted February 25, 2008 It's a great concept...but I just tried this with 3.6 and got the same not ok message. 0 Quote Link to comment Share on other sites More sharing options...
gasmoney 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" 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.