Jump to content

Server Status display wizardry


redrat

Recommended Posts

  • Replies 148
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Redrat,

 

You're right on. I'ts mon.itor.us. Just love those guys. Great to have that little widget. I just would love all the others would follow suit.

 

I Know that it's out of scope, since i have only one server i left it out there ;).

 

@Mark:

 

I think it should slow down cos you need get a lot of info on a whole lot of servers. But i'm not sure cos i have only 1 server and whmcs/severstatus files exists on the same server. So i'm not sure. Try removing the load & uptime reports. I.E the last two columns.

Edited by gunemalli
Link to comment
Share on other sites

 

I think it should slow down cos you need get a lot of info on a whole lot of servers. But i'm not sure cos i have only 1 server and whmcs/severstatus files exists on the same server. So i'm not sure. Try removing the load & uptime reports. I.E the last two columns.

 

Those two are possibly the most important things for me when I'm checking :)

 

Would there possibly be a way to cache the up/down status on some things and refresh it, say, every five minutes so that when the serverstatus.php is told to query, it doesn't take as long and list all services on my last server (WEB-1) as down?

Link to comment
Share on other sites

  • 2 weeks later...

This Mod is designed only to show those servers that are relevant to the client concerned so, if a client has a server account in two locations, that will show up. I f a client has six sites on server 1, all of those sites will be listed against that server. If that client has six sites on server 1 and two on server 3, all of that will be correctly listed.

 

It would lose all of that functionality if your suggestion was implemented, Neath, It is never intended to list all of your servers to all clients, whether grouped or otherwise. That would defeat the whole original purpose of it. Please refer to post #1 for clarification.

 

There are, however, other variations without the same restrictions that might be suitable for adaptation. And, I am sure that, now WHMCS supports grouping, many others would be interested in your suggestion which would certainly be useful under different circumstances.

 

Best wishes.

Edited by redrat
Link to comment
Share on other sites

Appologies :) that is why i put in my previous post "appologies to go off topic" as i knew it wasnt related to the actual server status mentioned in this script but because you guys know how to mod it etc i thought if any 1 knew how to do it, it would be some one in this section :)

 

daniel

Link to comment
Share on other sites

I have written an article on this on my website.

 

There is no need to use any other code other then what's given by WHMCS

 

http://netbizcity.com/index.php?option=com_content&view=article&id=56:customize-whmcs-status-page&catid=5:linux&Itemid=16

 

As we see there is a function called get_port_status

 

So checking Cpanel would be get_port_status num="$num" port="2082"

This works fine.

 

One only need add columns for the service to check.

 

I would remove the link to phpinfo as this is not a good idea to have.

I just show the php version.

 

Stuff you like to see along with services up is uptime, php and mysql versions and server load.

Link to comment
Share on other sites

I have written an article on this on my website.

 

There is no need to use any other code other then what's given by WHMCS

 

http://netbizcity.com/index.php?option=com_content&view=article&id=56:customize-whmcs-status-page&catid=5:linux&Itemid=16

 

As we see there is a function called get_port_status

 

So checking Cpanel would be get_port_status num="$num" port="2082"

This works fine.

 

One only need add columns for the service to check.

 

I would remove the link to phpinfo as this is not a good idea to have.

I just show the php version.

 

Stuff you like to see along with services up is uptime, php and mysql versions and server load.

Good stuff and cheers for the useful link vincent. ;)

Link to comment
Share on other sites

  • 2 weeks later...

Hi guys,

 

Status page load fine for me without any modification (v 4.1.2).

 

I don't have any Server but Run whole my business on Totally Reseller Servers with few reseller providers. As you know these reseller providers has tough policy on Resource usage.

 

So will this Server status page INCREASE any Server LOAD when many client access this page to see their server status ?

 

And How to avoid this ? (I mean restrict the visitor freequently refresh the server status pag ?)

 

TKS

Link to comment
Share on other sites

The impact on load is very minimal. Don't worry. ;) You cannot practically stop visitors from refreshing the page. The server status page in cPanel is much more resource hungry and that never causes a problem either. No reseller provider should have any issue with this script and, if they do, they will soon let you know. I would just relax on that score as I have never heard of anyone experience a resource problem. ;)

Link to comment
Share on other sites

this seems great but is this confirmed to work in 4.1.2?

 

for example the admin status link returns, zend version, mysql version etc. but the admin status page has no fields for this data to go in, and every field on there is blank for me even tho the actual status page does not show blank values.

 

The security on the client page was a must and many thanks for that.

Edited by chrcol
Link to comment
Share on other sites

sorry, I am reffering to this.

 

Admin Area objective

 

1. Very simply to be able to see all of the Server Status information that WHMCS is capable of displaying with no blank table cells.

 

I assumed that meant the server status would be viewable in the admin area the same way as client area.

 

and yes it works fine in my client area, so many thanks for this mod.

Link to comment
Share on other sites

Ah thanks for explaining. I have moved on from relying upon WHMCS for server monitoring from an administrative point of view and now use Nagios for much more meaningful information.

 

