wiszmaster Posted July 17, 2009 Share Posted July 17, 2009 good to know. I must be overlooking, or fat fingering something at this point. Been sitting in front of this screen for nearly 16 hours now ... time for a little rest. Will look this afternoon. fixed it .. not sure what the issue was, I ended up blowing the 'portal' serverstatus.tpl file away & copying the 'default' moded version of it. 0 Quote Link to comment Share on other sites More sharing options...
redrat Posted July 17, 2009 Author Share Posted July 17, 2009 lol Glad you got it working anyway. Best wishes. Enjoy! 0 Quote Link to comment Share on other sites More sharing options...
Keiro Posted July 30, 2009 Share Posted July 30, 2009 Okay, so I tried to make the server status wizardry work. So far... I've managed to get this to work. Unfortunately, however, I cannot get the server statuses to show... which is infuriating me. NOTE: This is purely alpha stage. I am nowhere near ready to offering hosting to potential customers, as I'd prefer to get stuff working BEFORE customers start complaining that things are broken and/or not working. Screenshot: http://i37.photobucket.com/albums/e72/LitomoSilver/screenshot.jpg 0 Quote Link to comment Share on other sites More sharing options...
redrat Posted July 30, 2009 Author Share Posted July 30, 2009 Firstly, please check that you have correctly configured your server in WHMCS Setup>Servers. There must be one that is set up as the default server. To do that, simply click on the server entry at which point it will be given an asterisk (*) to indicate that it is the default server. EG: "Yourservername*" Please try this initially and post back with the results. 0 Quote Link to comment Share on other sites More sharing options...
Keiro Posted July 30, 2009 Share Posted July 30, 2009 Firstly, please check that you have correctly configured your server in WHMCS Setup>Servers. There must be one that is set up as the default server. To do that, simply click on the server entry at which point it will be given an asterisk (*) to indicate that it is the default server. EG: "Yourservername*" Please try this initially and post back with the results. ... D'OH! It works immediately the moment I did that. Of course, I overlooked something stupid simple. =/ Thanks for that! 0 Quote Link to comment Share on other sites More sharing options...
redrat Posted July 30, 2009 Author Share Posted July 30, 2009 Good stuff. I'm glad you've got it working now. 0 Quote Link to comment Share on other sites More sharing options...
Keiro Posted July 30, 2009 Share Posted July 30, 2009 Just had a thought... If you're going to add multiple servers, how would you get them to show up on the status page? 0 Quote Link to comment Share on other sites More sharing options...
redrat Posted July 30, 2009 Author Share Posted July 30, 2009 Just had a thought... If you're going to add multiple servers, how would you get them to show up on the status page? They show up automatically as long as they are set up in WHMCS. Better still, only the servers that clients have active accounts on show up, not 'all' of your servers. Pretty handy for some smaller hosts. 0 Quote Link to comment Share on other sites More sharing options...
Keiro Posted August 23, 2009 Share Posted August 23, 2009 They show up automatically as long as they are set up in WHMCS. Better still, only the servers that clients have active accounts on show up, not 'all' of your servers. Pretty handy for some smaller hosts. Okay, so I added a test VM server hosting cPanel WHM. Now... I've got it to show correctly, however, why the WHM image shows as unavailable and why the SMTP image is broken, I've absolutely no clue. Here's a screenshot: How do I fix that? I've made sure that the /status/ is at the root of the server's setup. 0 Quote Link to comment Share on other sites More sharing options...
redrat Posted August 23, 2009 Author Share Posted August 23, 2009 (edited) The SMTP images code at line 117 approx should read as follows in /whmcs/templates/yourtemplate/serverstatus.tpl //SMTP$port = 25; $fp = fsockopen($host,$port,$errno,$errstr,10); if(!$fp) { echo "<td><img src=\"images/statusfailed.gif\"></td>"; }else{ echo "<td><img src=\"images/statusok.gif\"></td>"; fclose($fp); } $this->assign('serverid',$serverid); $this->assign('servername',$servername); That will fix the missing image. The WHM warning is a different issue and possibly beyond my ability to help you with. WHM is certainly showing as down and that is the key to fixing this. Have you set this server up correctly in WHMCS with the correct user name and password or access hash? Best wishes. Edited August 23, 2009 by redrat 0 Quote Link to comment Share on other sites More sharing options...
Keiro Posted August 23, 2009 Share Posted August 23, 2009 (edited) The SMTP images code at line 117 approx should read as follows in /whmcs/templates/yourtemplate/serverstatus.tplThat will fix the missing image. The WHM warning is a different issue and possibly beyond my ability to help you with. WHM is certainly showing as down and that is the key to fixing this. Have you set this server up correctly in WHMCS with the correct user name and password or access hash? Best wishes. The WHM is operating just fine. I'm not entirely sure as to why it shows as down... but it is up. I'll check the image code and see what's up. Edit: Sure enough, the code fix you provided works. Now it shows both WHM and SMTP as down... not entirely sure why yet. I'll check the ports. Edited August 23, 2009 by Keiro 0 Quote Link to comment Share on other sites More sharing options...
Keiro Posted August 24, 2009 Share Posted August 24, 2009 Ack, can't edit the post above. Oh well... it seems that the serverstatus.tpl file is correct. Now, how do I edit the tpl file so that it also checks for port 26 on the SMTP checking? 0 Quote Link to comment Share on other sites More sharing options...
redrat Posted August 24, 2009 Author Share Posted August 24, 2009 (edited) Oh well... it seems that the serverstatus.tpl file is correct. Now, how do I edit the tpl file so that it also checks for port 26 on the SMTP checking? Try overwriting your whole /whmcs/templates/yourtemplate/serverstatus.tpl code with this but note the port references and change if necessary. (See end of this post for the locations of the WHM and SMTP ports.){if $loggedin} <table width="100%" class="clientareatable" align="center" cellspacing="1"> <tr class="clientareatableheading"> <td>{$LANG.servername}</td> <td>Hosting</td> <td>HTTP</td> <td>WHM</td> <td>CPanel</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> </td>"; echo "<td>" .$hosteddomains."</td>"; echo "<td><img src=\"images/statusfailed.gif\"></td>"; } else{ echo "<tr class=\"clientareatableactive\">"; echo "<td>".$servername." </td>"; echo "<td>" .$hosteddomains."</td>"; echo "<td><img src=\"images/statusok.gif\"></td>"; fclose($fp); } //CPanel $port = 2082; $fp = fsockopen($host,$port,$errno,$errstr,10); if(!$fp) { echo "<td><img src=\"images/statusfailed.gif\"></td>"; }else{ echo "<td><img src=\"images/statusok.gif\"></td>"; fclose($fp); } //WHM $port = 2086; $fp = fsockopen($host,$port,$errno,$errstr,10); if(!$fp) { echo "<td><img src=\"images/statusfailed.gif\"></td>"; }else{ echo "<td><img src=\"images/statusok.gif\"></td>"; fclose($fp); } //FTP $port = 21; $fp = fsockopen($host,$port,$errno,$errstr,10); if(!$fp) { echo "<td><img src=\"images/statusfailed.gif\"></td>"; }else{ echo "<td><img src=\"images/statusok.gif\"></td>"; fclose($fp); } //POP3 $port = 110; $fp = fsockopen($host,$port,$errno,$errstr,10); if(!$fp) { echo "<td><img src=\"images/statusfailed.gif\"></td>"; }else{ echo "<td><img src=\"images/statusok.gif\"></td>"; fclose($fp); } //SMTP [size=3]$port = 25;[/size] $fp = fsockopen($host,$port,$errno,$errstr,10); if(!$fp) { echo "<td><img src=\"images/statusfailed.gif\"></td>"; }else{ echo "<td><img src=\"images/statusok.gif\"></td>"; fclose($fp); } $this->assign('serverid',$serverid); $this->assign('servername',$servername); {/php} {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} Note that this code uses port 25 for SMTP. See line 118. WHM uses port 2086. See line 73. Check with your provider for the correct ports to use. When you have set your ports correctly, find /whmcs/templates_c and delete the entire contents. It's just a cache. You should also delete your browser cache. Best wishes. Edited August 24, 2009 by redrat 0 Quote Link to comment Share on other sites More sharing options...
Keiro Posted August 25, 2009 Share Posted August 25, 2009 Try overwriting your whole /whmcs/templates/yourtemplate/serverstatus.tpl code with this but note the port references and change if necessary. (See end of this post for the locations of the WHM and SMTP ports.) Note that this code uses port 25 for SMTP. See line 118. WHM uses port 2086. See line 73. Check with your provider for the correct ports to use. When you have set your ports correctly, find /whmcs/templates_c and delete the entire contents. It's just a cache. You should also delete your browser cache. Best wishes. ... So I checked my VM for the ports. It appears that my VM uses port 2087 for WHM. I'm not entirely sure what port it uses for SMTP... but how do I get the status code to check for port 2086 then 2087, if the first port fails to respond? And likewise, for port 25 and port 26? 0 Quote Link to comment Share on other sites More sharing options...
redrat Posted August 25, 2009 Author Share Posted August 25, 2009 I think maybe you might be making this more complex than is necessary. Surely, you just ask your provider to let you know what the correct ports are for each and enter them in the /serverstatus.tpl where appropriate? It's also much faster to keep the script lean and mean. As you've already established what port WHM uses you just need to know the one that SMTP uses. 0 Quote Link to comment Share on other sites More sharing options...
Keiro Posted August 25, 2009 Share Posted August 25, 2009 (edited) It works just fine... if I use 2086 or 2087. I'm just mystified as to why it refuses to show the WHM and SMTP as up. I think I'll use GRC's portchecker program. Actually, it's on my local machine. On my Virtual Machine, here. It works on my provider's machine, and as to why it works, but not on the VM, I'm not entirely sure. Edit: I deleted templates_c and it appears to not be working, either way. Hmm. Any other possible clues? Edited August 25, 2009 by Keiro Missed Redrat's post and edited. 0 Quote Link to comment Share on other sites More sharing options...
redrat Posted August 25, 2009 Author Share Posted August 25, 2009 I'm afraid not. I'm plumb out of any more ideas to assist you with this but hope you'll post the resolution here when you find it. Good luck anyway. 0 Quote Link to comment Share on other sites More sharing options...
Keiro Posted August 25, 2009 Share Posted August 25, 2009 Thanks, redrat! I appreciate all the help, so far. 0 Quote Link to comment Share on other sites More sharing options...
Keiro Posted August 26, 2009 Share Posted August 26, 2009 Redrat, just out of curiosity, how do you have it check a range of ports? Say port 2080 to 2090? 0 Quote Link to comment Share on other sites More sharing options...
redrat Posted August 26, 2009 Author Share Posted August 26, 2009 I suggest you PM larwilliams since he wrote the original script that this one was based upon. Good luck. 0 Quote Link to comment Share on other sites More sharing options...
Keiro Posted August 26, 2009 Share Posted August 26, 2009 Thanks, will do! 0 Quote Link to comment Share on other sites More sharing options...
dswp Posted September 7, 2009 Share Posted September 7, 2009 It works!!! Thank you thank you thank you!!! 0 Quote Link to comment Share on other sites More sharing options...
Hostserve Posted October 12, 2009 Share Posted October 12, 2009 Kerio, Did you ever find a resolution to the VMWare port issue for whm & SMTP ? 0 Quote Link to comment Share on other sites More sharing options...
gunemalli Posted October 15, 2009 Share Posted October 15, 2009 Care to share the code? I like the way you setup that status. Finally i figured this out. You can use the original status/index.php with method. Please note two things, 1. I'm using DA instead of cPanel/WHM hence 'DAPanel'. 2. I'm using a firewall which blocks port 3306 from outside. I don't know a workaround on this. Sorry <p>{$LANG.serverstatusheadingtext}</p> <table width="100%" border="0" align="center" cellpadding="10" cellspacing="0" class="data"> <tr align="center"> <th>{$LANG.servername}</th> <th>DAPanel</th> <th>HTTP</th> <th>MySQL</th> <th>FTP</th> <th>POP3</th> <th>SMTP</th> <th>{$LANG.serverstatusphpver}</th> <th>{$LANG.serverstatusmysqlver}</th> <th>{$LANG.serverstatusserverload}</th> <th>{$LANG.serverstatusuptime}</th> </tr> {foreach key=num item=server from=$servers} <tr align="center"> <td>{$server.name}</td> <td>{get_port_status num="$num" port="2222"}</td> <td>{get_port_status num="$num" port="80"}</td> <td>{get_port_status num="$num" port="3306"}</td> <td>{get_port_status num="$num" port="21"}</td> <td>{get_port_status num="$num" port="110"}</td> <td>{get_port_status num="$num" port="25"}</td> <td>{$server.phpver}</td> <td>{$server.mysqlver}</td> <td>{$server.serverload}</td> <td>{$server.uptime}</td> </tr> {foreachelse} <tr> <td colspan="7">{$LANG.serverstatusnoservers}</td> </tr> {/foreach} </table> I think you can also use $server.zendver to get zend version also. And please note you need to manually edit the languages files if you want to include {$LANG.serverstatusmysqlver} etc. 0 Quote Link to comment Share on other sites More sharing options...
redrat Posted October 15, 2009 Author Share Posted October 15, 2009 That's neat but it is not within the design criteria of the original modification which was to expressly leave the server load and uptime out. It's easy enough just to remove those two lines of code though and I like the addition of the PHP and MySQL versions. Nice touch. It's also a nice touch to have added the http and ping stats. How are you achieving that? 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.