This commit is contained in:
garnier-quentin 2019-06-03 15:50:14 +02:00
parent 988900b25e
commit 0a52548f08
1 changed files with 14 additions and 6 deletions

View File

@ -123,7 +123,8 @@ sub new {
$self->{version} = '1.0';
$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;
@ -301,11 +302,13 @@ sub manage_selection {
$self->{checked_memory} = 0;
$self->{memory} = {};
$self->check_memory_enhanced_pool();
$self->check_memory_pool();
$self->check_memory_process();
$self->check_memory_system_ext();
foreach (split /,/, $self->{option_results}->{check_order}) {
my $method = $self->can('check_memory_' . $_);
if ($method) {
$self->$method();
}
}
if ($self->{checked_memory} == 0) {
$self->{output}->add_option_msg(short_msg => "Cannot find memory informations");
$self->{output}->option_exit();
@ -334,6 +337,11 @@ Threshold critical in percent.
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
=cut