Only gather info about online nodes

tags/zabbix-agent-addons-0.2.36-1
Daniel Berteaud 7 years ago
parent c146554291
commit ffe8c6b0a5
  1. 3
      zabbix_scripts/check_pve_sudo

@ -28,8 +28,9 @@ if ($cluster){
foreach my $item (@{$cluster}){ foreach my $item (@{$cluster}){
if ($item->{type} eq 'cluster'){ if ($item->{type} eq 'cluster'){
$json->{status}->{$_} = $item->{$_} foreach (qw(quorate nodes name version)); $json->{status}->{$_} = $item->{$_} foreach (qw(quorate nodes name version));
} elsif ($item->{type} eq 'node'){ } elsif ($item->{type} eq 'node' and $item->{online}){
push @nodes, $item->{name}; push @nodes, $item->{name};
} elsif ($item->{type} eq 'node'){
$json->{status}->{all_online} = 0 unless ($item->{online}); $json->{status}->{all_online} = 0 unless ($item->{online});
} }
} }

Loading…
Cancel
Save