[rrd-users] Graphing two separate graphs from a DB

Steve Shipway s.shipway at auckland.ac.nz
Wed Dec 11 21:42:01 CET 2013


You¡¯re misunderstanding the nature of the RRD behaviour; you only need a
single RRD file with two RRAs; a single update and two graph calls.

 

When you call rrdtool to generate the graph, it will use the best available
RRA, based on the granularity requested and the time window you have asked
to graph.  You can specifically request a particular granularity (IE, a
particular RRA) and it will only use another if the data are not available
in the requested one.

 

You update the RRD file using your ¡®rrd update¡¯, and this will
simultaneously update all the RRAs in the RRD, rolling up the data where
required, and expiring where necessary.

 

To show this is indeed possible, you only have to look at MRTG/RRD ¨C this
uses a single RRD with multiple RRAs, a single update, but generates
multiple graphs over the different RRAs.

 

See the manual here: http://oss.oetiker.ch/rrdtool/doc/rrdgraph.en.html

In particular, use the ¨Cs and ¨Ce to set the start and end of your time
range (ensuring it is wholly within the RRA you want to use) and the ¨CS to
specify the step size (allowing you to specify the particular RRA).  Pay
particular attention to edge cases ¨C make sure your RRA is a little bit
bigger than the window you want to graph.  

When specifying your data, using the DEF directive, make sure that you have
an RRA available with the requested CF at the requested resolution (step
size) for the requested time window, else rrdtool will make best-effort
using the data it has.

 

Steve

 

  _____  

Steve Shipway

ITS Unix Services Design Lead

University of Auckland, New Zealand

Floor 1, 58 Symonds Street, Auckland

Phone: +64 (0)9 3737599 ext 86487

DDI: +64 (0)9 923 6487

Mobile: +64 (0)21 753 189

Email:  <mailto:s.shipway at auckland.ac.nz> s.shipway at auckland.ac.nz

P Please consider the environment before printing this e-mail : ´òÓ¡±¾Óʼþ£¬
½«¼õÉÙÒ»¿ÃÊ÷´æ»îµÄ»ú»á

 

From: rrd-users-bounces+s.shipway=auckland.ac.nz at lists.oetiker.ch
[mailto:rrd-users-bounces+s.shipway=auckland.ac.nz at lists.oetiker.ch] On
Behalf Of er ic
Sent: Thursday, 12 December 2013 5:21 a.m.
To: rrd-users at lists.oetiker.ch
Subject: [rrd-users] Graphing two separate graphs from a DB

 

Similar to MRTG, I would like to have a graph for 24 hour and a separate
graph for 1 week.

I am pinging a host and graphing the latency.

I have an RRD called host-latency-db.rrd

I had two RRAs set up with 24 hours and 7 days but it is my understanding
the graph tool picks either/or depending on the data. I dont believe I can
graph off each RRA

Simply put, I want to ping a host, store the data and graph 2 separate
graphs with 24 hours and 7 days without having to ping it twice.

The only way I can thing to do this is after my get_data() command that
pings it, I run the following command

$rrdtool update host-latency_db.rrd --template pl:rtt N:$RETURN_DATA

I am assuming I will need two databases to store the information, 1 for a
day and 1 for an hour.

Then on my create graph script, I will have to have two rrdtool graph calls,
one on each DB, and create two separate graphs.

I was hoping there is a cleaner way or if I need two DBs and two graph
calls.

Thanks,

--Eric

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-users/attachments/20131211/e985c192/attachment-0001.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5900 bytes
Desc: not available
Url : http://lists.oetiker.ch/pipermail/rrd-users/attachments/20131211/e985c192/attachment-0001.bin 


More information about the rrd-users mailing list