[rrd-users] Date of expiration on graph.

edgood1 edward.goodwin at emdserono.com
Thu Apr 21 16:14:32 CEST 2011


I've created some graphs with trending data. They will show the date at which
capacity will hit 100%. This is working well, however if the trend line has
a negative slope it will display the "expiration" date as the time epoch
12/31/69.

I've been trying different RPN statements to print either "Indefinite" or
even nothing at all in the place of the date... but have had no luck. I was
hoping someone could offer a clever suggestion.

On the rrdtool gallery page there is a graph that does what I want, so I
know it can be done.

Here's my graph options (its copied from a perl script so ignore the $vars):

DEF:cpu_in_use=$rrd_dir/$host.rrd:cpu_in_use:AVERAGE                                                   
DEF:total_cpu=$rrd_dir/$host.rrd:total_cpu:AVERAGE                                                     

DEF:cpu_in_use_lt=$rrd_dir/$host.rrd:cpu_in_use:AVERAGE:start=$start:end=$end_lt              
DEF:total_cpu_lt=$rrd_dir/$host.rrd:total_cpu:AVERAGE:start=$start:end=$end_lt                  

CDEF:cpu_free=total_cpu_lt,cpu_in_use_lt,-                                                             
CDEF:percent_used=cpu_in_use_lt,100,*,cpu_in_use_lt,cpu_free,+,/                                                                                                    
AREA:percent_used#00aa0b:"CPU Percent Used"                                                            

VDEF:m=percent_used,LSLSLOPE                                                                           
VDEF:b=percent_used,LSLINT                                                                             
CDEF:trend=percent_used,POP,m,COUNT,*,b,+                                                              

LINE1:trend#ffff33:"Trend"                                                                             

CDEF:sub=trend,100,101,LIMIT # get the portion of the trend line between 100
and 101                   
VDEF:intersection=sub,FIRST # get the FIRST point on that line                                         
GPRINT:intersection:"\nCapacity Expiration date is %B %d, %Y\l:strftime"                               
GPRINT:m:"SLOPE %lf"               




--
View this message in context: http://rrd-mailinglists.937164.n2.nabble.com/Date-of-expiration-on-graph-tp6294346p6294346.html
Sent from the RRDtool Users Mailinglist mailing list archive at Nabble.com.



More information about the rrd-users mailing list