Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 20 additions & 10 deletions src/storage/dell/me4/restapi/mode/interfaces.pm
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ sub new {
bless $self, $class;

$options{options}->add_options(arguments => {
'filter-port-name:s' => { name => 'filter_port_name' }
'filter-port-name:s' => { name => 'filter_port_name' },
'omit-phy-statistics' => { name => 'omit_phy_statistics' }
});

return $self;
Expand All @@ -171,7 +172,10 @@ sub manage_selection {

my $result_ports = $options{custom}->request_api(method => 'GET', url_path => '/api/show/ports');
my $result_ports_stats = $options{custom}->request_api(method => 'GET', url_path => '/api/show/host-port-statistics');
my $result_logical_interfaces = $options{custom}->request_api(method => 'GET', url_path => '/api/show/host-phy-statistics');
my $result_logical_interfaces;
if (!$self->{option_results}->{omit_phy_statistics}) {
$result_logical_interfaces = $options{custom}->request_api(method => 'GET', url_path => '/api/show/host-phy-statistics');
}

my $mapping_ports = {};

Expand Down Expand Up @@ -205,15 +209,17 @@ sub manage_selection {

}

foreach (@{$result_logical_interfaces->{'sas-host-phy-statistics'}}) {
next if (!defined($self->{ports}->{ $_->{port} }));
if (!$self->{option_results}->{omit_phy_statistics} && defined($result_logical_interfaces) && defined($result_logical_interfaces->{'sas-host-phy-statistics'})) {
foreach (@{$result_logical_interfaces->{'sas-host-phy-statistics'}}) {
next if (!defined($self->{ports}->{ $_->{port} }));

$self->{ports}->{ $_->{port} }->{interfaces}->{ $_->{phy} } = {
display => $_->{phy},
disparity_errors => int($_->{'disparity-errors'}),
invalid_dwords => int($_->{'invalid-dwords'}),
lost_dwords => int($_->{'lost-dwords'})
};
$self->{ports}->{ $_->{port} }->{interfaces}->{ $_->{phy} } = {
display => $_->{phy},
disparity_errors => int($_->{'disparity-errors'}),
invalid_dwords => int($_->{'invalid-dwords'}),
lost_dwords => int($_->{'lost-dwords'})
};
}
}

$self->{cache_name} = 'dell_me4_' . $self->{mode} . '_' . $options{custom}->get_hostname() . '_' .
Expand All @@ -235,6 +241,10 @@ Check interfaces.

Filter port name (can be a regexp).

=item B<--omit-phy-statistics>

Filter diagnostic information relating to SAS controller physical channels.

=item B<--unknown-port-status>

Define the conditions to match for the status to be UNKNOWN (default: '%{status} =~ /unknown/i').
Expand Down