Fix check_pve_sudo for single node monitoring
This commit is contained in:
parent
4e94735f0e
commit
37405cd71d
|
@ -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…
Reference in New Issue
Block a user