mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-26 23:24:27 +02:00
(fix): add check option of resource-type (#2151)
This commit is contained in:
parent
8e9b1ddc4b
commit
08a5b67b5b
@ -42,6 +42,14 @@ sub new {
|
|||||||
sub check_options {
|
sub check_options {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
$self->SUPER::init(%options);
|
$self->SUPER::init(%options);
|
||||||
|
|
||||||
|
if (!defined($self->{option_results}->{resource_type}) || $self->{option_results}->{resource_type} eq '') {
|
||||||
|
$self->{option_results}->{resource_type} = 'device';
|
||||||
|
}
|
||||||
|
if ($self->{option_results}->{resource_type} !~ /^device|network$/) {
|
||||||
|
$self->{output}->add_option_msg(short_msg => 'unknown resource type');
|
||||||
|
$self->{output}->option_exit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sub discovery_devices {
|
sub discovery_devices {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user