If you are on a shared hosting environment, for better monitoring than WHMCS (or this mod) affords you, the server status in WHM / cPanel will give you visual clues far better than this humble little mod will. This is really just to change what your clients see.

 

But, it has been so long since I first made this thread that I forget where I was coming from at the time. And my original images that showed what I wanted have disappeared. Check post #1 and you'll see.

 

It would be convenient, superficially, to only have to look in the WHMCS admin area for this information. But that, I now realise, is simply asking too much of it. It is not a server monitoring application. Nagios is.

 

I apologise that I can not remember what it was initially I tried to help people with in the admin area.

 

If you could upload a screen shot it will remind me and I will do my best to help you.

 

Best wishes.

 

Chris.

Edited by redrat
Link to comment
Share on other sites

yes this isnt for my own monitoring purpose I also use nagios myself.

 

I assumed the admin area would match what is seen in the client area with the exception it would always show all servers. Since to test if the server status works in the client area I have to login as a client. So seeing it in the admin area would save time in that respect. It not working as I expected in the admin area is nothing too important, the main thing was doing as your mod did which was to (a) remove phpinfo and (b) stop it from been a publicly viewable area.

Link to comment
Share on other sites

Hi chrcol. I must have had a blonde moment the other day. In fact, this mod has no bearing at all on the server status monitor that you see in WHMCS admin area and I should have remembered that immediately. It only modifies what the client sees.

 

That being the case, this mod appears to be working fine for you. It is a separate issue that you have and I recommend firing off a ticket to Matt and crew to resolve it. By the way, the admin version is a different type of display anyway. Sorry I didn't twig this straight away.

 

I'm glad you wanted to remove the php.info link because many don't and it's a bit dodgy to have it there really, as you know.

Link to comment
Share on other sites

  • 2 months later...

Here's another version I wrote up. It's based on WHMCS 4.1.2 version of the template. It turns off the PHP Info link, and adds a few extras (basically the same ones as the other script). It's a little bit shorter and cleaner, as it keeps all of the template code separate, it also loads the existing login.tpl so you don't have to maintain it in an additional place.

 

Also, if you want to turn off the PHP Info, don't forget to edit the status/index.php file too. Someone can still access the PHP info by going to /status/index.php?action=phpinfo unless you comment out the phpinfo line in the file by putting a // in front of phpinfo();.

 

{php}
$query = "SELECT DISTINCT tblservers.name FROM `tblservers` JOIN `tblhosting` ON tblhosting.server=tblservers.id WHERE tblhosting.userid='".$_SESSION["uid"]."' AND tblhosting.domainstatus='Active'";
$result = mysql_query($query);
$servers_new = array();
$server_names = array();
while ($data = mysql_fetch_array($result,MYSQL_ASSOC)) {
 $server_names[] .= $data['name'];
}
$servers_old = $this->_tpl_vars[servers];
foreach ($servers_old AS $key=>$value) {
 if (in_array($value['name'],$server_names)) $servers_new[] = $value;
}
$this->clear_assign('servers');
$this->assign('servers',$servers_new);
{/php}
{if $loggedin}
<p>{$LANG.serverstatusheadingtext}</p>
<table width="100%" border="0" align="center" cellpadding="10" cellspacing="0" class="data">
 <tr>
   <th>{$LANG.servername}</th>
   <th>HTTP</th>
   <th>FTP</th>
   <th>POP3</th>
   <th>IMAP</th>
   <th>SMTP</th>
   <th>cPanel</th>
   <th>{$LANG.serverstatusserverload}</th>
   <th>{$LANG.serverstatusuptime}</th>
 </tr>
 {foreach key=num item=server from=$servers}
 <tr>
   <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>{get_port_status num="$num" port="143"}</td>
   <td>{get_port_status num="$num" port="25"}</td>
   <td>{get_port_status num="$num" port="2082"}</td>
   <td>{$server.serverload}</td>
   <td>{$server.uptime}</td>
 </tr>
 {foreachelse}
 <tr>
   <td colspan="8">{$LANG.serverstatusnoservers}</td>
 </tr>
 {/foreach}
</table><br />
{else}
{assign var='formaction' value='dologin.php?goto=serverstatus'}
{include file="$template/login.tpl"}
{/if}

 

Redrat, thanks for the script. I'm not trying to steal your thunder, just offer another method. Thanks for the inspiration and some really good ideas.

Edited by epicconstruct
Link to comment
Share on other sites

redrat: Now I know why I could never get the two ports to show up as open a while back. I had an "AHA!" moment today and opened the ports.

 

Right after that, I checked the status page, and sure enough, they showed as up.

 

:/

 

Which means, if it's still showing as down when everything else is up, CHECK YOUR PORTS!

Link to comment
Share on other sites

I have this script setup to monitor additional ports on 2 servers. I have shell_exec and exec disabled on both servers. One the server where whmcs runs, I get all the info for extars like php/mysql ver, imap, cpanel ports. However, on the remote server, I do not get server load, imap and cpanel show offline(even though they are online). I do get php/mysql versions. Is this possibly a firewall issue?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated