[rrd-users] Re: how 'bout multiple DS updates with same time?!

steve rader rader at teak.wiscnet.net
Mon Sep 13 18:28:38 MEST 1999


 > From: steve rader
 > These two snmpgets may or may not happen at the same time.
 > For simplicity of coding, I'd like my script to be able to do
 > 
 >   rrdtool update SomeSuch.rrd -t input 936979364:2142776862
 >   rrdtool update SomeSuch.rrd -t output 936979364:2223791710
 > 
 > However, the later "rrdtool update" fails:
 > 
 >   ERROR: illegal attempt to update using time 936979364 when last \
 >   update time is 936979364 (minimum one second step)
 > 
 > So, IMHO, think it would be a Good Thing if rrdtool would keep
 > "last update times" for *each* DS and also would allow individual
 > DS updates with the same time.  What do y'all think?

Never mind.  Coding around this problem isn't nearly as ugly as
I had expected:

 # gather targets and their dss (a list of lists) into $details
 for $t ( 0 .. $#details) {
   undef %values_by_time;
   undef %dss_by_time;
   for $i ( 0 .. $#{$details[$t]} ) {
     # gather ds into $ds and it's value into $value
     $values_by_time{$stamp} .= ":$value";
     $dss_by_time{$stamp} .= ":$ds";
   }
   for $stamp (sort (keys %values_by_time)) {
     $values = $values_by_time{$stamp};
     $dss = $dss_by_time{$stamp};
     $dss =~ s/^://;
     `$rrdtool update $rrd -t $dss ${stamp}$values`;
   }
 }

later
steve
- - -
systems guy
wiscnet.net

--
* To unsubscribe from the rrd-users mailing list, send a message with the
  subject: unsubscribe to rrd-users-request at list.ee.ethz.ch



More information about the rrd-users mailing list