mirror of https://github.com/mikaku/Monitorix.git
added new 'limit' functionality to 'lighttpd' graph
This commit is contained in:
parent
f1323455cf
commit
a382786ff1
|
@ -201,8 +201,8 @@ sub lighttpd_cgi {
|
||||||
my ($package, $config, $cgi) = @_;
|
my ($package, $config, $cgi) = @_;
|
||||||
|
|
||||||
my $lighttpd = $config->{lighttpd};
|
my $lighttpd = $config->{lighttpd};
|
||||||
my @rigid = split(',', $lighttpd->{rigid});
|
my @rigid = split(',', ($lighttpd->{rigid} || ""));
|
||||||
my @limit = split(',', $lighttpd->{limit});
|
my @limit = split(',', ($lighttpd->{limit} || ""));
|
||||||
my $tf = $cgi->{tf};
|
my $tf = $cgi->{tf};
|
||||||
my $colors = $cgi->{colors};
|
my $colors = $cgi->{colors};
|
||||||
my $graph = $cgi->{graph};
|
my $graph = $cgi->{graph};
|
||||||
|
@ -330,15 +330,7 @@ sub lighttpd_cgi {
|
||||||
if($title) {
|
if($title) {
|
||||||
main::graph_header($title, 2);
|
main::graph_header($title, 2);
|
||||||
}
|
}
|
||||||
undef(@riglim);
|
@riglim = @{setup_riglim($rigid[0], $limit[0])};
|
||||||
if(trim($rigid[0]) eq 1) {
|
|
||||||
push(@riglim, "--upper-limit=" . trim($limit[0]));
|
|
||||||
} else {
|
|
||||||
if(trim($rigid[0]) eq 2) {
|
|
||||||
push(@riglim, "--upper-limit=" . trim($limit[0]));
|
|
||||||
push(@riglim, "--rigid");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if($title) {
|
if($title) {
|
||||||
print(" <tr>\n");
|
print(" <tr>\n");
|
||||||
print(" <td bgcolor='$colors->{title_bg_color}'>\n");
|
print(" <td bgcolor='$colors->{title_bg_color}'>\n");
|
||||||
|
@ -383,7 +375,6 @@ sub lighttpd_cgi {
|
||||||
"--width=$width",
|
"--width=$width",
|
||||||
"--height=$height",
|
"--height=$height",
|
||||||
@riglim,
|
@riglim,
|
||||||
"--lower-limit=0",
|
|
||||||
$zoom,
|
$zoom,
|
||||||
@{$cgi->{version12}},
|
@{$cgi->{version12}},
|
||||||
@{$colors->{graph_colors}},
|
@{$colors->{graph_colors}},
|
||||||
|
@ -408,7 +399,6 @@ sub lighttpd_cgi {
|
||||||
"--width=$width",
|
"--width=$width",
|
||||||
"--height=$height",
|
"--height=$height",
|
||||||
@riglim,
|
@riglim,
|
||||||
"--lower-limit=0",
|
|
||||||
@{$cgi->{version12}},
|
@{$cgi->{version12}},
|
||||||
@{$colors->{graph_colors}},
|
@{$colors->{graph_colors}},
|
||||||
"DEF:lighttpd" . $e . "_busy=$rrd:lighttpd" . $e . "_busy:AVERAGE",
|
"DEF:lighttpd" . $e . "_busy=$rrd:lighttpd" . $e . "_busy:AVERAGE",
|
||||||
|
@ -438,15 +428,7 @@ sub lighttpd_cgi {
|
||||||
print(" </td>\n");
|
print(" </td>\n");
|
||||||
print(" <td valign='top' bgcolor='" . $colors->{title_bg_color} . "'>\n");
|
print(" <td valign='top' bgcolor='" . $colors->{title_bg_color} . "'>\n");
|
||||||
}
|
}
|
||||||
undef(@riglim);
|
@riglim = @{setup_riglim($rigid[1], $limit[1])};
|
||||||
if(trim($rigid[1]) eq 1) {
|
|
||||||
push(@riglim, "--upper-limit=" . trim($limit[1]));
|
|
||||||
} else {
|
|
||||||
if(trim($rigid[1]) eq 2) {
|
|
||||||
push(@riglim, "--upper-limit=" . trim($limit[1]));
|
|
||||||
push(@riglim, "--rigid");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
undef(@tmp);
|
undef(@tmp);
|
||||||
undef(@tmpz);
|
undef(@tmpz);
|
||||||
undef(@CDEF);
|
undef(@CDEF);
|
||||||
|
@ -482,7 +464,6 @@ sub lighttpd_cgi {
|
||||||
"--width=$width",
|
"--width=$width",
|
||||||
"--height=$height",
|
"--height=$height",
|
||||||
@riglim,
|
@riglim,
|
||||||
"--lower-limit=0",
|
|
||||||
$zoom,
|
$zoom,
|
||||||
@{$cgi->{version12}},
|
@{$cgi->{version12}},
|
||||||
@{$cgi->{version12_small}},
|
@{$cgi->{version12_small}},
|
||||||
|
@ -503,7 +484,6 @@ sub lighttpd_cgi {
|
||||||
"--width=$width",
|
"--width=$width",
|
||||||
"--height=$height",
|
"--height=$height",
|
||||||
@riglim,
|
@riglim,
|
||||||
"--lower-limit=0",
|
|
||||||
@{$cgi->{version12}},
|
@{$cgi->{version12}},
|
||||||
@{$cgi->{version12_small}},
|
@{$cgi->{version12_small}},
|
||||||
@{$colors->{graph_colors}},
|
@{$colors->{graph_colors}},
|
||||||
|
@ -528,15 +508,7 @@ sub lighttpd_cgi {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
undef(@riglim);
|
@riglim = @{setup_riglim($rigid[2], $limit[2])};
|
||||||
if(trim($rigid[2]) eq 1) {
|
|
||||||
push(@riglim, "--upper-limit=" . trim($limit[2]));
|
|
||||||
} else {
|
|
||||||
if(trim($rigid[2]) eq 2) {
|
|
||||||
push(@riglim, "--upper-limit=" . trim($limit[2]));
|
|
||||||
push(@riglim, "--rigid");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
undef(@tmp);
|
undef(@tmp);
|
||||||
undef(@tmpz);
|
undef(@tmpz);
|
||||||
undef(@CDEF);
|
undef(@CDEF);
|
||||||
|
@ -567,7 +539,6 @@ sub lighttpd_cgi {
|
||||||
"--width=$width",
|
"--width=$width",
|
||||||
"--height=$height",
|
"--height=$height",
|
||||||
@riglim,
|
@riglim,
|
||||||
"--lower-limit=0",
|
|
||||||
$zoom,
|
$zoom,
|
||||||
@{$cgi->{version12}},
|
@{$cgi->{version12}},
|
||||||
@{$cgi->{version12_small}},
|
@{$cgi->{version12_small}},
|
||||||
|
@ -588,7 +559,6 @@ sub lighttpd_cgi {
|
||||||
"--width=$width",
|
"--width=$width",
|
||||||
"--height=$height",
|
"--height=$height",
|
||||||
@riglim,
|
@riglim,
|
||||||
"--lower-limit=0",
|
|
||||||
@{$cgi->{version12}},
|
@{$cgi->{version12}},
|
||||||
@{$cgi->{version12_small}},
|
@{$cgi->{version12_small}},
|
||||||
@{$colors->{graph_colors}},
|
@{$colors->{graph_colors}},
|
||||||
|
|
Loading…
Reference in New Issue