Fix indent sccm

This commit is contained in:
garnier-quentin 2019-06-25 14:12:37 +02:00
parent b540931edf
commit 31aebb316a
2 changed files with 36 additions and 32 deletions

View File

@ -146,17 +146,17 @@ sub new {
$self->{version} = '1.0';
$options{options}->add_options(arguments => {
"timeout:s" => { name => 'timeout', default => 30 },
"command:s" => { name => 'command', default => 'powershell.exe' },
"command-path:s" => { name => 'command_path' },
"command-options:s" => { name => 'command_options', default => '-InputFormat none -NoLogo -EncodedCommand' },
"no-ps" => { name => 'no_ps' },
"ps-exec-only" => { name => 'ps_exec_only' },
"warning-link-status:s" => { name => 'warning_link_status', default => '' },
"critical-link-status:s" => { name => 'critical_link_status', default => '' },
"warning-site-status:s" => { name => 'warning_site_status', default => '' },
"critical-site-status:s" => { name => 'critical_site_status', default => '' },
"timezone:s" => { name => 'timezone', default => 'UTC' },
'timeout:s' => { name => 'timeout', default => 30 },
'command:s' => { name => 'command', default => 'powershell.exe' },
'command-path:s' => { name => 'command_path' },
'command-options:s' => { name => 'command_options', default => '-InputFormat none -NoLogo -EncodedCommand' },
'no-ps' => { name => 'no_ps' },
'ps-exec-only' => { name => 'ps_exec_only' },
'warning-link-status:s' => { name => 'warning_link_status', default => '' },
'critical-link-status:s' => { name => 'critical_link_status', default => '' },
'warning-site-status:s' => { name => 'warning_site_status', default => '' },
'critical-site-status:s' => { name => 'critical_site_status', default => '' },
'timezone:s' => { name => 'timezone', default => 'UTC' },
});
return $self;
@ -178,11 +178,13 @@ sub manage_selection {
);
$self->{option_results}->{command_options} .= " " . $ps;
my ($stdout) = centreon::plugins::misc::execute(output => $self->{output},
options => $self->{option_results},
command => $self->{option_results}->{command},
command_path => $self->{option_results}->{command_path},
command_options => $self->{option_results}->{command_options});
my ($stdout) = centreon::plugins::misc::execute(
output => $self->{output},
options => $self->{option_results},
command => $self->{option_results}->{command},
command_path => $self->{option_results}->{command_path},
command_options => $self->{option_results}->{command_options}
);
if (defined($self->{option_results}->{ps_exec_only})) {
$self->{output}->output_add(severity => 'OK',
short_msg => $stdout);
@ -200,7 +202,7 @@ sub manage_selection {
}
if (!defined($decoded->{LinkStatus})) {
$self->{output}->add_option_msg(short_msg => "No database replication");
$self->{output}->add_option_msg(short_msg => 'No database replication');
$self->{output}->option_exit();
}
$self->{global}->{LinkStatus} = $map_link_status{$decoded->{LinkStatus}};

View File

@ -112,14 +112,14 @@ sub new {
$self->{version} = '1.0';
$options{options}->add_options(arguments => {
"timeout:s" => { name => 'timeout', default => 30 },
"command:s" => { name => 'command', default => 'powershell.exe' },
"command-path:s" => { name => 'command_path' },
"command-options:s" => { name => 'command_options', default => '-InputFormat none -NoLogo -EncodedCommand' },
"no-ps" => { name => 'no_ps' },
"ps-exec-only" => { name => 'ps_exec_only' },
"warning-status:s" => { name => 'warning_status', default => '' },
"critical-status:s" => { name => 'critical_status', default => '' },
'timeout:s' => { name => 'timeout', default => 30 },
'command:s' => { name => 'command', default => 'powershell.exe' },
'command-path:s' => { name => 'command_path' },
'command-options:s' => { name => 'command_options', default => '-InputFormat none -NoLogo -EncodedCommand' },
'no-ps' => { name => 'no_ps' },
'ps-exec-only' => { name => 'ps_exec_only' },
'warning-status:s' => { name => 'warning_status', default => '' },
'critical-status:s' => { name => 'critical_status', default => '' },
});
return $self;
@ -140,11 +140,13 @@ sub manage_selection {
);
$self->{option_results}->{command_options} .= " " . $ps;
my ($stdout) = centreon::plugins::misc::execute(output => $self->{output},
options => $self->{option_results},
command => $self->{option_results}->{command},
command_path => $self->{option_results}->{command_path},
command_options => $self->{option_results}->{command_options});
my ($stdout) = centreon::plugins::misc::execute(
output => $self->{output},
options => $self->{option_results},
command => $self->{option_results}->{command},
command_path => $self->{option_results}->{command_path},
command_options => $self->{option_results}->{command_options}
);
if (defined($self->{option_results}->{ps_exec_only})) {
$self->{output}->output_add(severity => 'OK',
short_msg => $stdout);
@ -161,7 +163,7 @@ sub manage_selection {
$self->{output}->option_exit();
}
if (ref($decoded) eq "ARRAY") {
if (ref($decoded) eq "ARRAY") {
foreach my $site (@{$decoded}) {
$self->{sites}->{$site->{SiteCode}} = {
display => $site->{SiteCode},
@ -172,7 +174,7 @@ sub manage_selection {
SecondarySiteCMUpdateStatus => $site->{SecondarySiteCMUpdateStatus},
};
}
} else {
} else {
$self->{sites}->{$decoded->{SiteCode}} = {
display => $decoded->{SiteCode},
SiteName => $decoded->{SiteName},