mirror of https://github.com/mikaku/Monitorix.git
added new 'limit' functionality to 'ftp' graph
This commit is contained in:
parent
ed389c47cd
commit
916e364faa
39
lib/ftp.pm
39
lib/ftp.pm
|
@ -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}},
|
||||
|
|
Loading…
Reference in New Issue