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?
What I do in this case is write scripts that write scripts.
For example if I have a bunch of similar devices , but each device has
a different number of variables, I write a script that writes an
rrdcgi for each device.
Most recently is was brightmail spam bucket graphs. I have 11 dcs
each with a different number of brightmail devices. For each
datacentre write an rrdcgi that aggregates whatever the number of
brightmail devices are in that datacentre.
It's not as elegant as say a single script that you use for all
datacentres , but it does get the job done.
On a related note has anyone played around with squeezing lots of
cdefs in one graph? My big datacentres segfault with complicated
graphs. So for example if I add 40 points together and plot the sum it
works, but if I stack all those points it falls over.
Do I need to break out gdb and strace or have I tell rrd "I'm going to
feed you a lot of data, be prepared"?
Thanks for the replies, I am now till the stage in my project where it is time to write this code. I'm pretty sure I can make it work as Mr Thornton suggested, but I'm curious about Mr Rushworth's suggestion. Martin, can you elaborate a bit more on your array passing technique? I'm not clear as to what is all happening. Below is a sample of how I've been generating graphs with the RRDs module. It shows only a few DEFs but my goal is to graph as many temp sensors as each bin has rrd files (6-13) with one graph per bin. $_ is the bin number and $_ the time frame.