#!/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 = ; close(RRD); chomp(@opts); RRDs::graph("-",@opts) or die(RRDs::error); } }