[rrd-users] For..next loops within RRDs Perl module calls

Martin Rushworth martin.rushworth at sohonet.co.uk
Mon Jun 6 12:32:22 CEST 2011

I think what you are looking for is something along these lines..

you can pass the data as an array to RRDs::graph, so instead of doing something like...

my ($avg,$xsize,$ysize) = RRDs::graph "-","--title", "Bits Graph","--height","300",,,,etc,,etc,;

you can do

my @array = ("-","--title", "Bits Graph","--height","300",,,etc,,,);

and then any combination of iteration or selection you like
	push(@array, $foo);

and then do...

my ($avg,$xsize,$ysize) = RRDs::graph @array;

does that make sense?

On 3 Jun 2011, at 17:12, m_elias wrote:

> I'd like to create a graph creation subroutine that allows for a dynamic or
> variable number of DEF and CDEF. What I mean by dynamic is, that some graphs
> will have 6 DEFs, some will have 13, the perl script would set the number of
> cycles for the for..next loop which would be within the RRDs module call.
> Any suggestions on how to do this? I have been unsuccessful in figuring it
> out myself. Or do I have to pass command line arguments instead of using the
> RRDs module?
> --
> View this message in context: http://rrd-mailinglists.937164.n2.nabble.com/For-next-loops-within-RRDs-Perl-module-calls-tp6435876p6435876.html
> Sent from the RRDtool Users Mailinglist mailing list archive at Nabble.com.
> _______________________________________________
> rrd-users mailing list
> rrd-users at lists.oetiker.ch
> https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users

More information about the rrd-users mailing list