mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-28 08:04:36 +02:00
parent
5196ee7b79
commit
5e9cc05baf
@ -55,6 +55,7 @@ sub new {
|
||||
{
|
||||
"warning:s" => { name => 'warning' },
|
||||
"critical:s" => { name => 'critical' },
|
||||
"filter:s" => { name => 'filter' },
|
||||
});
|
||||
|
||||
return $self;
|
||||
@ -106,6 +107,12 @@ sub run {
|
||||
$descr = $hrDeviceIndex . '#' . $prtInputIndex;
|
||||
}
|
||||
|
||||
if (defined($self->{option_results}->{filter}) && $self->{option_results}->{filter} ne '' &&
|
||||
$descr !~ /$self->{option_results}->{filter}/) {
|
||||
$self->{output}->output_add(long_msg => "Skipping tray '$descr': not matching filter.");
|
||||
next;
|
||||
}
|
||||
|
||||
if (!defined($unit_managed{$unit})) {
|
||||
$self->{output}->output_add(long_msg => "Skipping input '$descr': unit not managed.");
|
||||
next;
|
||||
@ -161,6 +168,10 @@ Threshold warning in percent.
|
||||
|
||||
Threshold critical in percent.
|
||||
|
||||
=item B<--filter>
|
||||
|
||||
Filter tray to check (can use a regexp).
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
Loading…
x
Reference in New Issue
Block a user