enh(openldap): system-usage mode - missing informations management (#3063)

This commit is contained in:
qgarnier 2021-08-31 11:43:35 +02:00 committed by GitHub
parent 353b1b45f7
commit 5cf1f09efc
1 changed files with 6 additions and 1 deletions

View File

@ -184,10 +184,15 @@ sub manage_selection {
} }
} }
if (scalar(keys %{$self->{global}}) <= 0) {
$self->{output}->add_option_msg(short_msg => 'cannot get informations from OpenLDAP monitor backend');
$self->{output}->option_exit();
}
$self->{global}->{threads_active_prct} = $self->{global}->{threads_active} * 100 / $self->{global}->{threads_max} $self->{global}->{threads_active_prct} = $self->{global}->{threads_active} * 100 / $self->{global}->{threads_max}
if (defined($self->{global}->{threads_max}) && $self->{global}->{threads_max} > 0); if (defined($self->{global}->{threads_max}) && $self->{global}->{threads_max} > 0);
$self->{cache_name} = "openldap_" . $self->{mode} . '_' . $self->{option_results}->{hostname} . '_' . $self->{cache_name} = 'openldap_' . $self->{mode} . '_' . $self->{option_results}->{hostname} . '_' .
(defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all')); (defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all'));
} }