diff --git a/network/cisco/common/mode/memory.pm b/network/cisco/common/mode/memory.pm index ed344f9ee..23b9fab5f 100644 --- a/network/cisco/common/mode/memory.pm +++ b/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