added new 'limit' functionality to 'system' graph

This commit is contained in:
Jordi Sanfeliu 2014-06-17 19:30:06 +02:00
parent d337e61cf2
commit bf04204ef7
1 changed files with 2 additions and 21 deletions

View File

@ -449,14 +449,7 @@ sub system_cgi {
if($title) { if($title) {
main::graph_header($title, 2); main::graph_header($title, 2);
} }
if(trim($rigid[0]) eq 1) { @riglim = @{setup_riglim($rigid[0], $limit[0])};
push(@riglim, "--upper-limit=" . trim($limit[0]));
} else {
if(trim($rigid[0]) eq 2) {
push(@riglim, "--upper-limit=" . trim($limit[0]));
push(@riglim, "--rigid");
}
}
my $uptimeline; my $uptimeline;
if($RRDs::VERSION > 1.2) { if($RRDs::VERSION > 1.2) {
$uptimeline = "COMMENT:system uptime\\: " . get_uptime($config) . "\\c"; $uptimeline = "COMMENT:system uptime\\: " . get_uptime($config) . "\\c";
@ -511,7 +504,6 @@ sub system_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}},
@ -535,7 +527,6 @@ sub system_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:load1=$rrd:system_load1:AVERAGE", "DEF:load1=$rrd:system_load1:AVERAGE",
@ -564,15 +555,7 @@ sub system_cgi {
print(" </td>\n"); print(" </td>\n");
print(" <td bgcolor='" . $colors->{title_bg_color} . "'>\n"); print(" <td 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);
@ -600,7 +583,6 @@ sub system_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}},
@ -624,7 +606,6 @@ sub system_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}},