Compare commits

...

2 Commits

Author SHA1 Message Date
Daniel Berteaud 849170c10b Automatic commit of package [zabbix-agent-addons] release [0.2.161-1].
Created by command:

/usr/bin/tito tag
2022-01-21 12:19:45 +01:00
Daniel Berteaud 31ccccd2e0 Fix Zimbra discovery and check scripts 2022-01-21 12:19:29 +01:00
4 changed files with 9 additions and 7 deletions

View File

@ -1 +1 @@
0.2.160-1 ./
0.2.161-1 ./

View File

@ -4,7 +4,7 @@
Summary: Scripts for Zabbix monitoring
Name: zabbix-agent-addons
Version: 0.2.160
Version: 0.2.161
Release: 1%{?dist}
Source0: %{name}-%{version}.tar.gz
BuildArch: noarch
@ -106,6 +106,9 @@ fi
%endif
%changelog
* Fri Jan 21 2022 Daniel Berteaud <dbd@ehtrace.com> 0.2.161-1
- Fix Zimbra discovery and check scripts (dbd@ehtrace.com)
* Thu Jan 20 2022 Daniel Berteaud <dbd@ehtrace.com> 0.2.160-1
- Add a {#DOCKER_CONTAINER_STATUS} LLD macro (dbd@ehtrace.com)

View File

@ -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;
}
}

View File

@ -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
};
}