enhance indent
This commit is contained in:
parent
c9aa044ff2
commit
a85fc16ea4
|
@ -32,7 +32,7 @@ sub new {
|
||||||
|
|
||||||
if (!defined($options{noptions}) || $options{noptions} != 1) {
|
if (!defined($options{noptions}) || $options{noptions} != 1) {
|
||||||
$options{options}->add_options(arguments => {
|
$options{options}->add_options(arguments => {
|
||||||
"curl-opt:s@" => { name => 'curl_opt' },
|
'curl-opt:s@' => { name => 'curl_opt' },
|
||||||
});
|
});
|
||||||
$options{options}->add_help(package => __PACKAGE__, sections => 'BACKEND CURL OPTIONS', once => 1);
|
$options{options}->add_help(package => __PACKAGE__, sections => 'BACKEND CURL OPTIONS', once => 1);
|
||||||
}
|
}
|
||||||
|
@ -45,10 +45,16 @@ sub new {
|
||||||
sub check_options {
|
sub check_options {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
centreon::plugins::misc::mymodule_load(output => $self->{output}, module => 'Net::Curl::Easy',
|
centreon::plugins::misc::mymodule_load(
|
||||||
error_msg => "Cannot load module 'Net::Curl::Easy'.");
|
output => $self->{output},
|
||||||
centreon::plugins::misc::mymodule_load(output => $self->{output}, module => 'centreon::plugins::backend::http::curlconstants',
|
module => 'Net::Curl::Easy',
|
||||||
error_msg => "Cannot load module 'centreon::plugins::backend::http::curlconstants'.");
|
error_msg => "Cannot load module 'Net::Curl::Easy'."
|
||||||
|
);
|
||||||
|
centreon::plugins::misc::mymodule_load(
|
||||||
|
output => $self->{output},
|
||||||
|
module => 'centreon::plugins::backend::http::curlconstants',
|
||||||
|
error_msg => "Cannot load module 'centreon::plugins::backend::http::curlconstants'."
|
||||||
|
);
|
||||||
$self->{constant_cb} = \¢reon::plugins::backend::http::curlconstants::get_constant_value;
|
$self->{constant_cb} = \¢reon::plugins::backend::http::curlconstants::get_constant_value;
|
||||||
|
|
||||||
foreach (('unknown_status', 'warning_status', 'critical_status')) {
|
foreach (('unknown_status', 'warning_status', 'critical_status')) {
|
||||||
|
@ -373,8 +379,10 @@ sub request {
|
||||||
my $short_msg = $self->{response_code} . ' ' .
|
my $short_msg = $self->{response_code} . ' ' .
|
||||||
(defined($http_code_explained->{$self->{response_code}}) ? $http_code_explained->{$self->{response_code}} : 'unknown');
|
(defined($http_code_explained->{$self->{response_code}}) ? $http_code_explained->{$self->{response_code}} : 'unknown');
|
||||||
|
|
||||||
$self->{output}->output_add(severity => $status,
|
$self->{output}->output_add(
|
||||||
short_msg => $short_msg);
|
severity => $status,
|
||||||
|
short_msg => $short_msg
|
||||||
|
);
|
||||||
$self->{output}->display();
|
$self->{output}->display();
|
||||||
$self->{output}->exit();
|
$self->{output}->exit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,8 +33,8 @@ sub new {
|
||||||
|
|
||||||
if (!defined($options{noptions}) || $options{noptions} != 1) {
|
if (!defined($options{noptions}) || $options{noptions} != 1) {
|
||||||
$options{options}->add_options(arguments => {
|
$options{options}->add_options(arguments => {
|
||||||
"ssl:s" => { name => 'ssl' },
|
'ssl:s' => { name => 'ssl' },
|
||||||
"ssl-opt:s@" => { name => 'ssl_opt' },
|
'ssl-opt:s@' => { name => 'ssl_opt' },
|
||||||
});
|
});
|
||||||
$options{options}->add_help(package => __PACKAGE__, sections => 'BACKEND LWP OPTIONS', once => 1);
|
$options{options}->add_help(package => __PACKAGE__, sections => 'BACKEND LWP OPTIONS', once => 1);
|
||||||
}
|
}
|
||||||
|
@ -263,8 +263,10 @@ sub request {
|
||||||
$self->{response}->www_authenticate =~ /(\S+)/);
|
$self->{response}->www_authenticate =~ /(\S+)/);
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->{output}->output_add(severity => $status,
|
$self->{output}->output_add(
|
||||||
short_msg => $short_msg);
|
severity => $status,
|
||||||
|
short_msg => $short_msg
|
||||||
|
);
|
||||||
$self->{output}->display();
|
$self->{output}->display();
|
||||||
$self->{output}->exit();
|
$self->{output}->exit();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue