in reply to rrdtool:oo two separate datasets
We use RRD-Tool as part of our company products. The problem is that each RRD file requires a heartbeat which tracks the timeframe in which an value can be populated. Based on how you're describing it, RRD will already have a value populated on a certain epoch time. The second data point cannot be insert into it because the RRD file already has an entry within that heartbeat time frame.
You will need to insert both values (in and out) at the same time.
I recommend that you create a hash that contains both the in and out values, then loop through the hash. My example is showing this without the RRDTool::OO module. But I'm giving you a conceptual way to do it.
use RRDs; ## FORMAT IN::OUT VALUES $rrdFile{'foo.rrd'} = "323::460"; $rrdFile{'bar.rrd'} = "322::110"; $RrdEpochTime = time(); foreach (keys (%rrdFile)) { ($in, $out) = split (/::/, $rrdFile{$_}); RRDs::update("$_","$RrdEpochTime:$in:$out"); }
The goal here is to assemble a hash that contains your data, then loop once to store it in RRD.
This should help get your gears moving. I've had to use this method before when polling a large amount of SNMP data.
|
|---|