Changeset 5e2f9939b0beabaaa0b166fee5d535b0b53ce6fc

Show
Ignore:
Timestamp:
03/24/09 15:43:27 (9 years ago)
Author:
Mark Harrison <mark@omniti.com>
git-committer:
Mark Harrison <mark@omniti.com> 1237909407 +0000
git-parent:

[6906447522cf87b345c787f46883eb3c1503cd83]

git-author:
Mark Harrison <mark@omniti.com> 1237909407 +0000
Message:

Fixed a bug where the status message would be repeated on successive checks

Confusion between hash references and hashes (I was using a hash as a hash
ref, which somehow sort of worked) caused the values to be preserved between
successive calls to the function.

git-svn-id: https://labs.omniti.com/resmon/trunk@165 8c0face9-b7db-6ec6-c4b3-d5f7145c7d55

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lib/Resmon/Module/ZPOOLERRS.pm

    r6906447 r5e2f993  
    4040                } elsif ($line =~ /state: (.+)$/) { 
    4141                    # Pool state 
    42                     $errs->{$currpool} .= "$1 "; 
     42                    $errs{$currpool} = "$1 "; 
    4343                    if ($1 ne 'ONLINE') { 
    4444                        $status = "BAD"; 
     
    4747                    /The pool is formatted using an older on-disk format/) { 
    4848                    # Detect if the error is just that a pool needs upgrading. 
    49                     $errs->{$currpool} .= "- needs upgrade "; 
     49                    $errs{$currpool} .= "- needs upgrade "; 
    5050                    if ($warn_on_upgrade eq "yes" && $status != "BAD") { 
    5151                        $status = "WARNING"; 
     
    5555                    # Pool errors 
    5656                    if ($3 != 0 || $4 != 0 || $5 != 0) { 
    57                         $errs->{$currpool} .= 
     57                        $errs{$currpool} .= 
    5858                            "- $1:$2 w/Errs: R:$3 W:$4 Chk:$5 "; 
    5959                        $status = "BAD"; 
     
    6363            # Generate the status 
    6464            my $errstring = ""; 
    65             while (my ($k, $v) = each %$errs) { 
     65            while (my ($k, $v) = each %errs) { 
    6666                # $v should always contain a trailing space 
    6767                chop($v);