use RRDs;
use File::Spec::Functions;
+$ENV{"RRDCACHED_ADDRESS"} = "/var/run/munin/rrdcached.sock";
+
our %graph_types = (cpu => "xen_cpu");
our %formats = qw(svg image/svg+xml png image/png eps application/postscript pdf application/pdf);
$type =~ m|^(\w+)$| or die "Invalid graph type";
$type = $graph_types{$1} or die "Invalid graph type";
-my $path = catfile(GRAPH_DIR, "*-$type-????????_????_????_????_????????????-?.rrd");
+my $path = catfile(GRAPH_DIR, "*-$type-uuid_????????_????_????_????_????????????-?.rrd");
my @files = glob $path or die "No data found";
push @args, "--start", "-".$days."d";
"#0080FF", "#FF8000", "#800000", "#FB31FB");
my $color_index = 0;
-foreach my $uuid (keys %uuids) {
+foreach my $uuid (sort keys %uuids) {
my @uuid_files = grep { m|$uuid-.\.rrd$| } @files;
foreach my $i (0..$#uuid_files) {
$uuid_files[$i] =~ m|^([^:]+)$|;