[rrd-users] programmatically create graphs

Munroe Sollog mus3 at Lehigh.EDU
Mon Jul 1 20:39:40 CEST 2013

Below is some basic code that generates a stacked graph from an RRD.
However, I want to generate a graph based on an array of RRDs.  The only
thing I have come up with is create a new RRD for every array and then
graph that.  There has to be a way given a hash of arrays:

$combined{$NameOfGraph} = @rrdfiles

that I can generate the equivalent of the below. the length of @rrdfiles
changes depending on the $NameOfGraph.

#!/usr/bin/perl -w
use strict;
use RRDs;
use Data::Dumper;

my $rrdfile = "exampleGraph.rdd";
my $NameOfGraph = "Example";
   RRDs::graph "$NameOfGraph",
    "--title", "APstats",
    "--start", "now-48h",
    "--vertical-label=Active Users",
    "GPRINT:amax:%6.2lf %Susers",
    "GPRINT:gmax:%6.2lf %Susers",

More information about the rrd-users mailing list