Fix check_pve_sudo for single node monitoring

This commit is contained in:
Daniel Berteaud 2018-06-05 10:03:34 +02:00
parent 4e94735f0e
commit 37405cd71d

View File

@ -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'){