3

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!

Skyhawk
  • 14,200
  • 4
  • 53
  • 95
Chris
  • 1,289
  • 2
  • 18
  • 34

3 Answers3

3

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
Ben Pilbrow
  • 12,041
  • 5
  • 36
  • 57
  • 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
  • 2
    @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
1

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

MadHatter
  • 79,770
  • 20
  • 184
  • 232
0

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
Fahad Sadah
  • 1,496
  • 11
  • 21
  • 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