Refs #5425
This commit is contained in:
parent
98cd9fc850
commit
8aebe686b5
|
@ -60,6 +60,11 @@ sub new {
|
||||||
if (!defined($options{noptions})) {
|
if (!defined($options{noptions})) {
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments =>
|
||||||
{
|
{
|
||||||
|
"remote" => { name => 'remote' },
|
||||||
|
"ssh-address:s" => { name => 'ssh_address' },
|
||||||
|
"ssh-option:s@" => { name => 'ssh_option' },
|
||||||
|
"ssh-path:s" => { name => 'ssh_path' },
|
||||||
|
"ssh-command:s" => { name => 'ssh_command', default => 'ssh' },
|
||||||
"navicli-command:s" => { name => 'navicli_command', default => 'navicli' },
|
"navicli-command:s" => { name => 'navicli_command', default => 'navicli' },
|
||||||
"navicli-path:s" => { name => 'navicli_path', default => '/opt/Navisphere/bin' },
|
"navicli-path:s" => { name => 'navicli_path', default => '/opt/Navisphere/bin' },
|
||||||
"naviseccli-command:s" => { name => 'naviseccli_command', default => 'naviseccli' },
|
"naviseccli-command:s" => { name => 'naviseccli_command', default => 'naviseccli' },
|
||||||
|
@ -231,6 +236,26 @@ my navisphere manage
|
||||||
|
|
||||||
=over 8
|
=over 8
|
||||||
|
|
||||||
|
=item B<--remote>
|
||||||
|
|
||||||
|
Execute command remotely in 'ssh'.
|
||||||
|
|
||||||
|
=item B<--ssh-address>
|
||||||
|
|
||||||
|
Specify ssh address target (default: use hostname option)
|
||||||
|
|
||||||
|
=item B<--ssh-option>
|
||||||
|
|
||||||
|
Specify multiple options like the user (example: --ssh-option='-l=centreon-engine" --ssh-option='-p=52").
|
||||||
|
|
||||||
|
=item B<--ssh-path>
|
||||||
|
|
||||||
|
Specify ssh command path (default: none)
|
||||||
|
|
||||||
|
=item B<--ssh-command>
|
||||||
|
|
||||||
|
Specify ssh command (default: 'ssh'). Useful to use 'plink'.
|
||||||
|
|
||||||
=item B<--navicli-path>
|
=item B<--navicli-path>
|
||||||
|
|
||||||
Specify navicli path (default: '/opt/Navisphere/bin')
|
Specify navicli path (default: '/opt/Navisphere/bin')
|
||||||
|
|
|
@ -178,7 +178,6 @@ my @states = (
|
||||||
['^unformatted$' , 'WARNING'],
|
['^unformatted$' , 'WARNING'],
|
||||||
['^failed$' , 'CRITICAL'],
|
['^failed$' , 'CRITICAL'],
|
||||||
['^off$' , 'CRITICAL'],
|
['^off$' , 'CRITICAL'],
|
||||||
['^empty$' , 'CRITICAL'],
|
|
||||||
['^unsupported$' , 'CRITICAL'],
|
['^unsupported$' , 'CRITICAL'],
|
||||||
['^.*$' , 'CRITICAL'],
|
['^.*$' , 'CRITICAL'],
|
||||||
);
|
);
|
||||||
|
|
|
@ -39,7 +39,7 @@ use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
my @conditions = (
|
my @conditions = (
|
||||||
['^(?!(Present|Valid)$)' => 'CRITICAL'],
|
['^(?!(Present|Valid|Empty)$)' => 'CRITICAL'],
|
||||||
);
|
);
|
||||||
|
|
||||||
sub check {
|
sub check {
|
||||||
|
|
|
@ -103,7 +103,11 @@ sub execute {
|
||||||
push @$args, $rvalue if (defined($rvalue));
|
push @$args, $rvalue if (defined($rvalue));
|
||||||
}
|
}
|
||||||
|
|
||||||
push @$args, $options{options}->{hostname};
|
if (defined($options{options}->{ssh_address}) && $options{options}->{ssh_address} ne '') {
|
||||||
|
push @$args, $options{options}->{ssh_address};
|
||||||
|
} else {
|
||||||
|
push @$args, $options{options}->{hostname};
|
||||||
|
}
|
||||||
|
|
||||||
$sub_cmd = 'sudo ' if (defined($options{sudo}));
|
$sub_cmd = 'sudo ' if (defined($options{sudo}));
|
||||||
$sub_cmd .= $options{command_path} . '/' if (defined($options{command_path}));
|
$sub_cmd .= $options{command_path} . '/' if (defined($options{command_path}));
|
||||||
|
|
Loading…
Reference in New Issue