mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 15:44:21 +02:00
fix(hpe/simplivity): authentication (#3407)
This commit is contained in:
parent
8e7953d3a4
commit
eef428f207
@ -132,7 +132,6 @@ sub json_decode {
|
|||||||
sub build_options_for_httplib {
|
sub build_options_for_httplib {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
$self->{option_results}->{hostname} = $self->{hostname};
|
|
||||||
$self->{option_results}->{port} = $self->{port};
|
$self->{option_results}->{port} = $self->{port};
|
||||||
$self->{option_results}->{proto} = $self->{proto};
|
$self->{option_results}->{proto} = $self->{proto};
|
||||||
}
|
}
|
||||||
@ -167,6 +166,7 @@ sub get_auth_token {
|
|||||||
(defined($md5_secret_cache) && $md5_secret_cache ne $md5_secret)) {
|
(defined($md5_secret_cache) && $md5_secret_cache ne $md5_secret)) {
|
||||||
my ($content) = $self->{http}->request(
|
my ($content) = $self->{http}->request(
|
||||||
method => 'POST',
|
method => 'POST',
|
||||||
|
hostname => 'simplivity@' . $self->{hostname},
|
||||||
url_path => '/api/oauth/token',
|
url_path => '/api/oauth/token',
|
||||||
post_param => [
|
post_param => [
|
||||||
'grant_type=password',
|
'grant_type=password',
|
||||||
@ -212,6 +212,7 @@ sub request_api {
|
|||||||
|
|
||||||
my $content = $self->{http}->request(
|
my $content = $self->{http}->request(
|
||||||
method => 'GET',
|
method => 'GET',
|
||||||
|
hostname => $self->{hostname},
|
||||||
url_path => $options{endpoint},
|
url_path => $options{endpoint},
|
||||||
get_param => $options{get_param},
|
get_param => $options{get_param},
|
||||||
warning_status => '',
|
warning_status => '',
|
||||||
@ -224,6 +225,8 @@ sub request_api {
|
|||||||
$self->clean_token(statefile => $self->{cache});
|
$self->clean_token(statefile => $self->{cache});
|
||||||
$self->get_auth_token(statefile => $self->{cache});
|
$self->get_auth_token(statefile => $self->{cache});
|
||||||
$content = $self->{http}->request(
|
$content = $self->{http}->request(
|
||||||
|
method => 'GET',
|
||||||
|
hostname => $self->{hostname},
|
||||||
url_path => $options{endpoint},
|
url_path => $options{endpoint},
|
||||||
get_param => $options{get_param},
|
get_param => $options{get_param},
|
||||||
warning_status => '', unknown_status => '', critical_status => ''
|
warning_status => '', unknown_status => '', critical_status => ''
|
||||||
|
@ -166,7 +166,7 @@ Check virtual machines.
|
|||||||
|
|
||||||
=over 8
|
=over 8
|
||||||
|
|
||||||
=item B<--filter-name>
|
=item B<--filter-vm-name>
|
||||||
|
|
||||||
Filter virtual machines by virtual machine name.
|
Filter virtual machines by virtual machine name.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user