diff --git a/apps/sccm/local/mode/databasereplicationstatus.pm b/apps/sccm/local/mode/databasereplicationstatus.pm index aaf148bb1..7867c1714 100644 --- a/apps/sccm/local/mode/databasereplicationstatus.pm +++ b/apps/sccm/local/mode/databasereplicationstatus.pm @@ -199,6 +199,10 @@ sub manage_selection { $self->{output}->option_exit(); } + if (!defined($decoded->{LinkStatus})) { + $self->{output}->add_option_msg(short_msg => "No database replication"); + $self->{output}->option_exit(); + } $self->{global}->{LinkStatus} = $map_link_status{$decoded->{LinkStatus}}; $self->{sites}->{$decoded->{Site1}} = { diff --git a/apps/sccm/local/mode/sitestatus.pm b/apps/sccm/local/mode/sitestatus.pm index 7024203d2..fb9c6db5d 100644 --- a/apps/sccm/local/mode/sitestatus.pm +++ b/apps/sccm/local/mode/sitestatus.pm @@ -161,16 +161,32 @@ sub manage_selection { $self->{output}->option_exit(); } - foreach my $site (@{$decoded}) { - $self->{sites}->{$site->{SiteCode}} = { - display => $site->{SiteCode}, - SiteName => $site->{SiteName}, - Type => $map_type{$site->{Type}}, - Mode => $map_mode{$site->{Mode}}, - Status => $map_status{$site->{Status}}, - SecondarySiteCMUpdateStatus => $site->{SecondarySiteCMUpdateStatus}, + if (ref($decoded) eq "ARRAY") { + foreach my $site (@{$decoded}) { + $self->{sites}->{$site->{SiteCode}} = { + display => $site->{SiteCode}, + SiteName => $site->{SiteName}, + Type => $map_type{$site->{Type}}, + Mode => $map_mode{$site->{Mode}}, + Status => $map_status{$site->{Status}}, + SecondarySiteCMUpdateStatus => $site->{SecondarySiteCMUpdateStatus}, + }; + } + } else { + $self->{sites}->{$decoded->{SiteCode}} = { + display => $decoded->{SiteCode}, + SiteName => $decoded->{SiteName}, + Type => $map_type{$decoded->{Type}}, + Mode => $map_mode{$decoded->{Mode}}, + Status => $map_status{$decoded->{Status}}, + SecondarySiteCMUpdateStatus => $decoded->{SecondarySiteCMUpdateStatus}, }; } + + if (scalar(keys %{$self->{sites}}) <= 0) { + $self->{output}->add_option_msg(short_msg => "No sites found."); + $self->{output}->option_exit(); + } } 1; diff --git a/centreon/common/powershell/sccm/databasereplicationstatus.pm b/centreon/common/powershell/sccm/databasereplicationstatus.pm index 027102e6c..ddf91532a 100644 --- a/centreon/common/powershell/sccm/databasereplicationstatus.pm +++ b/centreon/common/powershell/sccm/databasereplicationstatus.pm @@ -44,7 +44,10 @@ $ProgressPreference = "SilentlyContinue" Try { $ErrorActionPreference = "Stop" - $module = ${env:ProgramFiles(x86)} + "\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1" + $module = ${env:ProgramFiles} + "\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1" + If (-Not (Test-Path $module)) { + $module = ${env:ProgramFiles(x86)} + "\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1" + } Import-Module $module New-PSDrive -Name SCCMDrive -PSProvider "AdminUI.PS.Provider\CMSite" -Root $env:COMPUTERNAME -Description "SCCM Site" | Out-Null diff --git a/centreon/common/powershell/sccm/sitestatus.pm b/centreon/common/powershell/sccm/sitestatus.pm index 99510c358..a63f5f1ee 100644 --- a/centreon/common/powershell/sccm/sitestatus.pm +++ b/centreon/common/powershell/sccm/sitestatus.pm @@ -44,7 +44,10 @@ $ProgressPreference = "SilentlyContinue" Try { $ErrorActionPreference = "Stop" - $module = ${env:ProgramFiles(x86)} + "\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1" + $module = ${env:ProgramFiles} + "\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1" + If (-Not (Test-Path $module)) { + $module = ${env:ProgramFiles(x86)} + "\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1" + } Import-Module $module New-PSDrive -Name SCCMDrive -PSProvider "AdminUI.PS.Provider\CMSite" -Root $env:COMPUTERNAME -Description "SCCM Site" | Out-Null diff --git a/cloud/prometheus/exporters/nodeexporter/mode/cpudetailed.pm b/cloud/prometheus/exporters/nodeexporter/mode/cpudetailed.pm index b73882d18..926443bfe 100644 --- a/cloud/prometheus/exporters/nodeexporter/mode/cpudetailed.pm +++ b/cloud/prometheus/exporters/nodeexporter/mode/cpudetailed.pm @@ -320,17 +320,17 @@ Filter on a specific type (Must be a PromQL filter, Default: 'mode=~".*"') =item B<--warning-*> Threshold warning. -Can be: 'node-idle', 'node-wait', 'node-irq', 'node-nice', +Can be: 'node-idle', 'node-wait', 'node-interrupt', 'node-nice', 'node-softirq', 'node-steal', 'node-system', 'node-user', -'cpu-idle', 'cpu-wait', 'cpu-irq', 'cpu-nice', 'cpu-softirq', +'cpu-idle', 'cpu-wait', 'cpu-interrupt', 'cpu-nice', 'cpu-softirq', 'cpu-steal', 'cpu-system', 'cpu-user'. =item B<--critical-*> Threshold critical. -Can be: 'node-idle', 'node-wait', 'node-irq', 'node-nice', +Can be: 'node-idle', 'node-wait', 'node-interrupt', 'node-nice', 'node-softirq', 'node-steal', 'node-system', 'node-user', -'cpu-idle', 'cpu-wait', 'cpu-irq', 'cpu-nice', 'cpu-softirq', +'cpu-idle', 'cpu-wait', 'cpu-interrupt', 'cpu-nice', 'cpu-softirq', 'cpu-steal', 'cpu-system', 'cpu-user'. =item B<--extra-filter>