Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need a calculation to work out the downtime percentage of a server.

I am making a script that runs via cron every minute to check the uptime of a remote server.

The two values I have to play with are number of checks run and times the checks failed (outages).

Is this a plausible way of calculating it? I am thinking it must be but can't be too sure as my Maths skills are slipping away from me with age!

share|improve this question

3 Answers 3

up vote 3 down vote accepted

Here's a simple spreadsheet layout to calculate and keep for historical purposes. You can set goals and apply conditional formatting to your hearts content.

  |   A   |         B        |       C      |      D       |     E
------------------------------------------------------------------------
1 | Month | Minutes in month | Minutes Down | Percent Down | Percent Up
2 | Jan   |            44640 |            1 | =(C2/B2)*100 | = 100-D2
share|improve this answer
    
Thanks very much. I could either use the spreadsheet method or what the spreadsheet is to calculate the total uptime -100-(failures/checks*100) –  Chris Oct 24 '10 at 15:10
    
Only problem I have noticed is that could cause division by 0 providing there have been no failures. –  Chris Oct 24 '10 at 15:11
1  
@Chris - Zero divided by something is always zero. Something divided by zero will cause you problems. Because the divisor (minutes in month) is never zero, it shouldn't cause you a problem. –  Ben Pilbrow Oct 24 '10 at 15:21
    
Very true, thanks very much Ben. –  Chris Oct 24 '10 at 19:10

Errrm, 100*failures/(failures+successes), or even simpler 100*failures/total-checks ?

share|improve this answer

Here's a modification of Ben's answer that doesn't need an ugly "Minutes in month" column.

  |   A   |       B      |      C                                               |     E
--+-------+--------------+------------------------------------------------------+------------
1 | Month | Minutes Down | Percent Down                                         | Percent Up
2 | Jan   |            1 | =(B2/(DAY(DATE(YEAR(A1),MONTH(A1)+1,1)-1)*1440))*100 | =100-C2
share|improve this answer
    
Thanks everyone for all suggestions. I know it has gone down the excel table route but I am actually looking to make a PHP system. Thanks anyway though because it has helped get my formula :) –  Chris Oct 24 '10 at 19:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.