mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 23:54:18 +02:00
add check options
This commit is contained in:
parent
c846e123d3
commit
fd425f60b6
@ -85,6 +85,27 @@ sub check_options {
|
||||
push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status};
|
||||
}
|
||||
|
||||
if (!defined($self->{option_results}->{header}) || $self->{option_results}->{header} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "You need to specify --header option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
if (!defined($self->{option_results}->{data}) || $self->{option_results}->{data} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "You need to specify --data option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
if (!defined($self->{option_results}->{hostname}) || $self->{option_results}->{hostname} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "You need to specify --hostname option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
if (!defined($self->{option_results}->{tenant_id}) || $self->{option_results}->{tenant_id} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "You need to specify --tenant-id option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
if (!defined($self->{option_results}->{hypervisor_id}) || $self->{option_results}->{hypervisor_id} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "You need to specify --hypervisor-id option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
|
||||
$self->{http}->set_options(%{$self->{option_results}})
|
||||
}
|
||||
|
||||
|
@ -93,6 +93,27 @@ sub check_options {
|
||||
push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status};
|
||||
}
|
||||
|
||||
if (!defined($self->{option_results}->{header}) || $self->{option_results}->{header} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "You need to specify --header option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
if (!defined($self->{option_results}->{data}) || $self->{option_results}->{data} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "You need to specify --data option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
if (!defined($self->{option_results}->{hostname}) || $self->{option_results}->{hostname} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "You need to specify --hostname option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
if (!defined($self->{option_results}->{tenant_id}) || $self->{option_results}->{tenant_id} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "You need to specify --tenant-id option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
if (!defined($self->{option_results}->{instance_id}) || $self->{option_results}->{instance_id} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "You need to specify --instance-id option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
|
||||
$self->{http}->set_options(%{$self->{option_results}})
|
||||
}
|
||||
|
||||
|
@ -62,6 +62,23 @@ sub check_options {
|
||||
my ($self, %options) = @_;
|
||||
$self->SUPER::init(%options);
|
||||
|
||||
if (!defined($self->{option_results}->{header}) || $self->{option_results}->{header} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "You need to specify --header option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
if (!defined($self->{option_results}->{data}) || $self->{option_results}->{data} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "You need to specify --data option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
if (!defined($self->{option_results}->{hostname}) || $self->{option_results}->{hostname} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "You need to specify --hostname option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
if (!defined($self->{option_results}->{tenant_id}) || $self->{option_results}->{tenant_id} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "You need to specify --tenant-id option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
|
||||
$self->{http}->set_options(%{$self->{option_results}})
|
||||
}
|
||||
|
||||
|
@ -62,6 +62,23 @@ sub check_options {
|
||||
my ($self, %options) = @_;
|
||||
$self->SUPER::init(%options);
|
||||
|
||||
if (!defined($self->{option_results}->{header}) || $self->{option_results}->{header} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "You need to specify --header option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
if (!defined($self->{option_results}->{data}) || $self->{option_results}->{data} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "You need to specify --data option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
if (!defined($self->{option_results}->{hostname}) || $self->{option_results}->{hostname} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "You need to specify --hostname option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
if (!defined($self->{option_results}->{tenant_id}) || $self->{option_results}->{tenant_id} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "You need to specify --tenant-id option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
|
||||
$self->{http}->set_options(%{$self->{option_results}})
|
||||
}
|
||||
|
||||
|
@ -61,6 +61,19 @@ sub check_options {
|
||||
my ($self, %options) = @_;
|
||||
$self->SUPER::init(%options);
|
||||
|
||||
if (!defined($self->{option_results}->{header}) || $self->{option_results}->{header} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "You need to specify --header option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
if (!defined($self->{option_results}->{data}) || $self->{option_results}->{data} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "You need to specify --data option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
if (!defined($self->{option_results}->{hostname}) || $self->{option_results}->{hostname} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "You need to specify --hostname option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
|
||||
$self->{http}->set_options(%{$self->{option_results}})
|
||||
}
|
||||
|
||||
|
@ -62,6 +62,23 @@ sub check_options {
|
||||
my ($self, %options) = @_;
|
||||
$self->SUPER::init(%options);
|
||||
|
||||
if (!defined($self->{option_results}->{header}) || $self->{option_results}->{header} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "You need to specify --header option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
if (!defined($self->{option_results}->{data}) || $self->{option_results}->{data} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "You need to specify --data option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
if (!defined($self->{option_results}->{hostname}) || $self->{option_results}->{hostname} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "You need to specify --hostname option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
if (!defined($self->{option_results}->{tenant_id}) || $self->{option_results}->{tenant_id} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "You need to specify --tenant-id option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
|
||||
$self->{http}->set_options(%{$self->{option_results}})
|
||||
}
|
||||
|
||||
|
@ -86,6 +86,23 @@ sub check_options {
|
||||
push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status};
|
||||
}
|
||||
|
||||
if (!defined($self->{option_results}->{header}) || $self->{option_results}->{header} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "You need to specify --header option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
if (!defined($self->{option_results}->{data}) || $self->{option_results}->{data} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "You need to specify --data option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
if (!defined($self->{option_results}->{hostname}) || $self->{option_results}->{hostname} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "You need to specify --hostname option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
if (!defined($self->{option_results}->{network_id}) || $self->{option_results}->{network_id} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "You need to specify --network-id option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
|
||||
$self->{http}->set_options(%{$self->{option_results}})
|
||||
}
|
||||
|
||||
|
@ -86,6 +86,23 @@ sub check_options {
|
||||
push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status};
|
||||
}
|
||||
|
||||
if (!defined($self->{option_results}->{header}) || $self->{option_results}->{header} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "You need to specify --header option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
if (!defined($self->{option_results}->{data}) || $self->{option_results}->{data} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "You need to specify --data option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
if (!defined($self->{option_results}->{hostname}) || $self->{option_results}->{hostname} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "You need to specify --hostname option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
if (!defined($self->{option_results}->{port_id}) || $self->{option_results}->{port_id} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "You need to specify --port-id option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
|
||||
$self->{http}->set_options(%{$self->{option_results}})
|
||||
}
|
||||
|
||||
|
@ -94,6 +94,27 @@ sub check_options {
|
||||
push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status};
|
||||
}
|
||||
|
||||
if (!defined($self->{option_results}->{header}) || $self->{option_results}->{header} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "You need to specify --header option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
if (!defined($self->{option_results}->{data}) || $self->{option_results}->{data} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "You need to specify --data option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
if (!defined($self->{option_results}->{hostname}) || $self->{option_results}->{hostname} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "You need to specify --hostname option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
if (!defined($self->{option_results}->{tenant_id}) || $self->{option_results}->{tenant_id} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "You need to specify --tenant-id option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
if (!defined($self->{option_results}->{volume_id}) || $self->{option_results}->{volume_id} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => "You need to specify --volume-id option.");
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
|
||||
$self->{http}->set_options(%{$self->{option_results}})
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user