diff --git a/network/paloalto/ssh/mode/interfaces.pm b/network/paloalto/ssh/mode/interfaces.pm index df1b15163..34b654603 100644 --- a/network/paloalto/ssh/mode/interfaces.pm +++ b/network/paloalto/ssh/mode/interfaces.pm @@ -81,6 +81,7 @@ sub new { bless $self, $class; $options{options}->add_options(arguments => { + 'filter-name:s' => { name => 'filter_name' }, 'unknown-status:s' => { name => 'unknown_status', default => '' }, 'warning-status:s' => { name => 'warning_status', default => '' }, 'critical-status:s' => { name => 'critical_status', default => '%{state} ne "up"' }, @@ -108,6 +109,12 @@ sub manage_selection { $self->{global} = { total => 0 }; $self->{interface} = {}; foreach (@{$result->{hw}->{entry}}) { + if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && + $_->{name} !~ /$self->{option_results}->{filter_name}/) { + $self->{output}->output_add(long_msg => "skipping interface '" . $_->{name} . "': no matching filter.", debug => 1); + next; + } + $self->{interface}->{$_->{name}} = { display => $_->{name}, type => $_->{type}, @@ -123,10 +130,14 @@ __END__ =head1 MODE -Check vpn. +Check interfaces. =over 8 +=item B<--filter-name> + +Filter interface name (can be a regexp). + =item B<--unknown-status> Set unknown threshold for status (Default: ''). diff --git a/network/paloalto/ssh/mode/system.pm b/network/paloalto/ssh/mode/system.pm index dfd595972..ce68cc8cb 100644 --- a/network/paloalto/ssh/mode/system.pm +++ b/network/paloalto/ssh/mode/system.pm @@ -116,7 +116,10 @@ sub get_diff_time { # '2019/10/15 12:03:58 BST' return if ($options{time} !~ /^\s*(\d{4})\/(\d{2})\/(\d{2})\s+(\d+):(\d+):(\d+)\s+(\S+)/); - my $tz = $7 eq 'BST' ? 'GMT' : $7; + my $tz = $7; + $tz = 'GMT' if ($tz eq 'BST'); + $tz = 'Europe/Paris' if ($tz eq 'CEST'); + $tz = 'America/New_York' if ($tz eq 'EST'); my $dt = DateTime->new( year => $1, month => $2,