[rrd-users] how to add last update info into graphic?

John Conner bs7799 at gmail.com
Wed Jun 20 17:32:46 CEST 2007


ah, fogot my friend sed, I was just fighting with ', " and \ just now.

Thanks guys!

John



On 6/20/07, Alex van den Bogaerdt <alex at ergens.op.het.net> wrote:
>
> On Wed, Jun 20, 2007 at 10:18:41AM -0500, John Conner wrote:
> > hey guys, I am trying to add last update time info into rrdtool graphic,
> > what I did is something like
> >
> > #!/bin/bash
> > now=`date`
> >
> > rrdtool graph blablabla \
> > blablabla \
> > blablabla \
> > COMMENT:"last update\: $now"
> >
> > when I ran the scipt, I got the following error,
> >
> > ERROR: Garbage ':56:46 CDT 2007' after command:
> > COMMENT:last update\: Wed Jun 20 09:56:46 CDT 2007
> >
> > I know it was caused by the ":", rrdtool does not like any ":" without
> "\",
> >
> > So any quick solution I can print date info on the graphic? thanks a
> lot!
>
> Try sed, or awk, or any filter you happen to know.  For instance:
>
> now=`date|sed 's/:/\\:/g'`
>
>
>
> You could also tell date how to present its output:
>
> now=`date -u +%Y-%m-%dT%H\\:%M\\:%SZ`
>
> HTH
> --
> Alex van den Bogaerdt
> http://www.vandenbogaerdt.nl/rrdtool/
>
> _______________________________________________
> rrd-users mailing list
> rrd-users at lists.oetiker.ch
> https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-users/attachments/20070620/76318af4/attachment.html 


More information about the rrd-users mailing list