This commit is contained in:
garnier-quentin 2019-06-03 15:50:14 +02:00
parent 6a1fbdb541
commit 497c797902
1 changed files with 14 additions and 6 deletions

View File

@ -123,7 +123,8 @@ sub new {
$self->{version} = '1.0'; $self->{version} = '1.0';
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {
"filter-pool:s" => { name => 'filter_pool' }, 'filter-pool:s' => { name => 'filter_pool' },
'check-order:s' => { name => 'check_order', default => 'enhanced_pool,pool,process,system_ext' },
}); });
return $self; return $self;
@ -301,10 +302,12 @@ sub manage_selection {
$self->{checked_memory} = 0; $self->{checked_memory} = 0;
$self->{memory} = {}; $self->{memory} = {};
$self->check_memory_enhanced_pool(); foreach (split /,/, $self->{option_results}->{check_order}) {
$self->check_memory_pool(); my $method = $self->can('check_memory_' . $_);
$self->check_memory_process(); if ($method) {
$self->check_memory_system_ext(); $self->$method();
}
}
if ($self->{checked_memory} == 0) { if ($self->{checked_memory} == 0) {
$self->{output}->add_option_msg(short_msg => "Cannot find memory informations"); $self->{output}->add_option_msg(short_msg => "Cannot find memory informations");
@ -334,6 +337,11 @@ Threshold critical in percent.
Filter pool to check (can use regexp). Filter pool to check (can use regexp).
=item B<--check-order>
Check memory in standard cisco mib. If you have some issue (wrong memory information in a specific mib), you can change the order
(Default: 'enhanced_pool,pool,process,system_ext').
=back =back
=cut =cut