2015-10-05 11:28:14 +02:00

25 lines
422 B
Perl
Executable File

#!/usr/bin/perl
use strict;
use warnings;
use RRDs;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
my $TMPLpath = "/var/www/mrtg/tmpl";
my $cgi = new CGI;
my $graph = $cgi->param('graph');
$|++;
print $cgi->header(-type => "image/png");# unless($ARGV[0]);
if($graph) {
if(open(RRD,"<$TMPLpath/$graph.tmpl")) {
my @opts = <RRD>;
close(RRD);
chomp(@opts);
RRDs::graph("-",@opts) or die(RRDs::error);
}
}