Fix Zimbra discovery and check scripts
This commit is contained in:
parent
1950abbc0f
commit
31ccccd2e0
|
@ -45,7 +45,7 @@ my $output = {};
|
|||
|
||||
if (defined $status){
|
||||
foreach my $line (qx($zmcontrol status)){
|
||||
if ($line =~ m/^\s+(\w+)\s+(Running|Stopped)/){
|
||||
if ($line =~ m/^\s+(\w+)(\swebapp)?\s+(Running|Stopped)/){
|
||||
$output->{$1} = ($2 eq 'Running') ? 1 : 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,8 +6,7 @@ use Getopt::Long;
|
|||
use Net::Domain qw(hostfqdn);
|
||||
use Data::Dumper;
|
||||
|
||||
my $json;
|
||||
@{$json->{data}} = ();
|
||||
my $json = [];
|
||||
|
||||
my $pretty = 0;
|
||||
my $services = 1;
|
||||
|
@ -47,7 +46,7 @@ if ($services){
|
|||
};
|
||||
foreach my $service (qx($zmprov getServer $hostname zimbraServiceEnabled)){
|
||||
if ($service =~ m/^zimbraServiceEnabled:\s+(\w+)/){
|
||||
push @{$json->{data}}, {
|
||||
push @{$json}, {
|
||||
'{#ZM_SERVICE}' => $1
|
||||
};
|
||||
}
|
||||
|
@ -55,7 +54,7 @@ if ($services){
|
|||
} elsif ($servers){
|
||||
foreach my $server (qx($zmprov getAllServers)){
|
||||
chomp $server;
|
||||
push @{$json->{data}}, {
|
||||
push @{$json}, {
|
||||
'{#ZM_SERVER}' => $server
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue