mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-29 16:45:04 +02:00
add certs and key parameters to redis sentinel plugin
This commit is contained in:
parent
fe4e078287
commit
a2b579ae76
@ -49,6 +49,8 @@ sub new {
|
||||
'password:s' => { name => 'password' },
|
||||
'tls' => { name => 'tls' },
|
||||
'cacert:s' => { name => 'cacert' },
|
||||
'cert:s' => { name => 'cert' },
|
||||
'key:s' => { name => 'key' },
|
||||
'insecure' => { name => 'insecure' },
|
||||
'timeout:s' => { name => 'timeout' }
|
||||
});
|
||||
@ -82,6 +84,8 @@ sub check_options {
|
||||
$self->{tls} = defined($self->{option_results}->{tls}) ? 1 : 0;
|
||||
$self->{insecure} = defined($self->{option_results}->{insecure}) ? 1 : 0;
|
||||
$self->{cacert} = defined($self->{option_results}->{cacert}) && $self->{option_results}->{cacert} ne '' ? $self->{option_results}->{cacert} : '';
|
||||
$self->{cert} = defined($self->{option_results}->{cert}) && $self->{option_results}->{cert} ne '' ? $self->{option_results}->{cert} : '';
|
||||
$self->{key} = defined($self->{option_results}->{key}) && $self->{option_results}->{key} ne '' ? $self->{option_results}->{key} : '';
|
||||
|
||||
if ($self->{server} eq '') {
|
||||
$self->{output}->add_option_msg(short_msg => 'Need to specify --server option.');
|
||||
@ -159,6 +163,8 @@ sub get_extra_options {
|
||||
my $options = '';
|
||||
$options .= ' --tls' if ($self->{tls} == 1);
|
||||
$options .= " --cacert '" . $self->{cacert} . "'" if ($self->{cacert} ne '');
|
||||
$options .= " --cert '" . $self->{cert} . "'" if ($self->{cert} ne '');
|
||||
$options .= " --key '" . $self->{key} . "'" if ($self->{key} ne '');
|
||||
$options .= ' --insecure' if ($self->{insecure} == 1);
|
||||
$options .= " --user '" . $self->{username} . "'" if ($self->{username} ne '');
|
||||
$options .= " -a '" . $self->{password} . "'" if ($self->{password} ne '');
|
||||
@ -226,6 +232,14 @@ Establish a secure TLS connection (redis-cli >= 6.x mandatory).
|
||||
|
||||
CA Certificate file to verify with (redis-cli >= 6.x mandatory).
|
||||
|
||||
=item B<--cert>
|
||||
|
||||
Client certificate to authenticate with.
|
||||
|
||||
=item B<--key>
|
||||
|
||||
Private key file to authenticate with.
|
||||
|
||||
=item B<--insecure>
|
||||
|
||||
Allow insecure TLS connection by skipping cert validation (since redis-cli 6.2.0).
|
||||
|
Loading…
x
Reference in New Issue
Block a user