Changeset dacf1356b2d0c9374097040c9adf399a4756d83b

Show
Ignore:
Timestamp:
03/31/09 14:51:17 (5 years ago)
Author:
Mark Harrison <mark@omniti.com>
git-committer:
Mark Harrison <mark@omniti.com> 1238511077 +0000
git-parent:

[7b227a82217114afb1353bc581d01f7af4bd1996]

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

Support for minkbfree and warnkbfree - alert on absolute space free rather than a percentage

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

Files:

Legend:

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

    rae22e3b rdacf135  
    1111  my $output = cache_command("$dfcmd $devorpart", 120); 
    1212  my ($line) = grep(/$devorpart\s*/, split(/\n/, $output)); 
    13   if($line =~ /(\d+)%/) { 
    14     if($1 > $arg->{'limit'}) { 
    15       return "BAD($1% full)"; 
     13  if($line =~ /(\d+)\s+(\d+)%/) { 
     14    $status = "OK"; 
     15    # Check free space for an exact value in KB 
     16    if(exists $arg->{'minkbfree'} && $1 < $arg->{'minkbfree'}) { 
     17        $status = "BAD"; 
    1618    } 
    17     if(exists $arg->{'warnat'} && $1 > $arg->{'warnat'}) { 
    18       return "WARNING($1% full)"; 
     19    if(exists $arg->{'warnkbfree'} && $1 < $arg->{'warnkbfree'}) { 
     20        $status = "WARNING"; 
    1921    } 
    20     return "OK($1% full)"; 
     22    # Check for percentage used and alert over that value 
     23    if(exists $arg->{'limit'} && $2 > $arg->{'limit'}) { 
     24        $status = "BAD"; 
     25    } 
     26    if(exists $arg->{'warnat'} && $2 > $arg->{'warnat'}) { 
     27        $status = "WARNING" 
     28    } 
     29    return $status, "$2% full -- $1KB free"; 
    2130  } 
    22   return "BAD(0 -- no data)"; 
     31  return "BAD", "0 -- no data"; 
    2332} 
    24331;