[rrd-users] Automatic Timestamp in RRD graphs
Karl Fischer
rrd-users at ficos.de
Thu Nov 27 16:01:15 CET 2008
Tobias Oetiker wrote:
> Martin,
>
> Today Martin Knoblauch wrote:
>
>> I think my reply/question did not hit the list ...
>>
>>
>> ----- Original Message ----
>>> From: Erik de Mare <erik at oezie.org>
>>> To: Martin Knoblauch <spamtrap at knobisoft.de>
>>> Cc: rrd-users rrd-tool <rrd-users at lists.oetiker.ch>
>>> Sent: Wednesday, November 26, 2008 2:57:35 PM
>>> Subject: Re: [rrd-users] Automatic Timestamp in RRD graphs
>>>
>>>
>>> add something like COMMENT:`date`
>>>
>> OK, while this does not necessary satisfy my laziness, it seems to work kind of. So I add the following to my legend:
>>
>> " COMMENT:'\s' COMMENT:'\s' COMMENT:'$datestring'"
>>
>> where
>> "$datestring" has my desired timestamp. All is good so far, but the
>> string is left aligned. I would like to have it on the right lower
>> corner of my graph? I read about "\r", but it does not work.
>
> this does generally work well, make sure though,
>
> a) that \r actually reaches rrdtool and does not get eaten by some
> intermediary step
>
> b) try with a more recent version of rrdtool ... not sure about the
> exact bug/feature set of 1.2.15.
>
> cheers
> tobi
Tobi,
ok, I guess I wasn't precise enough. And I remebered it wrong (sorry Martin)
It doesn't seem possible to used left *and* right alignment in one line.
Example:
I'd like to add a timestamp in this graph rightbound in *the same line* with
the legend: see http://mail.ficos.de/rrdtool/test0.png
rrdtool graph $1 \
--interlaced \
--units-length=12 \
--imgformat=PNG \
--start=1227782280 \
--end=1227783360 \
--base=1000 \
--width=600 \
--height=100 \
--upper-limit=100 \
--lower-limit=0 \
--rigid \
--title="CPU stats" \
DEF:iowait=Proc.rrd:iowait:AVERAGE \
DEF:softrq=Proc.rrd:softrq:AVERAGE \
DEF:irq=Proc.rrd:irq:AVERAGE \
DEF:system=Proc.rrd:system:AVERAGE \
DEF:nice=Proc.rrd:nice:AVERAGE \
DEF:user=Proc.rrd:user:AVERAGE \
DEF:idle=Proc.rrd:idle:AVERAGE \
CDEF:ciowait=iowait,4,/ \
CDEF:cirq=irq,4,/ \
CDEF:csoftrq=softrq,4,/ \
CDEF:csystem=system,4,/ \
CDEF:cnice=nice,4,/ \
CDEF:cuser=user,4,/ \
CDEF:cidle=idle,4,/ \
AREA:ciowait#f00000:iowait \
AREA:cirq#808000:irq:STACK \
AREA:csoftrq#803000:softrq:STACK \
AREA:csystem#80f000:system:STACK \
AREA:cnice#000030:nice:STACK \
AREA:cuser#0000f0:user:STACK
So I added:
"COMMENT: Date\: $(date "+%F %T" | sed 's/:/\\:/g')\r"
which leads to: http://mail.ficos.de/rrdtool/test1.png
(entire line right bound)
If I now change the last line above to
"AREA:cuser#0000f0:user\l:STACK" \
which leads to: http://mail.ficos.de/rrdtool/test2.png
So now the legend is left-bound and the timestamp is
right-bound, however, on two different lines ...
???
- Karl
More information about the rrd-users
mailing list