[rrd-users] rrd->update from an array of values

Dayton Jones jones.dayton at gmail.com
Tue Oct 25 17:39:18 CEST 2011


I've got a perl script using rrd::simple that queries a list of hosts and grabs several values.  I want to take that array and dice it up to populate the "rrd->update ( )" structure, but I can't seem to get it right.

How can I read the values from the array and popluate the "update" hash properly?

The generated array (for simplicity's sake) looks like 
   @vals=("host:value","host2:value"..."host:value2","host2:value2");

and of course this needs to be converted into:

$rrd->update( 
     host => value,
     host2 => value,
     ...
     host => value2,
     host2 => value2
);

I realize this is probably more of a perl question than rrd, but any help would be appreciated.



More information about the rrd-users mailing list