root/lib/Resmon/Module/ZIMBRA.pm

Revision 748aca8e44f7a19fb38f861ea67990fb00933a94, 489 bytes (checked in by Mark Harrison <mark@omniti.com>, 6 years ago)

Split out the modules from Modules.pm to the Modules/ directory. Also made
sure each module returned a true value.

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

  • Property mode set to 100644
Line 
1 package Resmon::Module::ZIMBRA;
2 use Resmon::ExtComm qw/cache_command/;
3 use Resmon::Module;
4 use vars qw/@ISA/;
5 @ISA = qw/Resmon::Module/;
6
7 sub handler {
8         my $arg = shift;
9         my $os = $arg->fresh_status();
10         return $os if $os;
11         my $unit = $arg->{'object'};
12         my $output = cache_command("su - zimbra -c 'zmcontrol status' | grep 'not running'", 500);
13         if($output) {
14                 $output =~s /\n/:/gs;
15                 return $arg->set_status("BAD($output)");
16         }
17         return $arg->set_status("OK(All services running)");
18 };
19 1;
Note: See TracBrowser for help on using the browser.