Show
Ignore:
Timestamp:
07/01/08 15:57:07 (10 years ago)
Author:
Mark Harrison <mark@omniti.com>
git-committer:
Mark Harrison <mark@omniti.com> 1214927827 +0000
git-parent:

[22ac6469b995e21fe0bd0d3f0c1aa0bf567ac6ed]

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

Moving the fresh_status and set_status code outside of the modules themselves,
making module development simpler. Also fixed an issue with the fresh_status
function where it didn't return a cached message, and resmon showed nothing
for the message. refs #1

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

Files:

Legend:

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

    r748aca8 rae22e3b  
    66sub handler { 
    77  my $arg = shift; 
    8   my $os = $arg->fresh_status(); 
    9   return $os if $os; 
    108  my $proc = $arg->{'object'}; 
    119  my $output = cache_command("/usr/sbin/fmadm faulty | sed '1,2d'|grep -v -- '^----'", 500); 
     
    1311    $output =~s /\n/:/gs; 
    1412    $output =~s /\s+/ /gs; 
    15     return $arg->set_status("BAD($output)")
     13    return "BAD($output)"
    1614  } 
    17   return $arg->set_status("OK(no faults)")
     15  return "OK(no faults)"
    1816}; 
    19171;