fix sccm site status

This commit is contained in:
garnier-quentin 2020-07-15 14:08:34 +02:00
parent b8ab97ee2b
commit 6a9f8b419d
2 changed files with 8 additions and 6 deletions

View File

@ -89,14 +89,16 @@ sub set_counters {
$self->{maps_counters}->{sites} = [
{ label => 'status', threshold => 0, set => {
key_values => [ { name => 'display' }, { name => 'SiteName' }, { name => 'Type' }, { name => 'Mode' },
{ name => 'Status' }, { name => 'SecondarySiteCMUpdateStatus' } ],
key_values => [
{ name => 'display' }, { name => 'SiteName' }, { name => 'Type' }, { name => 'Mode' },
{ name => 'Status' }, { name => 'SecondarySiteCMUpdateStatus' }
],
closure_custom_calc => $self->can('custom_status_calc'),
closure_custom_output => $self->can('custom_status_output'),
closure_custom_perfdata => sub { return 0; },
closure_custom_threshold_check => \&catalog_status_threshold,
closure_custom_threshold_check => \&catalog_status_threshold
}
},
}
];
}
@ -120,7 +122,7 @@ sub new {
'ps-exec-only' => { name => 'ps_exec_only' },
'ps-display' => { name => 'ps_display' },
'warning-status:s' => { name => 'warning_status', default => '' },
'critical-status:s' => { name => 'critical_status', default => '' },
'critical-status:s' => { name => 'critical_status', default => '' }
});
return $self;

View File

@ -67,7 +67,7 @@ Try {
$returnArray += $returnObject
}
$returnArray | ConvertTo-JSON-20
$returnArray | ConvertTo-JSON-20 -forceArray $true
} Catch {
Write-Host $Error[0].Exception
exit 1