Jump to content

Server Uptime Monitoring for WHMCS


N1CK3RS0N

Recommended Posts

Hello,

 

I was interested in hearing peoples ideas and getting a little help on something I plan to develop for WHMCS.

 

WHMCS (Web Host Manager Complete Solutions) is basically a portal for web hosting businesses. It lets clients order hosting packages and it automatically sets up the account in the servers control panel (cPanel, Plesk, Direct Admin, etc.)

 

One of the features for the users to view is the Server Status page. It shows if the servers FTP, HTTP, POP3 are up and running, as well as displaying the servers current CPU load and current uptime.

 

One thing it does not do though is display a % (such as 99.8% or whatever). A lot of people on their site say they would love this feature. And since I want it for my site I would like to develop it.

 

My ideas for it would to run a cronjob every minute or so, to execute a script. The script would check to see if a page can load (not sure exactly how this will work). If it loads then it adds +1 to uptime for that server in the SQL database. If it doesn't load it will add +1 to downtime.

 

The equation to find the uptime % would be as followed: downtime / uptime * 100 = uptime percentage.

 

Any ideas on how I should do this? Anyone care to help me with this?

Link to comment
Share on other sites

You just told us how it would work....

 

 

 

Do you need help with the specifics or what?

 

Yeah, I'm still new to PHP. Didn't know if there's any other easier ways or what.

 

1. I don't know how to write a cron job. Can someone help me with this? ^^

 

2. How would the PHP file the cron job works? Would it try to include a file, if the file isn't found then +1 to downtime? I'm still not sure how to go about this part. :"(

Link to comment
Share on other sites

Your way of working thing's i think will not work.

 

Let's say:

 

Down time  = 5

Up Time    =  250

 

Down time / uptime = 0.2

 

0.2 * 100 = 2

 

2% downtime. :P

 

We do want it for uptime though so

 

downtime / uptime * 100 = downtime %

 

100 - downtime % = uptime %

Link to comment
Share on other sites

The equation to find the uptime % would be as followed: downtime / uptime * 100 = uptime percentage.

 

Just worked out as you said. And if a client see's 2% uptime and 98% downtime.. good luck getting customer's.

 

Plus. Having 98% downtime is very bad rep for a webhosting company.

Link to comment
Share on other sites

The equation to find the uptime % would be as followed: downtime / uptime * 100 = uptime percentage.

 

Just worked out as you said. And if a client see's 2% uptime and 98% downtime.. good luck getting customer's.

 

Plus. Having 98% downtime is very bad rep for a webhosting company.

 

Haha yeah. xD The server would have to be like a 1984 mac running on AOL. xD

 

2% uptime lol.

 

But the new formula works I believe? Now just to figure out how to check if the server is up or down.

Link to comment
Share on other sites

10 minute cron sending a request to a page. then that page requesting another page. But by using fopen.

 

if what ever text you put in the page then update if not downdate. lol

 

Even if the servers down would fopen still work? The cronjobs still execute right?

Link to comment
Share on other sites

One of the features for the users to view is the Server Status page. It shows if the servers FTP, HTTP, POP3 are up and running, as well as displaying the servers current CPU load and current uptime.

 

I would suggest you find out how it finds out if the server is up and running and go from there. Trying to request a page to see if the server is running is not at all reliable.

 

There are many ways to do this depending on what kinds of permissions you have. apache2ctl for example has a status option built in which will tell you if apache is running or not.

Link to comment
Share on other sites

One of the features for the users to view is the Server Status page. It shows if the servers FTP, HTTP, POP3 are up and running, as well as displaying the servers current CPU load and current uptime.

 

I would suggest you find out how it finds out if the server is up and running and go from there. Trying to request a page to see if the server is running is not at all reliable.

 

There are many ways to do this depending on what kinds of permissions you have. apache2ctl for example has a status option built in which will tell you if apache is running or not.

 

Do cron jobs work even if server is down?

Link to comment
Share on other sites

Do cron jobs work even if server is down?

 

Cron has nothing to do with apache. I assume when you say server your refering to apache, not the machine itself.

 

Yes, cron will still operate regardless of wether or not apache is running, they are in no way related.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.