[rrd-users] Re: newbie help please - RRDTOOL GPRINT/LTIME (using Perl module)

Stanley Hopcroft Stanley.Hopcroft at IPAustralia.Gov.AU
Fri May 9 09:16:21 MEST 2003

Dear Sir,

I hope I have understood you correctly but I think you have done all the
hard stuff already (and I thank you for it because I am using rrdcgi at
the moment and you have provided a wonderful example of doing the same
thing with RRDs::graph that I can use with CGI.pm [in this case to have
a fill out form to get the start and end dates]).

Perhaps I haven't understood your question but if you only want the 
start and end dates in a consistent format (struct tm or time_t or 
localtime format) all I think you need do is

1 Use RRDs::fetch to get the start and end data

2 use Perls localtime function in a scalar context on the first element 
of the array ref that fetch returns

somthing like

(undef, undef, $data) = RRDs::fetch(<your_rrd>, <your_CF>, '--start',
<your_start>, '--end', <your_start> + step>) ;

$my_start = localtime($data->[0]) ;

Yours sincerely.

Stanley Hopcroft

'...No man is an island, entire of itself; every man is a piece of the
continent, a part of the main. If a clod be washed away by the sea,
Europe is the less, as well as if a promontory were, as well as if a
manor of thy friend's or of thine own were. Any man's death diminishes
me, because I am involved in mankind; and therefore never send to know
for whom the bell tolls; it tolls for thee...'

from Meditation 17, J Donne.

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