[rrd-users] Graphing based of specifc end time.
Michael Van Der Beek
michael.van at antlabs.com
Wed Feb 8 06:29:17 CET 2012
Hi All,
I've setup a way to collect logs and later import logs into an rrd database.
Now lets say at the time of collection is 2pm.
By the time (say 4pm) I return to the office and import the data into the rrd database.
The graph when generated will show a time gape of between 4pm and 2pm (where the last data is seen).
This is because the graph by default is the latest time.
How do I specify to rrdgraph that I want to only show the graph up to the last time of data collection (2pm).
I can obtain the last unixtime of the last record imported to put it into a script if that helps.
Here is a sample of the graph I am generating.
$1 = 1 day, 1 week, 5 weeks, 1 year
$2 = file name extension for 1day, 1 week,5 weeks, 1year
rrdtool graph $GRAPHOPTS --start -$1 $WWWPREFIX/client-$2.$IMGFILEEND -w $WSIZE -h $HSIZE -l 0\
-t "Client License Utilisation" \
-v "packets" \
DEF:client-license=$FILE.$RRDFILEEND:client-license:AVERAGE \
DEF:client-detected=$FILE.$RRDFILEEND:client-detected:AVERAGE \
DEF:client-active=$FILE.$RRDFILEEND:client-active:AVERAGE \
DEF:client-paying=$FILE.$RRDFILEEND:client-paying:AVERAGE \
DEF:client-internet=$FILE.$RRDFILEEND:client-internet:AVERAGE \
LINE1:client-license#ff00ff:"License " \
LINE2:client-detected#0000ff:"Detected " \
LINE3:client-active#00ffff:"Active " \
LINE4:client-paying#ffff00:"Logged in " \
LINE5:client-internet#ff0000:"Network Devices " \
CDEF:perc-client-license=client-license,1,* \
CDEF:perc-client-detected=client-detected,1,* \
CDEF:perc-client-active=client-active,1,* \
CDEF:perc-client-paying=client-paying,1,* \
CDEF:perc-client-internet=client-internet,1,* \
COMMENT:"\l" \
COMMENT:"Licenese limit " \
GPRINT:perc-client-license:AVERAGE:"avg %6.1lf \t" \
GPRINT:perc-client-license:LAST:"last %6.1lf \t" \
GPRINT:perc-client-license:MAX:"max %6.1lf " \
COMMENT:"\l" \
COMMENT:"Detected devices " \
GPRINT:perc-client-detected:AVERAGE:"avg %6.1lf \t" \
GPRINT:perc-client-detected:LAST:"last %6.1lf \t" \
GPRINT:perc-client-detected:MAX:"max %6.1lf " \
COMMENT:"\l" \
COMMENT:"Active devices " \
GPRINT:perc-client-active:AVERAGE:"avg %6.1lf \t" \
GPRINT:perc-client-active:LAST:"last %6.1lf \t" \
GPRINT:perc-client-active:MAX:"max %6.1lf " \
COMMENT:"\l" \
COMMENT:"Logged in users " \
GPRINT:perc-client-paying:AVERAGE:"avg %6.1lf \t" \
GPRINT:perc-client-paying:LAST:"last %6.1lf \t" \
GPRINT:perc-client-paying:MAX:"max %6.1lf " \
COMMENT:"\l" \
COMMENT:"Network Devices " \
GPRINT:perc-client-internet:AVERAGE:"avg %6.1lf \t" \
GPRINT:perc-client-internet:LAST:"last %6.1lf \t" \
GPRINT:perc-client-internet:MAX:"max %6.1lf" \
COMMENT:"\l"
Could somebody comment on how to do this?
Thanks a lot!
Regards,
Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-users/attachments/20120208/6d4d6ad4/attachment-0001.htm
More information about the rrd-users
mailing list