diff --git a/VERSION b/VERSION index 8c26915..dedcc7d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.9 +2.9.1 diff --git a/rpimonitor/rpimonitord b/rpimonitor/rpimonitord index 79a2443..1955014 100755 --- a/rpimonitor/rpimonitord +++ b/rpimonitor/rpimonitord @@ -41,10 +41,10 @@ sub new $this->Debug(3,""); $this->{'rrd'}=(); $this->{'daemon'}->{'confFiles'} = []; - $this->{'counter'}->{'static'} = 0; - $this->{'counter'}->{'dynamic'} = 0; - $this->{'counter'}->{'status'} = 0; - $this->{'counter'}->{'statistics'} = 0; + #$this->{'counter'}->{'static'} = 0; + #$this->{'counter'}->{'dynamic'} = 0; + #$this->{'counter'}->{'status'} = 0; + #$this->{'counter'}->{'statistics'} = 0; return $this; } @@ -145,7 +145,7 @@ sub LoadFile { my $this = shift; my $confFile = shift; - my $dict; + my @dict; $this->Debug(2,"Loading file: $confFile"); open ( FILE, $confFile) @@ -161,6 +161,7 @@ sub LoadFile my $current; my $next; my $root; + my $page = 0; # page = 0 for static and dynamic while (scalar(@leaves) > 0) { # While @leaves contains data $current ||= shift (@leaves); # If root is empty, shift the first element of @leaves to $current $root ||= $current; @@ -178,7 +179,12 @@ sub LoadFile } else { # If $next is not an integer -> We are in a hash if ($current =~ /^\d+$/) { # If $current is an integer -> we are in an array my $index = $current; - + + if ( ($previous eq 'status' ) || + ($previous eq 'statistics' ) ) + { + $page=$current; + } # Manage per file indexes unicity if ( ($root eq "static") || ($root eq "dynamic") || @@ -187,11 +193,11 @@ sub LoadFile ($previous eq "content") ) ) { # If $index is not in $dict, add it with counter++ - if ( ! $dict->{$root}[$current] ) + if ( ! $dict[$page]->{$root}[$current] ) { - $dict->{$root}[$current] = ++$this->{'counter'}->{$root}; + $dict[$page]->{$root}[$current] = ++$this->{'counter'}[$page]->{$root}; } - $index = $dict->{$root}[$current]; + $index = $dict[$page]->{$root}[$current]; } @{$tree}[$index-1] ||= {}; # If the branch is not an array, create an empty hash