mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 15:44:21 +02:00
+ enhance telnet options
This commit is contained in:
parent
dc832594fd
commit
a41dfdb6b2
@ -75,7 +75,9 @@ sub check_options {
|
|||||||
sub read_scenario {
|
sub read_scenario {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
my $content_scenario = do {
|
my $content_scenario;
|
||||||
|
if (-f $self->{option_results}->{scenario}) {
|
||||||
|
$content_scenario = do {
|
||||||
local $/ = undef;
|
local $/ = undef;
|
||||||
if (!open my $fh, "<", $self->{option_results}->{scenario}) {
|
if (!open my $fh, "<", $self->{option_results}->{scenario}) {
|
||||||
$self->{output}->add_option_msg(short_msg => "Could not open file $self->{option_results}->{scenario} : $!");
|
$self->{output}->add_option_msg(short_msg => "Could not open file $self->{option_results}->{scenario} : $!");
|
||||||
@ -83,6 +85,9 @@ sub read_scenario {
|
|||||||
}
|
}
|
||||||
<$fh>;
|
<$fh>;
|
||||||
};
|
};
|
||||||
|
} else {
|
||||||
|
$content_scenario = $self->{option_results}->{scenario};
|
||||||
|
}
|
||||||
|
|
||||||
eval {
|
eval {
|
||||||
$self->{json_scenario} = decode_json($content_scenario);
|
$self->{json_scenario} = decode_json($content_scenario);
|
||||||
@ -171,7 +176,8 @@ Check telnet scenario execution
|
|||||||
|
|
||||||
=item B<--scenario>
|
=item B<--scenario>
|
||||||
|
|
||||||
Scenario used (Required)
|
Scenario used (Required).
|
||||||
|
Can be a file or json content.
|
||||||
|
|
||||||
=item B<--timeout>
|
=item B<--timeout>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user