added new 'limit' functionality to 'ftp' graph

This commit is contained in:
Jordi Sanfeliu 2014-06-19 10:59:55 +02:00
parent ed389c47cd
commit 916e364faa
1 changed files with 5 additions and 34 deletions

View File

@ -306,8 +306,8 @@ sub ftp_cgi {
my ($package, $config, $cgi) = @_;
my $ftp = $config->{ftp};
my @rigid = split(',', $ftp->{rigid});
my @limit = split(',', $ftp->{limit});
my @rigid = split(',', ($ftp->{rigid} || ""));
my @limit = split(',', ($ftp->{limit} || ""));
my $tf = $cgi->{tf};
my $colors = $cgi->{colors};
my $graph = $cgi->{graph};
@ -409,14 +409,7 @@ sub ftp_cgi {
if($title) {
main::graph_header($title, 2);
}
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");
@ -476,7 +469,6 @@ sub ftp_cgi {
"--width=$width",
"--height=$height",
@riglim,
"--lower-limit=0",
$zoom,
@{$cgi->{version12}},
@{$colors->{graph_colors}},
@ -502,7 +494,6 @@ sub ftp_cgi {
"--width=$width",
"--height=$height",
@riglim,
"--lower-limit=0",
@{$cgi->{version12}},
@{$colors->{graph_colors}},
"DEF:retr=$rrd:ftp_retr:AVERAGE",
@ -534,15 +525,7 @@ sub ftp_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);
@ -583,7 +566,6 @@ sub ftp_cgi {
"--width=$width",
"--height=$height",
@riglim,
"--lower-limit=0",
$zoom,
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@ -607,7 +589,6 @@ sub ftp_cgi {
"--width=$width",
"--height=$height",
@riglim,
"--lower-limit=0",
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@{$colors->{graph_colors}},
@ -634,15 +615,7 @@ sub ftp_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);
@ -680,7 +653,6 @@ sub ftp_cgi {
"--width=$width",
"--height=$height",
@riglim,
"--lower-limit=0",
$zoom,
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@ -702,7 +674,6 @@ sub ftp_cgi {
"--width=$width",
"--height=$height",
@riglim,
"--lower-limit=0",
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@{$colors->{graph_colors}},