root/lib/Resmon/Module/FAULTS.pm

Revision 2f64690b2c2b2d649e332f3c98ec514702e4e1f4, 495 bytes (checked in by Brian Holcomb <holcomb@omniti.com>, 7 years ago)

add fmadm faults module

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

  • Property mode set to 100755
Line 
1 package Resmon::Module::FAULTS;
2 use Resmon::ExtComm qw/cache_command/;
3 use vars qw/@ISA/;
4 @ISA = qw/Resmon::Module/;
5
6 sub handler {
7   my $arg = shift;
8   my $os = $arg->fresh_status();
9   return $os if $os;
10   my $proc = $arg->{'object'};
11   my $output = cache_command("/usr/sbin/fmadm faulty | sed '1,2d'|grep -v -- '^----'", 500);
12   if($output) {
13     $output =~s /\n/:/gs;
14     $output =~s /\s+/ /gs;
15     return $arg->set_status("BAD($output)");
16   }
17   return $arg->set_status("OK(no faults)");
18 };
19
Note: See TracBrowser for help on using the browser.