Changeset 880c6cef6cac121bb61370f67d47c78025b3b0ef

Show
Ignore:
Timestamp:
04/25/11 21:37:36 (3 years ago)
Author:
Mark Harrison <mark@mivok.net>
git-committer:
Mark Harrison <mark@mivok.net> 1303767456 -0400
git-parent:

[e5c7025c2dfd4fd6f3a70759b51e8ab7a1efd1b2]

git-author:
Mark Harrison <mark@mivok.net> 1303767456 -0400
Message:

Improved output on errors/regex/equals checks

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • resources/check_resmon_metric

    re5c7025 r880c6ce  
    320320    # Make the HTTP request 
    321321    my $res = $ua->request($t); 
    322     die "CRITICAL: could not fetch\n" unless($res && $res->is_success); 
     322    die "could not fetch http://$host:$port$url - " . $res->status_line ."\n" 
     323        unless($res && $res->is_success); 
    323324    # Parse the xml 
    324325    eval { $ref = $xs->XMLin($res->content, ForceArray => 1); }; 
    325     die "CRITICAL: error parsing XML\n" if($@); 
     326    die "error parsing XML\n" if($@); 
    326327 
    327328    # Debugging 
     
    370371            $state = "CRITICAL"; 
    371372        } 
    372         print "$state: $value\n"; 
     373        print "$state: $metric = $value\n"; 
    373374    } 
    374375  
     
    379380            $state = "CRITICAL"; 
    380381        } 
    381         print "$state: $value\n"; 
     382        print "$state: $metric - $value\n"; 
    382383    } 
    383384