[rrd-users] Re: graphing question...

Alex van den Bogaerdt alex at slot.hollandcasino.nl
Wed Aug 8 01:25:52 MEST 2001


Les wrote:

> Any suggestions on how I could overlay points showing
> on a graph where a device is in an on or off state...

This is not really possible.  The design of RRDtool is
based on rates over time.  What you can display is the
average state.  For instance: during these 5 minutes the
device was on for 100%, or: it was on for 10% of the time.

When values are consolidated you'd have a problem if you
just log on and off.  What if you're taking 6 values
together when the daily log entries need to go into the
weekly log?  If all 6 values are equal then obviously
you don't have a problem but what if they're not?


If you know the exact on and off times you could approach
this as follows:

Create an RRD with a step time of 1 second. The heartbeat
value should be high, for instance 4000 seconds.  The RRD
should have an RRA which builds one CDP from 300 PDPs, one
which builds a CDP from 1800 PDPs (6 times 300), one of
7200 PDPs per CDP (24 times 300) and one of 86400 per CDP
(288 times 300).  This creates MRTG compatible RRAs while
taking into account the different step time.

Now you need to update this RRD.  Each time a transition
occurs, you log 1 if it goes from on to off and 0 if it
goes from off to on.  This will update the previous period
in time with the proper number (0 for off and 1 for on),
this period will have started at the last update.  Each
hour you also update the database, with the current state,
unless a transition need to be logged.  This needs to be
done to satisfy the heartbeat and to limit the damage in
case of disasters (script failing, monitor failing or so).

The result: each CDP will contain a fraction of 1.  If the
value is 1 itself, the device was on during the complete
interval. If it was 0, it was off.  If it is 0.20, the
device was on during one minute, etcetera.


Of course you can modify this suggestion.  For instance,
log 100 in stead of 1 to get percentages.  Set heartbeat
to 360 and update each 5 minutes, or do the opposite and
set heartbeat to 90000 and just update once a day.

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