[rrd-users] two rrd files with same name data sources?

Steve Wray stevew at catalyst.net.nz
Fri Sep 3 05:36:56 MEST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi there,

I have a requirement to produce graphs from data in two rrd files, these two rrd files have DS with the same name.

My problem is that the legend shows identical lables for the two data sources, even though the vnames are different.

Here is a sample of my code;

foreach my $ds (@sources) {
    my $type  = shift @graph_types;
    my $upper_ds = ucfirst($ds);

    foreach my $disk (@disks) {
      my $color = shift @colors;
      my ($major,$minor) = $disk =~ m|^$hostname\.iostat\.(\d)\.(\d).rrd|;

      push @parameters, ("DEF:${ds}_${major}_${minor}=$rrd_location/$hostname.iostat.$major.$minor.rrd:$ds:AVERAGE",
			 "$type:${ds}_${major}_${minor}#$color:".sprintf("%-6.6s","$upper_ds"),
			 "GPRINT:${ds}_${major}_${minor}:MAX:($major,$minor) %6.2lf",
			 "GPRINT:${ds}_${major}_${minor}:MIN:%6.2lf",
			 "GPRINT:${ds}_${major}_${minor}:AVERAGE:%6.2lf\\n");
    }
  }

I inserted the ($major,$minor) in front of the format string so that I had some way to see
which lines were for which disk, but it looks really ugly.

What is interesting, I think, is that the specified vname isn't used in displaying the legend; just
the actual ds name.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBN+bgmVx2hyhuTucRAobOAKDR9vHACcfzNkefKJzLXS7GHQ15iACfYEk0
AoYvf5pxyHDf8WUTHWz1o4M=
=23uP
-----END PGP SIGNATURE-----

--
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