import base struct
This commit is contained in:
24
cgi-bin/graph.pl
Executable file
24
cgi-bin/graph.pl
Executable file
@ -0,0 +1,24 @@
|
||||
#!/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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user