mirror of https://github.com/mikaku/Monitorix.git
3.0: improved configuration in system.rrd
This commit is contained in:
parent
d2bfe34701
commit
ecde5e611a
|
@ -286,6 +286,9 @@ sub system_update {
|
|||
sub system_cgi {
|
||||
my ($package, $config, $cgi) = @_;
|
||||
|
||||
my %system = %{$config->{system}};
|
||||
my @rigid = split(',', $system{rigid});
|
||||
my @limit = split(',', $system{limit});
|
||||
my $tf = $cgi->{tf};
|
||||
my $colors = $cgi->{colors};
|
||||
my $graph = $cgi->{graph};
|
||||
|
@ -385,11 +388,11 @@ sub system_cgi {
|
|||
if($title) {
|
||||
main::graph_header($title, 2);
|
||||
}
|
||||
if($config->{system1_rigid} eq 1) {
|
||||
push(@riglim, "--upper-limit=$config->{system1_limit}");
|
||||
if(trim($rigid[0]) eq 1) {
|
||||
push(@riglim, "--upper-limit=" . trim($limit[0]));
|
||||
} else {
|
||||
if($config->{system1_rigid} eq 2) {
|
||||
push(@riglim, "--upper-limit=$config->{system1_limit}");
|
||||
if(trim($rigid[0]) eq 2) {
|
||||
push(@riglim, "--upper-limit=" . trim($limit[0]));
|
||||
push(@riglim, "--rigid");
|
||||
}
|
||||
}
|
||||
|
@ -491,11 +494,11 @@ sub system_cgi {
|
|||
}
|
||||
|
||||
undef(@riglim);
|
||||
if($config->{system2_rigid} eq 1) {
|
||||
push(@riglim, "--upper-limit=$config->{system2_limit}");
|
||||
if(trim($rigid[1]) eq 1) {
|
||||
push(@riglim, "--upper-limit=" . trim($limit[1]));
|
||||
} else {
|
||||
if($config->{system2_rigid} eq 2) {
|
||||
push(@riglim, "--upper-limit=$config->{system2_limit}");
|
||||
if(trim($rigid[1]) eq 2) {
|
||||
push(@riglim, "--upper-limit=" . trim($limit[1]));
|
||||
push(@riglim, "--rigid");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -82,12 +82,10 @@ alert_rootfs_script = /path/to/script.sh
|
|||
|
||||
# SYSTEM graph
|
||||
# -----------------------------------------------------------------------------
|
||||
#<system>
|
||||
system1_rigid = 1
|
||||
system1_limit = 1
|
||||
system2_rigid = 0
|
||||
system2_limit = 100
|
||||
#</system>
|
||||
<system>
|
||||
rigid = 1, 0
|
||||
limit = 1, 100
|
||||
</system>
|
||||
|
||||
|
||||
# KERNEL graph
|
||||
|
|
Loading…
Reference in New Issue