Changeset f4675da920553b92729011153d400cb7e3f84d06

Show
Ignore:
Timestamp:
05/06/08 21:31:26 (7 years ago)
Author:
Mark Harrison <mark@omniti.com>
git-committer:
Mark Harrison <mark@omniti.com> 1210109486 +0000
git-parent:

[11b1de2eefa207619583622f933404d66c50ea49]

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

Adding openbsd modules and fixing INODES.pm to deal with openbsd specifics

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

Files:

Legend:

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

    rce65f3a rf4675da  
    22use Resmon::ExtComm qw/cache_command/; 
    33use Resmon::Module; 
     4use Switch; 
    45use vars qw/@ISA/; 
    56@ISA = qw/Resmon::Module/; 
    67 
    7 my $dfcmd = ($^O eq 'solaris') ? 'df -Fufs -oi' : 'df -iP'; 
     8my $dfcmd; 
     9my $dfregex; 
     10 
     11switch ($^O) { 
     12    case 'solaris'  { $dfcmd = 'df -Fufs -oi'; 
     13                      $dfregex = '(\d+)\s+(\d+)\s+(\d+)\s+(\d+)%'} 
     14    case 'openbsd'  { $dfcmd = 'df -i'; 
     15                      $dfregex = '(\d+)\s+(\d+)\s+(\d+)\s+(\d+)%\s+(\d+)\s+(\d+)\s+(\d+)%'} 
     16    else            { $dfcmd = 'df -iP'; 
     17                      $dfregex = '(\d+)\s+(\d+)\s+(\d+)\s+(\d+)%'} 
     18
    819 
    920sub handler { 
     
    1425  my $output = cache_command($dfcmd, 30); 
    1526  my ($line) = grep(/$devorpart\s*/, split(/\n/, $output)); 
    16   if($line =~ /(\d+)\s+(\d+)\s+(\d+)\s+(\d+)%/) { 
     27  if($line =~ /$dfregex/) { 
    1728    if($4 <= $arg->{'limit'}) { 
    1829      return $arg->set_status("OK($2 $4% full)");