[rrd-users] Question about multiple DS's in a RRD

Christian_Lair at i2.com Christian_Lair at i2.com
Mon Mar 22 22:08:00 MET 2004


I'm trying to create a rrd that will keep track of some stats for unix 
machines. I'm tracking load avg, cpu load, and vm load, the data is being 
collected via SNMP and stored in a colon separated file, updated every 15 
mins. The whole purpose of putting the data into a RRD is to create 1 
graph showing all 3 items. I've created a RRD using this command:
rrdtool create /data/load_avg.rrd --start 1072936800 \
 --step 900 \
 DS:load:GAUGE:900:0.0:U \
 DS:cpu:GAUGE:900:0:100 \ 
 DS:vm:GAUGE:900:0:U \
 RRA:AVERAGE:0.5:1:8640

I'm using Perl to parse the datafile and update the RRD. I started out 
just updating the load avg and that worked just fine. I've now decided to 
take another step forward and update the cpu and vm using this code:

open (DATA,"/data/rrd/datafile");

while (<DATA>) {
  my 
($time,$min,$seconds,$hostname,$ip,$cpu,$cpuload,$usertime,$systime,$iowait,$vmem,$uptime,$load,$
mem,$os,$cpuspeed,$fs,$version) = split (/:/);

  my $date = join (':',$time,$min,$seconds);
  $time = &UnixDate($date,"%s");

  my($min1,$min10,$min15)= split (/,/,$load);

  RRDs::update ("$rrd", "--template", "load", "$time:$min15");
  my $ERR=RRDs::error;
  die "ERROR while updating rrd: $ERR\n" if $ERR;

RRDs::update ("$rrd", "--template", "cpu", "$time:$cpuload");
  my $ERR=RRDs::error;
  die "ERROR while updating rrd: $ERR\n" if $ERR;

RRDs::update ("$rrd", "--template", "vm", "$time:$vmem");
  my $ERR=RRDs::error;
  die "ERROR while updating rrd: $ERR\n" if $ERR;
}
close DATA;

Now I'm getting the error: ERROR while updating rrd: illegal attempt to 
update using time 1072937826 when last update time is 1072937826 (minimum 
one second step).

I assume its because of the second and third RRDs::update statements. How 
can I update all three DS's in the RRD when they have the same update 
time?


Thanks,
Christian Lair



--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-users mailing list