parent
ca0234bb0e
commit
31728b5876
|
@ -86,6 +86,7 @@ sub new {
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$options{options}->add_options(arguments => {
|
$options{options}->add_options(arguments => {
|
||||||
|
'filter-feature:s' => { name => 'filter_feature' }
|
||||||
});
|
});
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
|
@ -105,13 +106,19 @@ sub manage_selection {
|
||||||
foreach my $feature (@{$result->{licenses}->{entry}}) {
|
foreach my $feature (@{$result->{licenses}->{entry}}) {
|
||||||
$feature->{expires} = lc($feature->{expires});
|
$feature->{expires} = lc($feature->{expires});
|
||||||
|
|
||||||
|
if (defined($self->{option_results}->{filter_feature}) && $self->{option_results}->{filter_feature} ne '' &&
|
||||||
|
$feature->{feature} !~ /$self->{option_results}->{filter_feature}/) {
|
||||||
|
$self->{output}->output_add(long_msg => "skipping '" . $feature->{feature} . "': no matching feature.", debug => 1);
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
|
||||||
# January 30, 2022
|
# January 30, 2022
|
||||||
my $dt;
|
my $dt;
|
||||||
if ($feature->{expires} =~ /^(\w+)\s+(\d+).*?(\d+)$/) {
|
if ($feature->{expires} =~ /^(\w+)\s+(\d+).*?(\d+)$/) {
|
||||||
$dt = DateTime->new(year => $3, month => $months->{$1}, day => $2);
|
$dt = DateTime->new(year => $3, month => $months->{$1}, day => $2);
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->{features}->{$feature->{feature}} = {
|
$self->{features}->{ $feature->{feature} } = {
|
||||||
feature => $feature->{feature},
|
feature => $feature->{feature},
|
||||||
expired => $feature->{expired},
|
expired => $feature->{expired},
|
||||||
expiry_date => $feature->{expires},
|
expiry_date => $feature->{expires},
|
||||||
|
@ -135,6 +142,10 @@ Check features licensing.
|
||||||
|
|
||||||
=over 8
|
=over 8
|
||||||
|
|
||||||
|
=item B<--filter-feature>
|
||||||
|
|
||||||
|
Filter license by feature (can be a regexp).
|
||||||
|
|
||||||
=item B<--warning-status>
|
=item B<--warning-status>
|
||||||
|
|
||||||
Set warning threshold for status.
|
Set warning threshold for status.
|
||||||
|
|
|
@ -39,7 +39,7 @@ sub new {
|
||||||
'system' => 'network::paloalto::ssh::mode::system'
|
'system' => 'network::paloalto::ssh::mode::system'
|
||||||
};
|
};
|
||||||
|
|
||||||
$self->{custom_modes}{ssh} = 'network::paloalto::ssh::custom::cli';
|
$self->{custom_modes}->{ssh} = 'network::paloalto::ssh::custom::cli';
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue