added new 'limit' functionality to 'apache' graph

This commit is contained in:
Jordi Sanfeliu 2014-06-19 11:35:59 +02:00
parent 916e364faa
commit ac2b5ba737
1 changed files with 5 additions and 35 deletions

View File

@ -207,8 +207,8 @@ sub apache_cgi {
my ($package, $config, $cgi) = @_;
my $apache = $config->{apache};
my @rigid = split(',', $apache->{rigid});
my @limit = split(',', $apache->{limit});
my @rigid = split(',', ($apache->{rigid} || ""));
my @limit = split(',', ($apache->{limit} || ""));
my $tf = $cgi->{tf};
my $colors = $cgi->{colors};
my $graph = $cgi->{graph};
@ -331,15 +331,7 @@ sub apache_cgi {
if($title) {
main::graph_header($title, 2);
}
undef(@riglim);
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");
}
}
@riglim = @{setup_riglim($rigid[0], $limit[0])};
if($title) {
print(" <tr>\n");
print(" <td bgcolor='$colors->{title_bg_color}'>\n");
@ -384,7 +376,6 @@ sub apache_cgi {
"--width=$width",
"--height=$height",
@riglim,
"--lower-limit=0",
$zoom,
@{$cgi->{version12}},
@{$colors->{graph_colors}},
@ -409,7 +400,6 @@ sub apache_cgi {
"--width=$width",
"--height=$height",
@riglim,
"--lower-limit=0",
@{$cgi->{version12}},
@{$colors->{graph_colors}},
"DEF:apache" . $e . "_busy=$rrd:apache" . $e . "_busy:AVERAGE",
@ -439,15 +429,7 @@ sub apache_cgi {
print(" </td>\n");
print(" <td valign='top' bgcolor='" . $colors->{title_bg_color} . "'>\n");
}
undef(@riglim);
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");
}
}
@riglim = @{setup_riglim($rigid[1], $limit[1])};
undef(@tmp);
undef(@tmpz);
undef(@CDEF);
@ -478,7 +460,6 @@ sub apache_cgi {
"--width=$width",
"--height=$height",
@riglim,
"--lower-limit=0",
$zoom,
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@ -499,7 +480,6 @@ sub apache_cgi {
"--width=$width",
"--height=$height",
@riglim,
"--lower-limit=0",
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@{$colors->{graph_colors}},
@ -524,15 +504,7 @@ sub apache_cgi {
}
}
undef(@riglim);
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");
}
}
@riglim = @{setup_riglim($rigid[2], $limit[2])};
undef(@tmp);
undef(@tmpz);
undef(@CDEF);
@ -563,7 +535,6 @@ sub apache_cgi {
"--width=$width",
"--height=$height",
@riglim,
"--lower-limit=0",
$zoom,
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@ -584,7 +555,6 @@ sub apache_cgi {
"--width=$width",
"--height=$height",
@riglim,
"--lower-limit=0",
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@{$colors->{graph_colors}},