fix aruba + indent

This commit is contained in:
garnier-quentin 2020-01-06 11:03:32 +01:00
parent 91cf221061
commit e0f26e73a0
2 changed files with 36 additions and 40 deletions

View File

@ -33,7 +33,8 @@ sub custom_status_output {
$self->{result_values}->{status},
$self->{result_values}->{ip},
$self->{result_values}->{group},
$self->{result_values}->{location});
$self->{result_values}->{location}
);
return $msg;
}
@ -126,11 +127,11 @@ sub new {
bless $self, $class;
$options{options}->add_options(arguments => {
"filter-ip:s" => { name => 'filter_ip' },
"filter-name:s" => { name => 'filter_name' },
"filter-group:s" => { name => 'filter_group' },
"warning-status:s" => { name => 'warning_status' },
"critical-status:s" => { name => 'critical_status', default => '%{status} !~ /up/i' },
'filter-ip:s' => { name => 'filter_ip' },
'filter-name:s' => { name => 'filter_name' },
'filter-group:s' => { name => 'filter_group' },
'warning-status:s' => { name => 'warning_status' },
'critical-status:s' => { name => 'critical_status', default => '%{status} !~ /up/i' },
});
return $self;
@ -143,9 +144,7 @@ sub check_options {
$self->change_macros(macros => ['warning_status', 'critical_status']);
}
my %map_status = (
1 => 'up', 2 => 'down'
);
my $map_status = { 1 => 'up', 2 => 'down' };
my $oid_wlsxWlanAPTable = '.1.3.6.1.4.1.14823.2.2.1.5.2.1.4.1';
@ -157,9 +156,9 @@ my $mapping_info = {
my $mapping_stat = {
wlanAPUpTime => { oid => '.1.3.6.1.4.1.14823.2.2.1.5.2.1.4.1.12' },
wlanAPLocation => { oid => '.1.3.6.1.4.1.14823.2.2.1.5.2.1.4.1.14' },
wlanAPStatus => { oid => '.1.3.6.1.4.1.14823.2.2.1.5.2.1.4.1.20', map => \%map_status },
wlanAPNumBootstraps => { oid => '.1.3.6.1.4.1.14823.2.2.1.5.2.1.4.1.21' },
wlanAPNumReboots => { oid => '.1.3.6.1.4.1.14823.2.2.1.5.2.1.4.1.22' },
wlanAPStatus => { oid => '.1.3.6.1.4.1.14823.2.2.1.5.2.1.4.1.19', map => $map_status },
wlanAPNumBootstraps => { oid => '.1.3.6.1.4.1.14823.2.2.1.5.2.1.4.1.20' },
wlanAPNumReboots => { oid => '.1.3.6.1.4.1.14823.2.2.1.5.2.1.4.1.21' },
};
sub manage_selection {
@ -248,22 +247,15 @@ Check AP status (WLSX-WLAN-MIB).
=over 8
=item B<--warning-*>
=item B<--warning-*> B<--critical-*>
Threshold warning.
Thresholds.
Can be: 'connected-current' (global), 'uptime',
'controller-bootstrap', 'reboot', 'status' (per AP).
'status' can use special variables like: %{name},
%{status}, %{ip}, %{group}, %{location} (Default: '')
=item B<--critical-*>
Threshold critical.
Can be: 'connected-current' (global), 'uptime',
'controller-bootstrap', 'reboot', 'status' (per AP).
'status' can use special variables like: %{name},
%{status}, %{ip}, %{group}, %{location} (Default: '%{status} !~ /up/i')
=item B<--filter-*>
Filter by 'ip', 'name', 'group' (regexp can be used).

View File

@ -511,17 +511,21 @@ sub display {
if (defined($self->{option_results}->{output_xml})) {
$self->create_xml_document();
if ($self->{is_output_xml}) {
$self->output_xml(exit_litteral => $self->get_litteral_status(),
$self->output_xml(
exit_litteral => $self->get_litteral_status(),
nolabel => $nolabel,
force_ignore_perfdata => $force_ignore_perfdata, force_long_output => $force_long_output);
force_ignore_perfdata => $force_ignore_perfdata, force_long_output => $force_long_output
);
return ;
}
} elsif (defined($self->{option_results}->{output_json})) {
$self->create_json_document();
if ($self->{is_output_json}) {
$self->output_json(exit_litteral => $self->get_litteral_status(),
$self->output_json(
exit_litteral => $self->get_litteral_status(),
nolabel => $nolabel,
force_ignore_perfdata => $force_ignore_perfdata, force_long_output => $force_long_output);
force_ignore_perfdata => $force_ignore_perfdata, force_long_output => $force_long_output
);
return ;
}
} elsif (defined($self->{option_results}->{output_openmetrics})) {