[rrd-users] Re: Up time percent

Alex van den Bogaerdt alex at ergens.op.HET.NET
Fri Jun 7 00:14:11 MEST 2002


Stefan Leemann wrote:

> I'm looking for a script to calculate the up time of a router or a link. My 
> goal is to see the percentage of up/downtime of a device.

I don't know of such a script but ...

> Thanks a lot for feedback.

... I can give feedback.

For device uptime:

Make sure you find a way to accurately query the device for its current
uptime.  Do not poll the device and use that outcome as your input; else
you may miss a reboot entirely.

If you find a way to query the uptime in seconds you could apply
the following algorithm:

  if (available)
     if (uptime > polling_interval) insert 1
     else insert uptime/polling_interval
  else insert 0  /* or 0.5 , see below */

This results in a rate and that is what rrdtool needs.  It is then just
a matter of fetching the data.  The average multiplied by 100 will then
be the uptime as a percentage over the requested interval.

The actual uptime will be slightly more than what is calculated; this is
because this algorithm considers the time between the last poll and the
current one to be "down" when applicable.  In reality this won't happen
and on average the device will fail halfway each interval.


For link up/down:

It mostly is as above however you can usually find out more accurately
when a link made the transition between up and down.


In either case:

You need to understand that you insert a rate.  When you insert data
into rrdtool, you are describing the time between the previous update
and the current one.  RRDtool can calculate the rate for you (then you
use COUNTER as your DS) or you can do it (use GAUGE and insert the
values as I described above).

HTH
-- 
   __________________________________________________________________
 / alex at slot.hollandcasino.nl                  alex at ergens.op.het.net \
| work                                                         private |
| My employer is capable of speaking therefore I speak only for myself |
+----------------------------------------------------------------------+
| Technical questions sent directly to me will be nuked. Use the list. | 
+----------------------------------------------------------------------+
| http://faq.mrtg.org/                                                 |
| http://rrdtool.eu.org  --> tutorial                                  |
+----------------------------------------------------------------------+

--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-users mailing list