[rrd-users] Re: Putting current time in rrdgraph COMMENT

Sorrell, Al Al_Sorrell at troweprice.com
Tue May 13 20:53:55 MEST 2003


At least on Solaris 8, you could do the following (man date):

$ now=`date '+%m/%d/%y %H:%M:%S'`
$ echo $now
05/13/03 14:52:00

If you need it in GMT and that's not your local time zone, you would
probably have to change the TZ environment variable locally to get the
correct offset.


-----Original Message-----
From: Fitzgerald, David [mailto:David.Fitzgerald at Level3.com] 
Sent: Tuesday, May 13, 2003 2:33 PM
To: rrd-users at list.ee.ethz.ch
Subject: [rrd-users] Re: Putting current time in rrdgraph COMMENT


I've successfully placed the current time in a rrdgraph generated png
file in perl, with the following snippet:
 

    $nowlit = "$mon/$day/$yr $hour:$min:$sec GMT";

    $com = " COMMENT:\"Written: $nowlit\"";

 

I now have the need to do this directly from a shell file (or rewrite a
bunch of shell scripts to perl)

 

A current command might be:

 

rrdtool graph /graphs/w1p1/allin.png -s e-24h -a PNG -w 600 -h 150 -t
"West1  All Inbound Packets"  \

   DEF:disc=/usr/perl/w1p1.rrd:disc:AVERAGE \

   DEF:b=/usr/perl/w1p1.rrd:req:AVERAGE \

   DEF:c=/usr/perl/w1p1.rrd:inf:AVERAGE \

   DEF:d=/usr/perl/w1p1.rrd:decl:AVERAGE  \

   DEF:e=/usr/perl/w1p1.rrd:rel:AVERAGE \

   CDEF:all=disc,b,+,c,+,d,+,e,+ \

   LINE1:disc#FF0000:disc: \

   LINE1:b#00FF00:req: \

   LINE1:c#0000FF:inf: \

   LINE1:d#555555:decl: \

   LINE1:e#550000:rel: \

   LINE1:all#ff00ff:all:  

 

I just want to add a COMMENT: command that includes a human-readable
timestamp.  I couldn't figure out the exact syntax, even with the
seemingly similar question involving rrdcgi.

 

Thanks in advance!


--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-users mailing list