diff --git a/src/apps/wallix/bastion/snmp/mode/license.pm b/src/apps/wallix/bastion/snmp/mode/license.pm index d483251fe..4b370259e 100644 --- a/src/apps/wallix/bastion/snmp/mode/license.pm +++ b/src/apps/wallix/bastion/snmp/mode/license.pm @@ -191,7 +191,8 @@ sub new { bless $self, $class; $options{options}->add_options(arguments => { - 'unit:s' => { name => 'unit', default => 's' } + 'filter-category:s' => { name => 'filter_category' }, + 'unit:s' => { name => 'unit', default => 's' } }); return $self; @@ -209,6 +210,9 @@ sub check_options { sub add_license { my ($self, %options) = @_; + return if (defined($self->{option_results}->{filter_category}) && $self->{option_results}->{filter_category} ne '' && + $options{name} !~ /$self->{option_results}->{filter_category}/); + $self->{licenses}->{ $options{name} } = { name => $options{name}, used => $options{used} @@ -300,6 +304,15 @@ Check license. =over 8 +=item B<--filter-category> + +Filter licenses by category ('primary', 'secondary', 'resource'). + +=item B<--unit> + +Select the unit for the expired license threshold. May be 's' for seconds, 'm' for minutes, +'h' for hours, 'd' for days, 'w' for weeks. Default is seconds. + =item B<--warning-status> Set warning threshold for status. @@ -310,11 +323,6 @@ You can use the following variables: %{status} Set critical threshold for status (Default: '%{status} eq "expired"'). You can use the following variables: %{status} -=item B<--unit> - -Select the unit for expires threshold. May be 's' for seconds, 'm' for minutes, -'h' for hours, 'd' for days, 'w' for weeks. Default is seconds. - =item B<--warning-*> B<--critical-*> Thresholds.