Changeset 37cace23f4db0b3b8de90f72ebec6308e97f991a

Show
Ignore:
Timestamp:
02/18/10 17:32:01 (5 years ago)
Author:
Mark Harrison <mark@omniti.com>
git-committer:
Mark Harrison <mark@omniti.com> 1266514321 +0000
git-parent:

[0e5f64d7572f24c142e6ef6357ee94733dad2b54]

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

Provide more metrics for the disk check

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

Files:

Legend:

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

    rdacf135 r37cace2  
    1111  my $output = cache_command("$dfcmd $devorpart", 120); 
    1212  my ($line) = grep(/$devorpart\s*/, split(/\n/, $output)); 
    13   if($line =~ /(\d+)\s+(\d+)%/) { 
     13  if($line =~ /(\d+)\s+(\d+)\s+(\d+)%/) { 
    1414    $status = "OK"; 
    1515    # Check free space for an exact value in KB 
    16     if(exists $arg->{'minkbfree'} && $1 < $arg->{'minkbfree'}) { 
     16    if(exists $arg->{'minkbfree'} && $2 < $arg->{'minkbfree'}) { 
    1717        $status = "BAD"; 
    1818    } 
    19     if(exists $arg->{'warnkbfree'} && $1 < $arg->{'warnkbfree'}) { 
     19    if(exists $arg->{'warnkbfree'} && $2 < $arg->{'warnkbfree'}) { 
    2020        $status = "WARNING"; 
    2121    } 
    2222    # Check for percentage used and alert over that value 
    23     if(exists $arg->{'limit'} && $2 > $arg->{'limit'}) { 
     23    if(exists $arg->{'limit'} && $3 > $arg->{'limit'}) { 
    2424        $status = "BAD"; 
    2525    } 
    26     if(exists $arg->{'warnat'} && $2 > $arg->{'warnat'}) { 
     26    if(exists $arg->{'warnat'} && $3 > $arg->{'warnat'}) { 
    2727        $status = "WARNING" 
    2828    } 
    29     return $status, "$2% full -- $1KB free"; 
     29    return $status, { 
     30        "message" => "$3% full -- $2KB free", 
     31        "usedkb" => "$1", 
     32        "freekb" => "$2", 
     33        "usedpercent" => "$3" 
     34    } 
    3035  } 
    3136  return "BAD", "0 -- no data";