Fix check_pve_sudo for single node monitoring

tags/zabbix-agent-addons-0.2.37-1
Daniel Berteaud 7 years ago
parent 4e94735f0e
commit 37405cd71d
  1. 9
      zabbix_scripts/check_pve_sudo

@ -23,7 +23,14 @@ GetOptions(
if ($cluster){
my $cluster = from_json(qx($pvesh get /cluster/status 2>/dev/null));
$json->{status}->{all_online} = 1;
# Set default values so monitoring works for single node, without cluster setup
$json->{status} = {
all_online => 1,
quorate => 1,
nodes => 1,
name => 'default',
version => 1
};
my @nodes = ();
foreach my $item (@{$cluster}){
if ($item->{type} eq 'cluster'){

Loading…
Cancel
Save