Fix #5576
This commit is contained in:
parent
37969a64c2
commit
cf581a2eef
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue