This commit is contained in:
Quentin Garnier 2014-06-02 11:45:04 +02:00
parent 37969a64c2
commit cf581a2eef
1 changed files with 12 additions and 0 deletions

View File

@ -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