This commit is contained in:
garnier-quentin 2019-06-03 18:04:58 +02:00
commit b4a46f4b0d
5 changed files with 40 additions and 14 deletions

View File

@ -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}} = {

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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>