[rrd-users] merging 2 or more DEF data sources into one CDEF?

Ryan Kubica kubicaryan at yahoo.com
Fri Apr 11 22:34:07 CEST 2008


beautiful!  Thank you.  (example i pasted back is 3 ds's - working.)

/apps/epic/rrdtool-1.2.99907080300/bin/rrdtool graph /apps/epic/apache-2.0.61/htdocs/test/test.png -aPNG -se-3d -e1207628520 -l0 DEF:defwww100=/data01/epic/rrd/net/snmp/www100/.1.3.6.1.2.1.25.1.6.0.rrd:epoch:AVERAGE DEF:defwww101=/data01/epic/rrd/net/snmp/www101/.1.3.6.1.2.1.25.1.6.0.rrd:epoch:AVERAGE DEF:defwww102=/data01/epic/rrd/net/snmp/www102/.1.3.6.1.2.1.25.1.6.0.rrd:epoch:AVERAGE CDEF:ds_u0=TIME,1207369320,LT,defwww100,TIME,1207455720,LT,defwww101,defwww102,IF,IF VDEF:vdsmax0=ds_u0,MAXIMUM  "LINE1:ds_u0#ff0000:blah"  "GPRINT:vdsmax0:Max %10.3lf %S"



Simon Hobson <linux at thehobsons.co.uk> wrote: Ryan Kubica wrote:
>What I am trying to do is take two or more datasources with 
>different time ranges and merge them into one CDEF for display 
>(graph and legend.)
>
>Example:
>
>    ds foo1 - start 7 days ago, end 6 days ago
>    ds foo2 - start 6 days ago, end 5 days ago
>    ds foo3 - start 5 days ago, end now
>
>    cdef is foo1 or foo2 or foo3
>
>I have the correct time alignments for the adjacent time intervals, 
>ie: foo1 ends 60 seconds before foo2 starts on a 60 second interval 
>step.

OK, for two data sources I have this in a graph definition :

         DEF:data1=${RRDPath1}/${RRDName1}:${Selection}:AVERAGE
         DEF:data2=${RRDPath2}/${RRDName2}:${Selection}:AVERAGE

         CDEF:data=TIME,${ChangeDate},LT,data1,data2,IF

It's part of a shell script, so using normal Bash variable sustitutions.

For three sources just expand as required, I think this would do it 
(with the proviso that changedate2>changedate1) :

 
CDEF:data=TIME,${ChangeDate1},LT,data1,TIME,${ChangeDate2},LT,data2,data3,IF,IF



 __________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-users/attachments/20080411/96fca545/attachment.html 


More information about the rrd-users mailing list