From 4c31629d604a1edb3ed2286735ad039f2d14a33a Mon Sep 17 00:00:00 2001 From: Quentin Garnier Date: Mon, 2 Jun 2014 11:45:04 +0200 Subject: [PATCH] Fix #5576 --- centreon-plugins/network/cisco/common/mode/memory.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/centreon-plugins/network/cisco/common/mode/memory.pm b/centreon-plugins/network/cisco/common/mode/memory.pm index ed344f9ee..23b9fab5f 100644 --- a/centreon-plugins/network/cisco/common/mode/memory.pm +++ b/centreon-plugins/network/cisco/common/mode/memory.pm @@ -50,6 +50,7 @@ sub new { { "warning:s" => { name => 'warning' }, "critical:s" => { name => 'critical' }, + "filter-pool:s" => { name => 'filter_pool' }, }); return $self; @@ -86,6 +87,13 @@ sub run { foreach my $oid (keys %$result) { next if ($oid !~ /^$oid_ciscoMemoryPoolName/); $oid =~ /\.([0-9]+)$/; + + if (defined($self->{option_results}->{filter_pool}) && $self->{option_results}->{filter_pool} ne '' && + $result->{$oid} !~ /$self->{option_results}->{filter_pool}/) { + $self->{output}->output_add(long_msg => "Skipping pool '" . $result->{$oid} . "'."); + next; + } + my $instance = $1; my $memory_name = $result->{$oid}; my $memory_used = $result->{$oid_ciscoMemoryPoolUsed . '.' . $instance}; @@ -141,6 +149,10 @@ Threshold warning in percent. Threshold critical in percent. +=item B<--filter-pool> + +Filter pool to check (can use regexp). + =back =cut