feat(huawei-wlc): new snmp plugin (#5301, #5146)

Co-authored-by: Roman Morandell <46994680+rmorandell-pgum@users.noreply.github.com>
Co-authored-by: sfarouq-ext <116093375+sfarouq-ext@users.noreply.github.com>
This commit is contained in:
omercier 2024-12-17 12:10:55 +01:00 committed by GitHub
parent 62f3860136
commit 3953f8dbb5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
36 changed files with 85087 additions and 200 deletions

View File

@ -2,7 +2,7 @@ ARG REGISTRY_URL=docker.io
FROM ${REGISTRY_URL}/debian:bookworm
ENV DEBIAN_FRONTEND noninteractive
ENV DEBIAN_FRONTEND=noninteractive
# fix locale
RUN bash -e <<EOF
@ -15,7 +15,7 @@ apt-get clean
EOF
ENV LANG en_US.utf8
ENV LANG=en_US.utf8
RUN bash -e <<EOF

View File

@ -2,7 +2,7 @@ ARG REGISTRY_URL=docker.io
FROM ${REGISTRY_URL}/debian:bullseye
ENV DEBIAN_FRONTEND noninteractive
ENV DEBIAN_FRONTEND=noninteractive
# fix locale
RUN bash -e <<EOF
@ -15,7 +15,7 @@ apt-get clean
EOF
ENV LANG en_US.utf8
ENV LANG=en_US.utf8
RUN bash -e <<EOF

View File

@ -2,7 +2,7 @@ ARG REGISTRY_URL=docker.io
FROM ${REGISTRY_URL}/ubuntu:jammy
ENV DEBIAN_FRONTEND noninteractive
ENV DEBIAN_FRONTEND=noninteractive
# fix locale
RUN bash -e <<EOF
@ -15,7 +15,7 @@ apt-get clean
EOF
ENV LANG en_US.utf8
ENV LANG=en_US.utf8
RUN bash -e <<EOF

View File

@ -1,23 +1,62 @@
use strict;
use warnings;
use Test::More;
use Test::Spelling;
use List::MoreUtils qw(uniq);
# the command must have at least one argument
if (!@ARGV) {
die "Usage: perl pod_spell_check.t module.pm stopwords.t";
}
# the first argument is the module to check
my $module_to_check = $ARGV[0];
# the second (optional) argument is the additional dictionary
my $stopword_filename='tests/resources/spellcheck/stopwords.txt';
if(defined($ARGV[1])){
$stopword_filename=$ARGV[1];
}
open(FILE, "<", $stopword_filename)
or die "Could not open $stopword_filename";
printf("Using dictionary: ".$stopword_filename." \n");
add_stopwords(<FILE>);
close(FILE);
set_spell_cmd('hunspell -l');
all_pod_files_spelling_ok($ARGV[0]);
# get_stopwords(): reads the text file and returns its content as an array or strings
sub get_stopwords {
my ($file) = @_;
open(FILE, "<", $stopword_filename)
or die "Could not open $stopword_filename";
printf("Using dictionary: ".$stopword_filename." \n");
my @stop_words;
for my $line (<FILE>) {
chomp $line;
push @stop_words, $line;
}
close(FILE);
return @stop_words;
}
# get_module_options(): reads the Perl module file's POD and returns all the encountered --options
sub get_module_options {
my ($module) = @_;
my @cmd_result = `perldoc -T $module_to_check`;
my @new_words;
for my $pod_line (@cmd_result) {
chomp $pod_line;
my @parsed_options = $pod_line =~ /(--[\w-]+){1,}\s?/mg or next;
push @new_words, @parsed_options;
}
return uniq(sort(@new_words));
}
my @known_words = get_stopwords($stopword_filename);
my @module_options = get_module_options($module_to_check);
# take all words from the text file and the module's options as valid words
add_stopwords(@known_words, @module_options);
# prepare the spelling check command
set_spell_cmd('hunspell -d en_US -l');
# check that all is correct in the Perl module file given as an argument
all_pod_files_spelling_ok($module_to_check);

View File

@ -15,7 +15,7 @@ on:
jobs:
pod-spell-check:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'do-not-spellcheck') }}
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
@ -34,7 +34,7 @@ jobs:
with:
perl-version: '5.34'
install-modules-with: cpm
install-modules: Test::More Test::Spelling
install-modules: Test::More Test::Spelling List::MoreUtils
- name: Install librairies
continue-on-error: true

View File

@ -0,0 +1,5 @@
{
"dependencies": [
"libsnmp-perl"
]
}

View File

@ -0,0 +1,15 @@
{
"pkg_name": "centreon-plugin-Network-Huawei-Wlc-Snmp",
"pkg_summary": "Centreon Plugin for Huawei WLC using SNMP protocol",
"plugin_name": "centreon_huawei_wlc_snmp.pl",
"files": [
"centreon/common/huawei/standard/snmp/",
"centreon/plugins/script_snmp.pm",
"centreon/plugins/snmp.pm",
"snmp_standard/mode/interfaces.pm",
"snmp_standard/mode/listinterfaces.pm",
"snmp_standard/mode/resources/",
"snmp_standard/mode/uptime.pm",
"network/huawei/wlc/snmp/"
]
}

View File

@ -0,0 +1,5 @@
{
"dependencies": [
"perl(SNMP)"
]
}

View File

@ -18,7 +18,7 @@
# limitations under the License.
#
package network::huawei::snmp::mode::components::fan;
package centreon::common::huawei::standard::snmp::mode::components::fan;
use strict;
use warnings;

View File

@ -18,7 +18,7 @@
# limitations under the License.
#
package network::huawei::snmp::mode::components::temperature;
package centreon::common::huawei::standard::snmp::mode::components::temperature;
use strict;
use warnings;

View File

@ -18,7 +18,7 @@
# limitations under the License.
#
package network::huawei::snmp::mode::cpu;
package centreon::common::huawei::standard::snmp::mode::cpu;
use base qw(centreon::plugins::templates::counter);
@ -56,9 +56,7 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
bless $self, $class;
$options{options}->add_options(arguments =>
{
});
$options{options}->add_options(arguments => {});
return $self;
}
@ -80,17 +78,17 @@ sub manage_selection {
$self->{cpu} = {};
my $num = 1;
if (defined($results->{$oid_hwAvgDuty5min}) && scalar(keys %{$results->{$oid_hwAvgDuty5min}}) > 0) {
foreach (keys %{$results->{$oid_hwAvgDuty5min}}) {
foreach (sort keys %{$results->{$oid_hwAvgDuty5min}}) {
$self->{cpu}->{$num} = { num => $num, cpu => $results->{$oid_hwAvgDuty5min}->{$_} };
$num++;
}
} elsif (defined($results->{$oid_hwEntityCpuUsage}) && scalar(keys %{$results->{$oid_hwEntityCpuUsage}}) > 0) {
foreach (keys %{$results->{$oid_hwEntityCpuUsage}}) {
foreach (sort keys %{$results->{$oid_hwEntityCpuUsage}}) {
$self->{cpu}->{$num} = { num => $num, cpu => $results->{$oid_hwEntityCpuUsage}->{$_} };
$num++;
}
} else {
foreach (keys %{$results->{$oid_hwResOccupancy}}) {
foreach (sort keys %{$results->{$oid_hwResOccupancy}}) {
/\.([0-9]*?)$/;
next if (!defined($map_type->{$1}) || $map_type->{$1} ne 'cpu');
$self->{cpu}->{$num} = { num => $num, cpu => $results->{$oid_hwResOccupancy}->{$_} };

View File

@ -18,7 +18,7 @@
# limitations under the License.
#
package network::huawei::snmp::mode::hardware;
package centreon::common::huawei::standard::snmp::mode::hardware;
use base qw(centreon::plugins::templates::hardware);
@ -41,7 +41,7 @@ sub set_system {
]
};
$self->{components_path} = 'network::huawei::snmp::mode::components';
$self->{components_path} = 'centreon::common::huawei::standard::snmp::mode::components';
$self->{components_module} = ['fan', 'temperature'];
}

View File

@ -18,7 +18,7 @@
# limitations under the License.
#
package network::huawei::snmp::mode::interfaces;
package centreon::common::huawei::standard::snmp::mode::interfaces;
use base qw(snmp_standard::mode::interfaces);
@ -205,7 +205,7 @@ Check interface data volume between two checks (not supposed to be graphed, usef
=item B<--add-optical>
Check interface optical metrics.
Check interfaces' optical metrics.
=item B<--check-metrics>
@ -229,15 +229,182 @@ Set warning threshold for all error counters.
Set critical threshold for all error counters.
=item B<--warning-*> B<--critical-*>
=item B<--warning-total-port>
Thresholds (will superseed --[warning-critical]-errors).
Can be: 'total-port', 'total-admin-up', 'total-admin-down', 'total-oper-up', 'total-oper-down',
'in-traffic', 'out-traffic', 'in-error', 'in-discard', 'out-error', 'out-discard',
'in-ucast', 'in-bcast', 'in-mcast', 'out-ucast', 'out-bcast', 'out-mcast',
'speed' (b/s).
Thresholds.
=item B<--critical-total-port>
Thresholds.
=item B<--warning-total-admin-up>
Thresholds.
=item B<--critical-total-admin-up>
Thresholds.
=item B<--warning-total-admin-down>
Thresholds.
=item B<--critical-total-admin-down>
Thresholds.
=item B<--warning-total-oper-up>
Thresholds.
=item B<--critical-total-oper-up>
Thresholds.
=item B<--warning-total-oper-down>
Thresholds.
=item B<--critical-total-oper-down>
Thresholds.
=item B<--warning-in-traffic>
Thresholds.
=item B<--critical-in-traffic>
Thresholds.
=item B<--warning-out-traffic>
Thresholds.
=item B<--critical-out-traffic>
Thresholds.
=item B<--warning-in-error>
Thresholds.
=item B<--critical-in-error>
Thresholds.
=item B<--warning-in-discard>
Thresholds.
=item B<--critical-in-discard>
Thresholds.
=item B<--warning-out-error>
Thresholds.
=item B<--critical-out-error>
Thresholds.
=item B<--warning-out-discard>
Thresholds.
=item B<--critical-out-discard>
Thresholds.
=item B<--warning-in-ucast>
Thresholds.
=item B<--critical-in-ucast>
Thresholds.
=item B<--warning-in-bcast>
Thresholds.
=item B<--critical-in-bcast>
Thresholds.
=item B<--warning-in-mcast>
Thresholds.
=item B<--critical-in-mcast>
Thresholds.
=item B<--warning-out-ucast>
Thresholds.
=item B<--critical-out-ucast>
Thresholds.
=item B<--warning-out-bcast>
Thresholds.
=item B<--critical-out-bcast>
Thresholds.
=item B<--warning-out-mcast>
Thresholds.
=item B<--critical-out-mcast>
Thresholds.
=item B<--warning-speed>
Thresholds in b/s.
=item B<--critical-speed>
Thresholds in b/s.
=item B<--warning-input-power>
Thresholds in C<dBm>.
=item B<--critical-input-power>
Thresholds in C<dBm>.
=item B<--warning-bias-current>
Thresholds in C<mA>.
=item B<--critical-bias-current>
Thresholds in C<mA>.
=item B<--warning-output-power>
Thresholds in C<dBm>.
=item B<--critical-output-power>
Thresholds in C<dBm>.
=item B<--warning-module-temperature>
Thresholds in °C.
=item B<--critical-module-temperature>
Thresholds in °C.
And also: 'input-power' (dBm), 'bias-current' (mA), 'output-power' (dBm), 'module-temperature' (C).
=item B<--units-traffic>
@ -253,15 +420,20 @@ Units of thresholds for communication types (default: 'percent_delta') ('percent
=item B<--nagvis-perfdata>
Display traffic perfdata to be compatible with nagvis widget.
Display traffic perfdata to be compatible with NagVis widget.
=item B<--interface>
Set the interface (number expected) example: 1,2,... (empty means 'check all interfaces').
Define the interface filter on IDs (OID indexes, e.g.: 1,2,...). If empty, all interfaces will be monitored.
To filter on interface names, see --name.
=item B<--name>
Allows you to define the interface (in option --interface) by name instead of OID index. The name matching mode supports regular expressions.
With this option, the interfaces will be filtered by name (given in option --interface) instead of OID index. The name matching mode supports regular expressions.
=item B<--regex-id>
With this option, interface IDs will be filtered using the --interface parameter as a regular expression instead of a list of IDs.
=item B<--speed>
@ -277,7 +449,7 @@ Set interface speed for outgoing traffic (in Mb).
=item B<--force-counters32>
Force to use 32 bits counters (even in snmp v2c and v3). Should be used when 64 bits counters are buggy.
Force to use 32-bits counters (even with SNMP versions 2c and 3). To use when 64 bits counters are buggy.
=item B<--reload-cache-time>

View File

@ -18,7 +18,7 @@
# limitations under the License.
#
package network::huawei::snmp::mode::memory;
package centreon::common::huawei::standard::snmp::mode::memory;
use base qw(centreon::plugins::templates::counter);
@ -30,21 +30,23 @@ sub custom_usage_perfdata {
if ($self->{result_values}->{total} > 0) {
$self->{output}->perfdata_add(
label => 'used', unit => 'B',
label => 'used', unit => 'B',
instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef,
value => $self->{result_values}->{used},
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{thlabel}, total => $self->{result_values}->{total}, cast_int => 1),
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{thlabel}, total => $self->{result_values}->{total}, cast_int => 1),
min => 0, max => $self->{result_values}->{total}
value => $self->{result_values}->{used},
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{thlabel}, total => $self->{result_values}->{total}, cast_int => 1),
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{thlabel}, total => $self->{result_values}->{total}, cast_int => 1),
min => 0,
max => $self->{result_values}->{total}
);
} else {
$self->{output}->perfdata_add(
label => 'used', unit => '%',
label => 'used', unit => '%',
instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef,
value => $self->{result_values}->{prct_used},
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{thlabel}),
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{thlabel}),
min => 0, max => 100
value => $self->{result_values}->{prct_used},
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{thlabel}),
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{thlabel}),
min => 0,
max => 100
);
}
}
@ -52,7 +54,13 @@ sub custom_usage_perfdata {
sub custom_usage_threshold {
my ($self, %options) = @_;
my $exit = $self->{perfdata}->threshold_check(value => $self->{result_values}->{prct_used}, threshold => [ { label => 'critical-' . $self->{thlabel}, exit_litteral => 'critical' }, { label => 'warning-' . $self->{thlabel}, exit_litteral => 'warning' } ]);
my $exit = $self->{perfdata}->threshold_check(
value => $self->{result_values}->{prct_used},
threshold => [
{ label => 'critical-' . $self->{thlabel}, exit_litteral => 'critical' },
{ label => 'warning-' . $self->{thlabel}, exit_litteral => 'warning' }
]
);
return $exit;
}
@ -66,10 +74,12 @@ sub custom_usage_output {
my ($total_free_value, $total_free_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{free});
$msg = sprintf("Total: %s Used: %s (%.2f%%) Free: %s (%.2f%%)",
$total_size_value . " " . $total_size_unit,
$total_used_value . " " . $total_used_unit, $self->{result_values}->{prct_used},
$total_free_value . " " . $total_free_unit, $self->{result_values}->{prct_free});
$total_size_value . " " . $total_size_unit,
$total_used_value . " " . $total_used_unit, $self->{result_values}->{prct_used},
$total_free_value . " " . $total_free_unit, $self->{result_values}->{prct_free}
);
}
return $msg;
}
@ -77,9 +87,9 @@ sub custom_usage_calc {
my ($self, %options) = @_;
$self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'};
$self->{result_values}->{total} = $options{new_datas}->{$self->{instance} . '_total'};
$self->{result_values}->{free} = $options{new_datas}->{$self->{instance} . '_free'};
$self->{result_values}->{used} = $options{new_datas}->{$self->{instance} . '_total'} - $self->{result_values}->{free};
$self->{result_values}->{total} = $options{new_datas}->{$self->{instance} . '_total'};
$self->{result_values}->{free} = $options{new_datas}->{$self->{instance} . '_free'};
$self->{result_values}->{used} = $options{new_datas}->{$self->{instance} . '_total'} - $self->{result_values}->{free};
if ($self->{result_values}->{total} > 0) {
$self->{result_values}->{prct_free} = $self->{result_values}->{free} * 100 / $self->{result_values}->{total};
@ -87,6 +97,7 @@ sub custom_usage_calc {
} else {
$self->{result_values}->{prct_used} = $options{new_datas}->{$self->{instance} . '_used_prct'};
}
return 0;
}
@ -99,11 +110,11 @@ sub set_counters {
$self->{maps_counters}->{memory} = [
{ label => 'usage', set => {
key_values => [ { name => 'display' }, { name => 'used_prct' }, { name => 'free' }, { name => 'total' } ],
closure_custom_calc => $self->can('custom_usage_calc'),
closure_custom_output => $self->can('custom_usage_output'),
closure_custom_perfdata => $self->can('custom_usage_perfdata'),
closure_custom_threshold_check => $self->can('custom_usage_threshold'),
key_values => [ { name => 'display' }, { name => 'used_prct' }, { name => 'free' }, { name => 'total' } ],
closure_custom_calc => $self->can('custom_usage_calc'),
closure_custom_output => $self->can('custom_usage_output'),
closure_custom_perfdata => $self->can('custom_usage_perfdata'),
closure_custom_threshold_check => $self->can('custom_usage_threshold'),
}
},
];
@ -120,16 +131,14 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
bless $self, $class;
$options{options}->add_options(arguments =>
{
});
$options{options}->add_options(arguments => {});
return $self;
}
my $oid_hwEntityMemUsage = '.1.3.6.1.4.1.2011.5.25.31.1.1.1.1.7'; # prct
my $oid_hwMemoryDevEntry = '.1.3.6.1.4.1.2011.6.3.5.1.1';
my $oid_hwResOccupancy = '.1.3.6.1.4.1.2011.6.3.17.1.1.3';
my $oid_hwResOccupancy = '.1.3.6.1.4.1.2011.6.3.17.1.1.3';
my $map_type = { 1 => 'memory', 2 => 'messageUnits', 3 => 'cpu' };
my $mapping = {
@ -149,19 +158,19 @@ sub manage_selection {
my $num = 1;
if (defined($results->{$oid_hwMemoryDevEntry}) && scalar(keys %{$results->{$oid_hwMemoryDevEntry}}) > 0) {
foreach (keys %{$results->{$oid_hwMemoryDevEntry}}) {
foreach (sort keys %{$results->{$oid_hwMemoryDevEntry}}) {
next if (!/^$mapping->{hwMemoryDevFree}->{oid}\.(.*)$/);
my $result = $options{snmp}->map_instance(mapping => $mapping, results => $results->{$oid_hwMemoryDevEntry}, instance => $1);
$self->{memory}->{$num} = { display => $num, used_prct => -1, free => $result->{hwMemoryDevFree}, total => $result->{hwMemoryDevSize} };
$num++;
}
} elsif (defined($results->{$oid_hwEntityMemUsage}) && scalar(keys %{$results->{$oid_hwEntityMemUsage}}) > 0) {
foreach (keys %{$results->{$oid_hwEntityMemUsage}}) {
foreach (sort keys %{$results->{$oid_hwEntityMemUsage}}) {
$self->{memory}->{$num} = { display => $num, used_prct => $results->{$oid_hwEntityMemUsage}->{$_}, free => 0, total => 0 };
$num++;
}
} else {
foreach (keys %{$results->{$oid_hwResOccupancy}}) {
foreach (sort keys %{$results->{$oid_hwResOccupancy}}) {
/\.([0-9]*?)$/;
next if (!defined($map_type->{$1}) || $map_type->{$1} ne 'memory');
$self->{memory}->{$num} = { display => $num, used_prct => $results->{$oid_hwResOccupancy}->{$_}, free => 0, total => 0 };

View File

@ -18,7 +18,7 @@
# limitations under the License.
#
package network::huawei::snmp::plugin;
package network::huawei::standard::snmp::plugin;
use strict;
use warnings;
@ -30,11 +30,11 @@ sub new {
bless $self, $class;
$self->{modes} = {
'cpu' => 'network::huawei::snmp::mode::cpu',
'hardware' => 'network::huawei::snmp::mode::hardware',
'interfaces' => 'network::huawei::snmp::mode::interfaces',
'cpu' => 'centreon::common::huawei::standard::snmp::mode::cpu',
'hardware' => 'centreon::common::huawei::standard::snmp::mode::hardware',
'interfaces' => 'centreon::common::huawei::standard::snmp::mode::interfaces',
'list-interfaces' => 'snmp_standard::mode::listinterfaces',
'memory' => 'network::huawei::snmp::mode::memory',
'memory' => 'centreon::common::huawei::standard::snmp::mode::memory',
'uptime' => 'snmp_standard::mode::uptime'
};

View File

@ -0,0 +1,412 @@
#
# Copyright 2024 Centreon (http://www.centreon.com/)
#
# Centreon is a full-fledged industry-strength solution that meets
# the needs in IT infrastructure and application monitoring for
# service performance.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
package network::huawei::wlc::snmp::mode::aphealth;
use base qw(centreon::plugins::templates::counter);
use strict;
use warnings;
use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold_ng);
sub custom_status_output {
my ($self, %options) = @_;
my $msg = 'data link state: ' . $self->{result_values}->{datalinkstate} . ', power-supply: ' . $self->{result_values}->{powersupply};
return $msg;
}
sub prefix_global_output {
my ($self, %options) = @_;
return 'Access points ';
}
sub ap_long_output {
my ($self, %options) = @_;
return "checking access point '" . $options{instance_value}->{display} . "'";
}
sub prefix_ap_output {
my ($self, %options) = @_;
return "access point '" . $options{instance_value}->{display} . "' ";
}
sub custom_uptime_output {
my ($self, %options) = @_;
return sprintf(
'access point %s online time is: %s', $self->{result_values}->{display},
centreon::plugins::misc::change_seconds(value => $self->{result_values}->{onlinetime}, start => 'd')
);
}
sub set_counters {
my ($self, %options) = @_;
$self->{maps_counters_type} = [
{ name => 'ap',
type => 3,
cb_prefix_output => 'prefix_ap_output',
cb_long_output => 'ap_long_output',
indent_long_output => ' ',
message_multiple => 'All access points are ok',
group => [
{ name => 'health', type => 0 }
]
}
];
$self->{maps_counters}->{health} = [
{
label => 'status',
type => 2,
critical_default => '%{powersupply} =~ /insufficient|limited/ || %{datalinkstate} !~ /run/',
warning_default => '%{powersupply} eq "limited"',
set =>
{
key_values =>
[ { name => 'powersupply' }, { name => 'display' }, { name => 'datalinkstate' } ],
closure_custom_output =>
$self->can('custom_status_output'),
closure_custom_perfdata =>
sub {return 0;},
closure_custom_threshold_check =>
\&catalog_status_threshold_ng
}
},
{ label => 'temperature', nlabel => 'ap.temperature.celsius', set => {
key_values => [ { name => 'temperature' }, { name => 'display' } ],
output_template => 'access point temperature: %.2f C',
perfdatas => [
{ template => '%.2f', unit => 'C', label_extra_instance => 1, instance_use => 'display' }
]
}
},
{ label => 'onlinetime', nlabel => 'ap.online.time', set => {
key_values => [ { name => 'onlinetime' }, { name => 'display' } ],
closure_custom_output => $self->can('custom_uptime_output'),
perfdatas => [
{ template => '%d', unit => '', label_extra_instance => 1, instance_use => 'display' }
]
}
},
{ label => 'bootcount-total', nlabel => 'ap.boot.total.count', set => {
key_values => [ { name => 'bootcount_total' }, { name => 'display' } ],
output_template => 'access point bootcount total: %d',
perfdatas => [
{ template => '%d', unit => '', label_extra_instance => 1, instance_use => 'display' }
]
}
},
{ label => 'memory', nlabel => 'ap.memory.used.percentage', set => {
key_values => [ { name => 'memory' }, { name => 'display' } ],
output_template => 'access point memory: %.2f %%',
perfdatas => [
{ template => '%.2f', unit => '%', label_extra_instance => 1, instance_use => 'display' }
]
}
},
{ label => 'cpu', nlabel => 'ap.cpu.used.percentage', set => {
key_values => [ { name => 'cpu' }, { name => 'display' } ],
output_template => 'access point cpu: %.2f%%',
perfdatas => [
{ template => '%.2f', unit => '%', label_extra_instance => 1, instance_use => 'display' }
]
}
},
{ label => 'up-port-speed', nlabel => 'ap.up.port.bitspersecond', set => {
key_values => [ { name => 'up_port_speed' }, { name => 'display' } ],
output_template => 'access point up-Port speed: %s b/s',
perfdatas => [
{ template => '%s', unit => 'b/s', label_extra_instance => 1, instance_use => 'display' }
]
}
},
{ label => 'up-port-packet-err', nlabel => 'ap.up.port.package.error.percentage', set => {
key_values => [ { name => 'up_port_per' }, { name => 'display' } ],
output_template => 'access point up-Port packet errors: %.2f%%',
perfdatas => [
{ template => '%.2f', unit => '', label_extra_instance => 1, instance_use => 'display' }
]
}
},
{ label => 'online-user-num', nlabel => 'ap.online.user.count', set => {
key_values => [ { name => 'online_user_num' }, { name => 'display' } ],
output_template => 'access online user nums: %d',
perfdatas => [
{ template => '%d', unit => '', label_extra_instance => 1, instance_use => 'display' }
]
}
}
];
}
sub new {
my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1);
bless $self, $class;
$options{options}->add_options(arguments => {
"filter-name:s" => { name => 'filter_name' },
"filter-address:s" => { name => 'filter_address' },
"filter-group:s" => { name => 'filter_group' }
});
return $self;
}
my $map_power_supply_state = {
1 => 'normal',
2 => 'insufficient',
3 => 'limited',
4 => 'invalid'
};
my $map_data_link_state = {
1 => 'down',
2 => 'run',
3 => 'noneed'
};
my $mapping = {
name => { oid => '.1.3.6.1.4.1.2011.6.139.13.3.3.1.4' },# hwWlanApName
address => { oid => '.1.3.6.1.4.1.2011.6.139.13.3.3.1.13' }# hwWlanApIpAddress
};
my $mapping_stat = {
runtime => { oid => '.1.3.6.1.4.1.2011.6.139.13.3.3.1.18' },# hwWlanApRunTime
group => { oid => '.1.3.6.1.4.1.2011.6.139.13.3.3.1.5' },# hwWlanApGroup
temperature => { oid => '.1.3.6.1.4.1.2011.6.139.13.3.3.1.43' },# hwWlanApTemperature
onlinetime => { oid => '.1.3.6.1.4.1.2011.6.139.13.3.3.1.21' },# hwWlanApOnlineTime
bootcount_total => { oid => '.1.3.6.1.4.1.2011.6.139.13.3.3.1.33' },# hwWlanApBootCountTotal
memory => { oid => '.1.3.6.1.4.1.2011.6.139.13.3.3.1.40' },# hwWlanApMemoryUseRate
cpu => { oid => '.1.3.6.1.4.1.2011.6.139.13.3.3.1.41' },# hwWlanApCPUUseRate
up_port_speed => { oid => '.1.3.6.1.4.1.2011.6.139.13.3.3.1.54' },# hwWlanApUpPortSpeed
up_port_per => { oid => '.1.3.6.1.4.1.2011.6.139.13.3.3.1.55' },# hwWlanAPUpPortPER
online_user_num => { oid => '.1.3.6.1.4.1.2011.6.139.13.3.3.1.44' },# hwWlanApOnlineUserNum
powersupply =>
{ oid => '.1.3.6.1.4.1.2011.6.139.13.3.3.1.80', map => $map_power_supply_state },# hwWlanAPPowerSupplyState
datalinkstate =>
{ oid => '.1.3.6.1.4.1.2011.6.139.13.3.3.1.81', map => $map_data_link_state }# hwWlanApDataLinkState
};
sub manage_selection {
my ($self, %options) = @_;
$self->{ap} = {};
my $request = [ { oid => $mapping->{name}->{oid} } ];
push @$request, { oid => $mapping->{group}->{oid} }
if (defined($self->{option_results}->{filter_group}) && $self->{option_results}->{filter_group} ne '');
push @$request, { oid => $mapping->{address}->{oid} }
if (defined($self->{option_results}->{filter_address}) && $self->{option_results}->{filter_address} ne '');
my $snmp_result = $options{snmp}->get_multiple_table(
oids => $request,
return_type => 1,
nothing_quit => 1
);
foreach (sort keys %$snmp_result) {
next if (!/^$mapping->{name}->{oid}\.(.*)/);
my $instance = $1;
my $result = $options{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => $instance);
if (!defined($result->{name}) || $result->{name} eq '') {
$self->{output}->output_add(long_msg =>
"skipping WLC '$instance': cannot get a name. please set it.",
debug => 1);
next;
}
if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' &&
$result->{name} !~ /$self->{option_results}->{filter_name}/) {
$self->{output}->output_add(long_msg =>
"skipping '" . $result->{name} . "': no matching name filter.",
debug => 1);
next;
}
if (defined($self->{option_results}->{filter_address}) && $self->{option_results}->{filter_address} ne '' &&
$result->{address} !~ /$self->{option_results}->{filter_address}/) {
$self->{output}->output_add(long_msg =>
"skipping '" . $result->{address} . "': no matching address filter.",
debug => 1);
next;
}
if (defined($self->{option_results}->{filter_group}) && $self->{option_results}->{filter_group} ne '' &&
$result->{group} !~ /$self->{option_results}->{filter_group}/) {
$self->{output}->output_add(long_msg =>
"skipping '" . $result->{group} . "': no matching group filter.",
debug => 1);
next;
}
$self->{ap}->{ $result->{name} } = {
instance => $instance,
display => $result->{name},
health => {
display => $result->{name}
}
};
}
if (scalar(keys %{$self->{ap}}) <= 0) {
$self->{output}->output_add(long_msg => 'no AP associated');
return;
}
$options{snmp}->load(
oids => [ map($_->{oid}, values(%$mapping_stat)) ],
instances => [ map($_->{instance}, values %{$self->{ap}}) ],
instance_regexp => '^(.*)$'
);
$snmp_result = $options{snmp}->get_leef();
foreach (sort keys %{$self->{ap}}) {
my $result = $options{snmp}->map_instance(
mapping => $mapping_stat,
results => $snmp_result,
instance => $self->{ap}->{$_}->{instance}
);
$self->{ap}->{$_}->{health}->{datalinkstate} = $result->{datalinkstate};
$self->{ap}->{$_}->{health}->{powersupply} = $result->{powersupply};
$self->{ap}->{$_}->{health}->{temperature} = $result->{temperature};
$self->{ap}->{$_}->{health}->{onlinetime} = $result->{onlinetime};
$self->{ap}->{$_}->{health}->{bootcount_total} = $result->{bootcount_total};
$self->{ap}->{$_}->{health}->{memory} = $result->{memory};
$self->{ap}->{$_}->{health}->{cpu} = $result->{cpu};
$self->{ap}->{$_}->{health}->{up_port_speed} = $result->{up_port_speed} * 1000;
$self->{ap}->{$_}->{health}->{up_port_per} = $result->{up_port_per};
$self->{ap}->{$_}->{health}->{online_user_num} = $result->{online_user_num};
}
}
1;
__END__
=head1 MODE
Check AP health.
=over 8
=item B<--filter-counters>
Only display some counters (regexp can be used).
Example: --filter-counters='^temperature|onlinetime$'
=item B<--filter-name>
Filter access point name (can be a regexp)
=item B<--filter-address>
Filter access point IP address (can be a regexp).
=item B<--filter-group>
Filter access point group (can be a regexp).
=item B<--warning-status>
Define the conditions to match for the status to be WARNING. (default: '%{powersupply} eq "limited"').
You can use the following variables: %{powersupply}, %{datalinkstate}, %{display}
=item B<--critical-status>
Define the conditions to match for the status to be CRITICAL (default: '%{powersupply} =~ /insufficient|limited/ || %{datalinkstate} !~ /run/').
You can use the following variables: %{powersupply}, %{datalinkstate}, %{display}
=item B<--warning-temperature>
Thresholds.
=item B<--critical-temperature>
Thresholds.
=item B<--warning-onlinetime>
Thresholds.
=item B<--critical-onlinetime>
Thresholds.
=item B<--warning-bootcount-total>
Thresholds.
=item B<--critical-bootcount-total>
Thresholds.
=item B<--warning-memory>
Thresholds.
=item B<--critical-memory>
Thresholds.
=item B<--warning-cpu>
Thresholds.
=item B<--critical-cpu>
Thresholds.
=item B<--warning-up-port-speed>
Thresholds.
=item B<--critical-up-port-speed>
Thresholds.
=item B<--warning-up-port-packet-err>
Thresholds.
=item B<--critical-up-port-packet-err>
Thresholds.
=item B<--warning-online-user-num>
Thresholds.
=item B<--critical-online-user-num>
Thresholds.
=back
=cut

View File

@ -0,0 +1,346 @@
#
# Copyright 2024 Centreon (http://www.centreon.com/)
#
# Centreon is a full-fledged industry-strength solution that meets
# the needs in IT infrastructure and application monitoring for
# service performance.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
package network::huawei::wlc::snmp::mode::apradio;
use base qw(centreon::plugins::templates::counter);
use strict;
use warnings;
use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold_ng);
sub prefix_global_output {
my ($self, %options) = @_;
return 'Access points ';
}
sub ap_long_output {
my ($self, %options) = @_;
return "checking access point '" . $options{instance_value}->{display} . "'";
}
sub prefix_ap_output {
my ($self, %options) = @_;
return "access point '" . $options{instance_value}->{display} . "' ";
}
sub custom_status_output {
my ($self, %options) = @_;
my $msg = 'run state: ' . $self->{result_values}->{runstate};
return $msg;
}
sub set_counters {
my ($self, %options) = @_;
$self->{maps_counters_type} = [
{ name => 'ap',
type => 3,
cb_prefix_output => 'prefix_ap_output',
cb_long_output => 'ap_long_output',
indent_long_output => ' ',
message_multiple => 'All access points are ok',
group => [
{ name => 'ap_radio', type => 0 }
]
}
];
$self->{maps_counters}->{ap_radio} = [
{
label => 'status',
type => 2,
critical_default => '%{runstate} ne "up"',
set =>
{
key_values =>
[ { name => 'runstate' }, { name => 'display' } ],
closure_custom_output =>
$self->can('custom_status_output'),
closure_custom_perfdata =>
sub {return 0;},
closure_custom_threshold_check =>
\&catalog_status_threshold_ng
}
},
{ label => 'package-error-rate', nlabel => 'ap.radio.packageerror.percentage', set => {
key_values => [ { name => 'package_error_rate' }, { name => 'display' } ],
output_template => 'radio package error rate: %.2f%%',
perfdatas => [
{ template => '%.2f', unit => '%', label_extra_instance => 1, instance_use => 'display' }
]
}
},
{ label => 'noise', nlabel => 'ap.radio.noise.dbm', set => {
key_values => [ { name => 'noise' }, { name => 'display' } ],
output_template => 'radio noise: %d dBm',
perfdatas => [
{ template => '%d', unit => 'dBm', label_extra_instance => 1, instance_use => 'display' }
]
}
},
{ label => 'channel-utilization-rate', nlabel => 'ap.radio.channel.utilization.percentage', set => {
key_values => [ { name => 'channel_utilization_rate' }, { name => 'display' } ],
output_template => 'radio channel utilization rate: %.2f%%',
perfdatas => [
{ template => '%.2f', unit => '%', label_extra_instance => 1, instance_use => 'display' }
]
}
},
{ label => 'channel-interference-rate', nlabel => 'ap.radio.channel.interference.percentage', set => {
key_values => [ { name => 'channel_interference_rate' }, { name => 'display' } ],
output_template => 'radio channel interference rate: %.2f%%',
perfdatas => [
{ template => '%.2f', unit => '%', label_extra_instance => 1, instance_use => 'display' }
]
}
},
{ label => 'receive-rate', nlabel => 'ap.radio.receive.bitspersecond', set => {
key_values => [ { name => 'receive_rate' }, { name => 'display' } ],
output_template => 'radio channel receive rate: %d b/s',
perfdatas => [
{ template => '%d', unit => 'b/s', label_extra_instance => 1, instance_use => 'display' }
]
}
},
{ label => 'send-rate', nlabel => 'ap.radio.send.bitspersecond', set => {
key_values => [ { name => 'send_rate' }, { name => 'display' } ],
output_template => 'radio channel send rate: %d b/s',
perfdatas => [
{ template => '%d', unit => 'b/s', label_extra_instance => 1, instance_use => 'display' }
]
}
}
];
}
sub new {
my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1);
bless $self, $class;
$options{options}->add_options(arguments => {
"filter-name:s" => { name => 'filter_name' },
"filter-address:s" => { name => 'filter_address' },
"filter-group:s" => { name => 'filter_group' }
});
return $self;
}
my $map_runstate = {
1 => 'up',
2 => 'down',
255 => 'invalid'
};
my $mapping = {
name => { oid => '.1.3.6.1.4.1.2011.6.139.16.1.2.1.3' },# hwWlanApName
};
my $mapping_stat = {
ap_group => { oid => '.1.3.6.1.4.1.2011.6.139.16.1.2.1.55' },# hwWlanRadioApGroup
runstate => {
oid => '.1.3.6.1.4.1.2011.6.139.16.1.2.1.6', map => $map_runstate
},# hwWlanRadioRunState
package_error_rate => { oid => '.1.3.6.1.4.1.2011.6.139.16.1.2.1.23' },# hwWlanRadioPER
noise => { oid => '.1.3.6.1.4.1.2011.6.139.16.1.2.1.24' },# hwWlanRadioNoise
channel_utilization_rate => { oid => '.1.3.6.1.4.1.2011.6.139.16.1.2.1.25' },# hwWlanRadioChUtilizationRate
channel_interference_rate => { oid => '.1.3.6.1.4.1.2011.6.139.16.1.2.1.29' },# hwWlanRadioChInterferenceRate
receive_rate => { oid => '.1.3.6.1.4.1.2011.6.139.16.1.2.1.32' },# hwWlanRadioRecvRate
send_rate => { oid => '.1.3.6.1.4.1.2011.6.139.16.1.2.1.37' },# hwWlanRadioSendRate
};
sub manage_selection {
my ($self, %options) = @_;
$self->{ap} = {};
my $request = [ { oid => $mapping->{name}->{oid} } ];
push @$request, { oid => $mapping->{ap_group}->{oid} }
if (defined($self->{option_results}->{filter_group}) && $self->{option_results}->{filter_group} ne '');
my $snmp_result = $options{snmp}->get_multiple_table(
oids => $request,
return_type => 1,
nothing_quit => 1
);
foreach (sort keys %$snmp_result) {
next if (!/^$mapping->{name}->{oid}\.(.*)/);
my $instance = $1;
my $result = $options{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => $instance);
if (!defined($result->{name}) || $result->{name} eq '') {
$self->{output}->output_add(long_msg =>
"skipping WLC '$instance': cannot get a name. please set it.",
debug =>
1);
next;
}
if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' &&
$result->{name} !~ /$self->{option_results}->{filter_name}/) {
$self->{output}->output_add(long_msg =>
"skipping '" . $result->{name} . "': no matching name filter.",
debug =>
1);
next;
}
if (defined($self->{option_results}->{filter_group}) && $self->{option_results}->{filter_group} ne '' &&
$result->{group} !~ /$self->{option_results}->{filter_group}/) {
$self->{output}->output_add(long_msg =>
"skipping '" . $result->{group} . "': no matching group filter.",
debug =>
1);
next;
}
$self->{ap}->{ $result->{name} } = {
instance => $instance,
display => $result->{name},
ap_radio => {
display => $result->{name}
}
};
}
if (scalar(keys %{$self->{ap}}) <= 0) {
$self->{output}->output_add(long_msg => 'no AP associated');
return;
}
$options{snmp}->load(
oids => [ map($_->{oid}, values(%$mapping_stat)) ],
instances => [ map($_->{instance}, values %{$self->{ap}}) ],
instance_regexp => '^(.*)$'
);
$snmp_result = $options{snmp}->get_leef();
foreach (sort keys %{$self->{ap}}) {
my $result = $options{snmp}->map_instance(
mapping => $mapping_stat,
results => $snmp_result,
instance => $self->{ap}->{$_}->{instance}
);
$self->{ap}->{$_}->{ap_radio}->{runstate} = $result->{runstate};
$self->{ap}->{$_}->{ap_radio}->{package_error_rate} = $result->{package_error_rate};
$self->{ap}->{$_}->{ap_radio}->{noise} = $result->{noise};
$self->{ap}->{$_}->{ap_radio}->{channel_utilization_rate} = $result->{channel_utilization_rate};
$self->{ap}->{$_}->{ap_radio}->{channel_interference_rate} = $result->{channel_interference_rate};
$self->{ap}->{$_}->{ap_radio}->{receive_rate} = $result->{receive_rate} * 1000;
$self->{ap}->{$_}->{ap_radio}->{send_rate} = $result->{send_rate} * 1000;
}
}
1;
__END__
=head1 MODE
Check AP radio status.
=over 8
=item B<--filter-counters>
Only display some counters (regexp can be used).
Example: --filter-counters='^temperature|onlinetime$'
=item B<--filter-name>
Filter access point radio name (can be a regexp)
=item B<--filter-address>
Filter access point radio IP address (can be a regexp).
=item B<--filter-group>
Filter access point group (can be a regexp).
=item B<--warning-status>
Define the conditions to match for the status to be WARNING.
You can use the following variables: %{runstate}, %{display}
=item B<--critical-status>
Define the conditions to match for the status to be CRITICAL (default: '%{runstate} ne "up"').
You can use the following variables: %{runstate}, %{display}
=item B<--warning-package-error-rate>
Thresholds.
=item B<--critical-package-error-rate>
Thresholds.
=item B<--warning-noise>
Thresholds.
=item B<--critical-noise>
Thresholds.
=item B<--warning-channel-utilization-rate>
Thresholds.
=item B<--critical-channel-utilization-rate>
Thresholds.
=item B<--warning-channel-interference-rate>
Thresholds.
=item B<--critical-channel-interference-rate>
Thresholds.
=item B<--warning-receive-rate>
Thresholds.
=item B<--critical-receive-rate>
Thresholds.
=item B<--warning-send-rate>
Thresholds.
=item B<--critical-send-rate>
Thresholds.
=back
=cut

View File

@ -0,0 +1,544 @@
#
# Copyright 2024 Centreon (http://www.centreon.com/)
#
# Centreon is a full-fledged industry-strength solution that meets
# the needs in IT infrastructure and application monitoring for
# service performance.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
package network::huawei::wlc::snmp::mode::apstatus;
use base qw(centreon::plugins::templates::counter);
use strict;
use warnings;
use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold_ng);
sub custom_status_output {
my ($self, %options) = @_;
my $msg = 'status: ' . $self->{result_values}->{runstate};
return $msg;
}
sub prefix_global_output {
my ($self, %options) = @_;
return 'Access points ';
}
sub ap_long_output {
my ($self, %options) = @_;
return "checking access point '" . $options{instance_value}->{display} . "'";
}
sub prefix_ap_output {
my ($self, %options) = @_;
return "access point '" . $options{instance_value}->{display} . "' ";
}
sub set_counters {
my ($self, %options) = @_;
$self->{maps_counters_type} = [
{ name => 'global', type => 0, cb_prefix_output => 'prefix_global_output' },
{ name => 'ap',
type => 3,
cb_prefix_output => 'prefix_ap_output',
cb_long_output => 'ap_long_output',
indent_long_output => ' ',
message_multiple => 'All access points are ok',
group => [
{ name => 'ap_global', type => 0 }
]
}
];
$self->{maps_counters}->{global} = [
{ label => 'total', nlabel => 'accesspoints.total.count', set => {
key_values => [ { name => 'total' } ],
output_template => 'total: %s',
perfdatas => [
{ label => 'total', template => '%s', min => 0 }
]
}
},
{ label => 'total-idle', nlabel => 'accesspoints.idle.count', set => {
key_values => [ { name => 'idle' } ],
output_template => 'idle: %s',
perfdatas => [
{ label => 'total_idle', template => '%s', min => 0 }
]
}
},
{ label => 'total-autofind', nlabel => 'accesspoints.autofind.count', set => {
key_values => [ { name => 'autofind' } ],
output_template => 'autofind: %s',
perfdatas => [
{ label => 'total_autofind', template => '%s', min => 0 }
]
}
},
{ label => 'total-typeNotMatch', nlabel => 'accesspoints.typenotmatch.count', display_ok => 0, set => {
key_values => [ { name => 'typeNotMatch' } ],
output_template => 'type not match: %s',
perfdatas => [
{ label => 'total_type_not_match', template => '%s', min => 0 }
]
}
},
{ label => 'total-fault', nlabel => 'accesspoints.fault.count', set => {
key_values => [ { name => 'fault' } ],
output_template => 'fault: %s',
perfdatas => [
{ label => 'total_fault', template => '%s', min => 0 }
]
}
},
{ label => 'total-config', nlabel => 'accesspoints.config.count', set => {
key_values => [ { name => 'config' } ],
output_template => 'config: %s',
perfdatas => [
{ label => 'total_config', template => '%s', min => 0 }
]
}
},
{ label => 'total-config-failed', nlabel => 'accesspoints.configfailed.count', set => {
key_values => [ { name => 'configFailed' } ],
output_template => 'config failed: %s',
perfdatas => [
{ label => 'total_config_failed', template => '%s', min => 0 }
]
}
},
{ label => 'total-download', nlabel => 'accesspoints.download.count', set => {
key_values => [ { name => 'download' } ],
output_template => 'download: %s',
perfdatas => [
{ label => 'total_download', template => '%s', min => 0 }
]
}
},
{ label => 'total-normal', nlabel => 'accesspoints.normal.count', set => {
key_values => [ { name => 'normal' } ],
output_template => 'normal: %s',
perfdatas => [
{ label => 'total_normal', template => '%s', min => 0 }
]
}
},
{ label => 'total-committing', nlabel => 'accesspoints.committing.count', set => {
key_values => [ { name => 'committing' } ],
output_template => 'committing: %s',
perfdatas => [
{ label => 'total_committing', template => '%s', min => 0 }
]
}
},
{ label => 'total-commit-failed', nlabel => 'accesspoints.commitfailed.count', set => {
key_values => [ { name => 'commitFailed' } ],
output_template => 'commit failed: %s',
perfdatas => [
{ label => 'total_commit_failed', template => '%s', min => 0 }
]
}
},
{ label => 'total-standby', nlabel => 'accesspoints.standby.count', set => {
key_values => [ { name => 'standby' } ],
output_template => 'standby: %s',
perfdatas => [
{ label => 'total_standby', template => '%s', min => 0 }
]
}
},
{ label => 'total-version-mismatch', nlabel => 'accesspoints.vermismatch.count', set => {
key_values => [ { name => 'verMismatch' } ],
output_template => 'version mismatch: %s',
perfdatas => [
{ label => 'total_version_mismatch', template => '%s', min => 0 }
]
}
},
{ label => 'total-name-conflicted', nlabel => 'accesspoints.nameconflicted.count', set => {
key_values => [ { name => 'nameConflicted' } ],
output_template => 'name conflicted: %s',
perfdatas => [
{ label => 'total_name_conflicted', template => '%s', min => 0 }
]
}
},
{ label => 'total-invalid', nlabel => 'accesspoints.invalid.count', set => {
key_values => [ { name => 'invalid' } ],
output_template => 'invalid: %s',
perfdatas => [
{ label => 'total_invalid', template => '%s', min => 0 }
]
}
},
{ label => 'total-country-code-mismatch', nlabel => 'accesspoints.countrycodemismatch.count', set => {
key_values => [ { name => 'countryCodeMismatch' } ],
output_template => 'country code mismatch: %s',
perfdatas => [
{ label => 'total_country_code_mismatch', template => '%s', min => 0 }
]
}
}
];
$self->{maps_counters}->{ap_global} = [
{ label => 'status',
type => 2,
critical_default => '%{runstate} =~ /fault|configFailed|commitFailed|verMismatch|nameConflicted|invalid/',
warning_default => '%{runstate} =~ /countryCodeMismatch|typeNotMatch/',
set =>
{
key_values =>
[ { name => 'runstate' }, { name => 'display' } ],
closure_custom_output =>
$self->can('custom_status_output'),
closure_custom_perfdata =>
sub {return 0;},
closure_custom_threshold_check =>
\&catalog_status_threshold_ng
}
}
];
}
sub new {
my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
bless $self, $class;
$options{options}->add_options(arguments => {
"filter-name:s" => { name => 'filter_name' },
"filter-address:s" => { name => 'filter_address' },
"filter-group:s" => { name => 'filter_group' }
});
return $self;
}
my $map_run_state = {
1 => 'idle',
2 => 'autofind',
3 => 'typeNotMatch',
4 => 'fault',
5 => 'config',
6 => 'configFailed',
7 => 'download',
8 => 'normal',
9 => 'committing',
10 => 'commitFailed',
11 => 'standby',
12 => 'verMismatch',
13 => 'nameConflicted',
14 => 'invalid',
15 => 'countryCodeMismatch'
};
my $mapping = {
name => { oid => '.1.3.6.1.4.1.2011.6.139.13.3.3.1.4' },# hwWlanApName
address => { oid => '.1.3.6.1.4.1.2011.6.139.13.3.3.1.13' }# hwWlanApIpAddress
};
my $mapping_stat = {
runtime => { oid => '.1.3.6.1.4.1.2011.6.139.13.3.3.1.18' },# hwWlanApRunTime
group => { oid => '.1.3.6.1.4.1.2011.6.139.13.3.3.1.5' },# hwWlanApGroup
runstate =>
{ oid => '.1.3.6.1.4.1.2011.6.139.13.3.3.1.6', map => $map_run_state }# hwWlanApRunState
};
sub manage_selection {
my ($self, %options) = @_;
$self->{ap} = {};
$self->{global} = {
total => 0,
idle => 0,
autofind => 0,
typeNotMatch => 0,
fault => 0,
config => 0,
configFailed => 0,
download => 0,
normal => 0,
committing => 0,
commitFailed => 0,
standby => 0,
verMismatch => 0,
nameConflicted => 0,
invalid => 0,
countryCodeMismatch => 0
};
my $request = [ { oid => $mapping->{name}->{oid} } ];
push @$request, { oid => $mapping->{group}->{oid} }
if (defined($self->{option_results}->{filter_group})
&& $self->{option_results}->{filter_group} ne ''
);
push @$request, { oid => $mapping->{address}->{oid} }
if (defined($self->{option_results}->{filter_address}) && $self->{option_results}->{filter_address} ne '');
my $snmp_result = $options{snmp}->get_multiple_table(
oids => $request,
return_type => 1,
nothing_quit => 1
);
foreach (sort keys %$snmp_result) {
next if (!/^$mapping->{name}->{oid}\.(.*)/);
my $instance = $1;
my $result = $options{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => $instance);
if (!defined($result->{name}) || $result->{name} eq '') {
$self->{output}->output_add(
long_msg => "skipping WLC '$instance': cannot get a name. please set it.",
debug => 1
);
next;
}
if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' &&
$result->{name} !~ /$self->{option_results}->{filter_name}/) {
$self->{output}->output_add(
long_msg => "skipping '" . $result->{name} . "': no matching name filter.",
debug => 1
);
next;
}
if (defined($self->{option_results}->{filter_address}) && $self->{option_results}->{filter_address} ne '' &&
$result->{address} !~ /$self->{option_results}->{filter_address}/) {
$self->{output}->output_add(
long_msg => "skipping '" . $result->{address} . "': no matching address filter.",
debug => 1
);
next;
}
if (defined($self->{option_results}->{filter_group}) && $self->{option_results}->{filter_group} ne '' &&
$result->{group} !~ /$self->{option_results}->{filter_group}/) {
$self->{output}->output_add(
long_msg => "skipping '" . $result->{group} . "': no matching group filter.",
debug => 1
);
next;
}
$self->{ap}->{ $result->{name} } = {
instance => $instance,
display => $result->{name},
ap_global => { display => $result->{name} }
};
}
if (scalar(keys %{$self->{ap}}) <= 0) {
$self->{output}->output_add(long_msg => 'no AP associated');
return;
}
$options{snmp}->load(
oids => [ map($_->{oid}, values(%$mapping_stat)) ],
instances => [ map($_->{instance}, values %{$self->{ap}}) ],
instance_regexp => '^(.*)$'
);
$snmp_result = $options{snmp}->get_leef();
foreach (sort keys %{$self->{ap}}) {
my $result = $options{snmp}->map_instance(
mapping => $mapping_stat,
results => $snmp_result,
instance => $self->{ap}->{$_}->{instance});
$self->{global}->{total}++;
$self->{global}->{ $result->{runstate} }++;
$self->{ap}->{$_}->{ap_global}->{runstate} = $result->{runstate};
}
}
1;
__END__
=head1 MODE
Check AP status.
=over 8
=item B<--filter-counters>
Only display some counters (regexp can be used).
Example: C<--filter-counters='^total$|^total-normal$'>
=item B<--filter-name>
Filter access point name (can be a regexp)
=item B<--filter-address>
Filter access point IP address (can be a regexp).
=item B<--filter-group>
Filter access point group (can be a regexp).
=item B<--warning-status>
Define the conditions to match for the status to be WARNING. (default: C<'%{runstate} =~ /countryCodeMismatch|typeNotMatch/'>).
You can use the following variables: C<%{runstate}>, C<%{display}>.
C<%(runstate)> can have one of these values: C<idle>, C<autofind>, C<typeNotMatch>, C<fault>, C<config>, C<configFailed>, C<download>, C<normal>, C<committing>, C<commitFailed>, C<standby>, C<verMismatch>, C<nameConflicted>, C<invalid>, C<countryCodeMismatch>.
=item B<--critical-status>
Define the conditions to match for the status to be CRITICAL. (default: C<'%{runstate} =~ /fault|configFailed|commitFailed|verMismatch|nameConflicted|invalid/'>).
You can use the following variables: C<%{runstate}>, C<%{display}>.
C<%(runstate)> can have one of these values: C<idle>, C<autofind>, C<typeNotMatch>, C<fault>, C<config>, C<configFailed>, C<download>, C<normal>, C<committing>, C<commitFailed>, C<standby>, C<verMismatch>, C<nameConflicted>, C<invalid>, C<countryCodeMismatch>.
=item B<--warning-total>
Thresholds.
=item B<--critical-total>
Thresholds.
=item B<--warning-total-idle>
Thresholds.
=item B<--critical-total-idle>
Thresholds.
=item B<--warning-total-autofind>
Thresholds.
=item B<--critical-total-autofind>
Thresholds.
=item B<--warning-total-typeNotMatch>
Thresholds.
=item B<--critical-total-typeNotMatch>
Thresholds.
=item B<--warning-total-fault>
Thresholds.
=item B<--critical-total-fault>
Thresholds.
=item B<--warning-total-config>
Thresholds.
=item B<--critical-total-config>
Thresholds.
=item B<--warning-total-config-failed>
Thresholds.
=item B<--critical-total-config-failed>
Thresholds.
=item B<--warning-total-download>
Thresholds.
=item B<--critical-total-download>
Thresholds.
=item B<--warning-total-normal>
Thresholds.
=item B<--critical-total-normal>
Thresholds.
=item B<--warning-total-committing>
Thresholds.
=item B<--critical-total-committing>
Thresholds.
=item B<--warning-total-commit-failed>
Thresholds.
=item B<--critical-total-commit-failed>
Thresholds.
=item B<--warning-total-standby>
Thresholds.
=item B<--critical-total-standby>
Thresholds.
=item B<--warning-total-version-mismatch>
Thresholds.
=item B<--critical-total-version-mismatch>
Thresholds.
=item B<--warning-total-name-conflicted>
Thresholds.
=item B<--critical-total-name-conflicted>
Thresholds.
=item B<--warning-total-invalid>
Thresholds.
=item B<--critical-total-invalid>
Thresholds.
=item B<--warning-total-country-code-mismatch>
Thresholds.
=item B<--critical-total-country-code-mismatch>
Thresholds.
=back
=cut

View File

@ -0,0 +1,220 @@
#
# Copyright 2024 Centreon (http://www.centreon.com/)
#
# Centreon is a full-fledged industry-strength solution that meets
# the needs in IT infrastructure and application monitoring for
# service performance.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
package network::huawei::wlc::snmp::mode::listaps;
use base qw(centreon::plugins::mode);
use strict;
use warnings;
sub new {
my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
bless $self, $class;
$options{options}->add_options(arguments => {
"filter-name:s" => { name => 'filter_name' },
"filter-address:s" => { name => 'filter_address' },
"filter-group:s" => { name => 'filter_group' }
});
return $self;
}
sub check_options {
my ($self, %options) = @_;
$self->SUPER::init(%options);
}
sub manage_selection {
my ($self, %options) = @_;
# Collecting all the relevant informations user may needs when using discovery function for AP in Huawei WLC controllers.
# They had been select with https://support.huawei.com/enterprise/en/doc/EDOC1100306136/680fca71/huawei-wlan-ap-mib as support.
my $mapping = {
name => { oid => '.1.3.6.1.4.1.2011.6.139.13.3.3.1.4' },# hwWlanApName
serial => { oid => '.1.3.6.1.4.1.2011.6.139.13.3.3.1.2' },# hwWlanApSn
ap_group => { oid => '.1.3.6.1.4.1.2011.6.139.13.3.3.1.5' },# hwWlanApGroup
address => { oid => '.1.3.6.1.4.1.2011.6.139.13.3.3.1.13' },# hwWlanApIpAddress
software => { oid => '.1.3.6.1.4.1.2011.6.139.13.3.3.1.22' },# hwWlanApSysSoftwareDesc
run_time => { oid => '.1.3.6.1.4.1.2011.6.139.13.3.3.1.18' },# hwWlanApRunTime
hardware => { oid => '.1.3.6.1.4.1.2011.6.139.13.3.3.1.23' }# hwWlanApSysHardwareDesc
};
# parent oid for all the mapping usage
my $oid_bsnAPEntry = '.1.3.6.1.4.1.2011.6.139.13.3.3';
my $snmp_result = $options{snmp}->get_table(
oid => $oid_bsnAPEntry,
start => $mapping->{serial}->{oid},# First oid of the mapping => here : 2
end => $mapping->{hardware}->{oid}# Last oid of the mapping => here : 23
);
my $results = {};
# Iterate for all oids catch in snmp result above
foreach my $oid (keys %$snmp_result) {
next if ($oid !~ /^$mapping->{serial}->{oid}\.(.*)$/);
my $oid_path = $1;
my $result = $options{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => $oid_path);
if (!defined($result->{name}) || $result->{name} eq '') {
$self->{output}->output_add(long_msg =>
"skipping WLC '$oid_path': cannot get a name. please set it.",
debug =>
1);
next;
}
if (!defined($result->{address}) || $result->{address} eq '') {
$self->{output}->output_add(long_msg =>
"skipping WLC '$oid_path': cannot get a address. please set it.",
debug =>
1);
next;
}
if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' &&
$result->{name} !~ /$self->{option_results}->{filter_name}/) {
$self->{output}->output_add(long_msg =>
"skipping '" . $result->{name} . "': no matching name filter.",
debug =>
1);
next;
}
if (defined($self->{option_results}->{filter_address}) && $self->{option_results}->{filter_address} ne '' &&
$result->{address} !~ /$self->{option_results}->{filter_address}/) {
$self->{output}->output_add(long_msg =>
"skipping '" . $result->{address} . "': no matching address filter.",
debug =>
1);
next;
}
if (defined($self->{option_results}->{filter_group}) && $self->{option_results}->{filter_group} ne '' &&
$result->{ap_group} !~ /$self->{option_results}->{filter_group}/) {
$self->{output}->output_add(long_msg =>
"skipping '" . $result->{ap_group} . "': no matching group filter.",
debug =>
1);
next;
}
$results->{$oid_path} = {
name => $result->{name},
serial => $result->{serial},
address => $result->{address},
hardware => $result->{hardware},
software => $result->{software},
run_time => $result->{run_time},
ap_group => $result->{ap_group}
};
}
return $results;
}
sub run {
my ($self, %options) = @_;
my $results = $self->manage_selection(snmp => $options{snmp});
foreach my $oid_path (sort keys %$results) {
$self->{output}->output_add(
long_msg => sprintf(
'[oid_path: %s] [name: %s] [serial: %s] [address: %s] [hardware: %s] [software: %s] [run_time: %s] [ap_group: %s]',
$oid_path,
$results->{$oid_path}->{name},
$results->{$oid_path}->{serial},
$results->{$oid_path}->{address},
$results->{$oid_path}->{hardware},
$results->{$oid_path}->{software},
centreon::plugins::misc::change_seconds(value => $results->{$oid_path}->{run_time}),
$results->{$oid_path}->{ap_group}
)
);
}
$self->{output}->output_add(
severity => 'OK',
short_msg => 'List aps'
);
$self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1);
$self->{output}->exit();
}
sub disco_format {
my ($self, %options) = @_;
$self->{output}->add_disco_format(elements =>
[ 'name', 'serial', 'address', 'hardware', 'software', 'run_time', 'ap_group' ]);
}
sub disco_show {
my ($self, %options) = @_;
my $results = $self->manage_selection(snmp => $options{snmp});
foreach my $oid_path (sort keys %$results) {
$self->{output}->add_disco_entry(
name =>
$results->{$oid_path}->{name},
serial =>
$results->{$oid_path}->{serial},
address =>
$results->{$oid_path}->{address},
hardware =>
$results->{$oid_path}->{hardware},
software =>
$results->{$oid_path}->{software},
run_time =>
defined($results->{$oid_path}->{run_time}) ?
centreon::plugins::misc::change_seconds(value => $results->{$oid_path}->{run_time}) :
"",
ap_group =>
$results->{$oid_path}->{ap_group}
);
}
}
1;
__END__
=head1 MODE
List wireless name.
=over 8
=item B<--filter-name>
Filter access points by name (can be a regexp).
=item B<--filter-address>
Filter access points by IP address (can be a regexp).
=item B<--filter-group>
Filter access point group (can be a regexp).
=back
=cut

View File

@ -0,0 +1,205 @@
#
# Copyright 2024 Centreon (http://www.centreon.com/)
#
# Centreon is a full-fledged industry-strength solution that meets
# the needs in IT infrastructure and application monitoring for
# service performance.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
package network::huawei::wlc::snmp::mode::listradios;
use base qw(centreon::plugins::mode);
use strict;
use warnings;
sub new {
my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
bless $self, $class;
$options{options}->add_options(arguments => {
"filter-name:s" => { name => 'filter_name' },
"filter-group:s" => { name => 'filter_group' }
});
return $self;
}
sub check_options {
my ($self, %options) = @_;
$self->SUPER::init(%options);
}
my $map_runstate = {
1 => 'up',
2 => 'down',
255 => 'invalid'
};
sub manage_selection {
my ($self, %options) = @_;
# Collecting all the relevant information user may needs when using discovery function for AP in Huawei WLC controllers.
# They had been select with https://support.huawei.com/enterprise/en/doc/EDOC1100306136/680fca71/huawei-wlan-ap-mib as support.
my $mapping = {
name => { oid => '.1.3.6.1.4.1.2011.6.139.16.1.2.1.3' },# hwWlanRadioInfoApName
frequence_type => { oid => '.1.3.6.1.4.1.2011.6.139.16.1.2.1.5' },# hwWlanRadioFreqType
ap_group => { oid => '.1.3.6.1.4.1.2011.6.139.16.1.2.1.55' },# hwWlanRadioApGroup
run_state => { oid => '.1.3.6.1.4.1.2011.6.139.16.1.2.1.6', map => $map_runstate },# hwWlanRadioRunState
description => { oid => '.1.3.6.1.4.1.2011.6.139.16.1.2.1.16' },# hwWlanRadioDescription
};
my $request = [ { oid => $mapping->{name}->{oid} } ];
push @$request, { oid => $mapping->{group}->{oid} }
if (defined($self->{option_results}->{filter_group}) && $self->{option_results}->{filter_group} ne '');
push @$request, { oid => $mapping->{address}->{oid} }
if (defined($self->{option_results}->{filter_address}) && $self->{option_results}->{filter_address} ne '');
my $snmp_result = $options{snmp}->get_multiple_table(
oids => $request,
return_type => 1,
nothing_quit => 1
);
my $results = {};
# Iterate for all oids catch in snmp result above
foreach my $oid (keys %$snmp_result) {
next if ($oid !~ /^$mapping->{name}->{oid}\.(.*)$/);
my $oid_path = $1;
my $result = $options{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => $oid_path);
if (!defined($result->{name}) || $result->{name} eq '') {
$self->{output}->output_add(long_msg => "skipping WLC '$oid_path': cannot get a name. please set it.", debug => 1);
next;
}
if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' &&
$result->{name} !~ /$self->{option_results}->{filter_name}/) {
$self->{output}->output_add(long_msg => "skipping '" . $result->{name} . "': no matching name filter.", debug => 1);
next;
}
if (defined($self->{option_results}->{filter_group}) && $self->{option_results}->{filter_group} ne '' &&
$result->{ap_group} !~ /$self->{option_results}->{filter_group}/) {
$self->{output}->output_add(long_msg => "skipping '" . $result->{ap_group} . "': no matching group filter.", debug => 1);
next;
}
$self->{ap}->{ $result->{name} } = {
instance => $oid_path,
display => $result->{name},
ap_global => { display => $result->{name} },
interfaces => {}
};
}
$options{snmp}->load(
oids => [ map($_->{oid}, values(%$mapping)) ],
instances => [ map($_->{instance}, values %{$self->{ap}}) ],
instance_regexp => '^(.*)$'
);
$snmp_result = $options{snmp}->get_leef();
foreach (keys %{$self->{ap}}) {
my $result = $options{snmp}->map_instance(mapping =>
$mapping, results =>
$snmp_result,
instance =>
$self->{ap}->{$_}->{instance});
$results->{$self->{ap}->{$_}->{instance}} = {
name => $result->{name},
frequence_type => $result->{frequence_type},
run_state => $result->{run_state},
description => $result->{description},
ap_group => $result->{ap_group}
};
}
return $results;
}
sub run {
my ($self, %options) = @_;
my $results = $self->manage_selection(snmp => $options{snmp});
foreach my $oid_path (sort keys %$results) {
$self->{output}->output_add(
long_msg => sprintf(
'[oid_path: %s] [name: %s] [frequence_type: %s] [run_state: %s] [description: %s] [ap_group: %s]',
$oid_path,
$results->{$oid_path}->{name},
$results->{$oid_path}->{frequence_type},
$results->{$oid_path}->{run_state},
$results->{$oid_path}->{description},
$results->{$oid_path}->{ap_group}
)
);
}
$self->{output}->output_add(
severity => 'OK',
short_msg => 'List aps'
);
$self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1);
$self->{output}->exit();
}
sub disco_format {
my ($self, %options) = @_;
$self->{output}->add_disco_format(elements =>
[ 'name', 'frequence_type', 'run_state', 'description', 'ap_group' ]);
}
sub disco_show {
my ($self, %options) = @_;
my $results = $self->manage_selection(snmp => $options{snmp});
foreach my $oid_path (sort keys %$results) {
$self->{output}->add_disco_entry(
name => $results->{$oid_path}->{name},
frequence_type => $results->{$oid_path}->{frequence_type},
run_state => $results->{$oid_path}->{run_state},
description => $results->{$oid_path}->{description},
ap_group => $results->{$oid_path}->{ap_group}
);
}
}
1;
__END__
=head1 MODE
List radios.
=over 8
=item B<--filter-name>
Display AP radios matching the filter.
=item B<--filter-group>
Display AP radios matching the filter.
=back
=cut

View File

@ -0,0 +1,299 @@
#
# Copyright 2024 Centreon (http://www.centreon.com/)
#
# Centreon is a full-fledged industry-strength solution that meets
# the needs in IT infrastructure and application monitoring for
# service performance.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
package network::huawei::wlc::snmp::mode::wlanglobal;
use base qw(centreon::plugins::templates::counter);
use strict;
use warnings;
use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold_ng);
sub custom_normal_output {
my ($self, %options) = @_;
return sprintf(
'Access Points normal state %s on %s (%.2f%%)',
$self->{result_values}->{normal},
$self->{result_values}->{total},
$self->{result_values}->{normal_prct},
);
}
sub custom_success_auth_user_output {
my ($self, %options) = @_;
return sprintf(
'Access Points user authentications %s on %s (%.2f%%)',
$self->{result_values}->{current_auth_user},
$self->{result_values}->{current_user},
$self->{result_values}->{current_auth_user_prct},
);
}
sub custom_current_auth_user_prct_output {
my ($self, %options) = @_;
return sprintf(
'Access Points user authentications %.2f%% (%s on %s)',
$self->{result_values}->{current_auth_user_prct},
$self->{result_values}->{current_auth_user},
$self->{result_values}->{current_user},
);
}
sub custom_normal_prct_output {
my ($self, %options) = @_;
return sprintf(
'Access Points normal state %.2f%% (%s on %s)',
$self->{result_values}->{normal_prct},
$self->{result_values}->{normal},
$self->{result_values}->{total},
);
}
sub custom_fault_prct_output {
my ($self, %options) = @_;
return sprintf(
'Access Points fault state %.2f%% (%s on %s)',
$self->{result_values}->{fault_prct},
$self->{result_values}->{fault},
$self->{result_values}->{total},
);
}
sub custom_fault_output {
my ($self, %options) = @_;
return sprintf(
'Access Points fault state %s on %s (%.2f%%)',
$self->{result_values}->{fault},
$self->{result_values}->{total},
$self->{result_values}->{fault_prct}
);
}
sub set_counters {
my ($self, %options) = @_;
$self->{maps_counters_type} = [
{ name => 'global', type => 0, cb_prefix_output => 'prefix_global_output' },
];
$self->{maps_counters}->{global} = [
{ label => 'total', nlabel => 'accesspoints.total.count', display_ok => 0, set => {
key_values => [ { name => 'total' } ],
output_template => 'total: %s',
perfdatas => [
{ template => '%s', min => 0 }
]
}
},
{ label => 'normal', nlabel => 'accesspoints.normal.count', display_ok => 1, set => {
key_values => [ { name => 'normal' }, { name => 'total' }, { name => 'normal_prct' } ],
closure_custom_output => $self->can('custom_normal_output'),
perfdatas => [
{ template => '%s', min => 0 }
]
}
},
{ label => 'fault', nlabel => 'accesspoints.fault.count', display_ok => 0, set => {
key_values => [ { name => 'fault' }, { name => 'total' }, { name => 'fault_prct' } ],
closure_custom_output => $self->can('custom_fault_output'),
perfdatas => [
{ template => '%s', min => 0 }
]
}
},
{ label => 'normal-prct', nlabel => 'accesspoints.normal.percentage', display_ok => 0, set => {
key_values => [ { name => 'normal_prct' }, { name => 'total' }, { name => 'normal' } ],
closure_custom_output => $self->can('custom_normal_output_prct'),
perfdatas => [
{ template => '%.2f', unit => '%', min => 0, max => 100 }
]
}
},
{ label => 'fault-prct', nlabel => 'accesspoints.fault.percentage', display_ok => 0, set => {
key_values => [ { name => 'fault_prct' }, { name => 'total' }, { name => 'fault' } ],
closure_custom_output => $self->can('custom_fault_output_prct'),
perfdatas => [
{ template => '%.2f', unit => '%', min => 0, max => 100 }
]
}
},
{ label => 'current-user', nlabel => 'accesspoints.user.count', display_ok => 0, set => {
key_values => [ { name => 'current_user' } ],
output_template => 'current user: %s',
perfdatas => [
{ template => '%s', min => 0 }
]
}
},
{ label => 'current-auth-user', nlabel => 'accesspoints.user.auth.count', display_ok => 0, set => {
key_values => [ { name => 'current_auth_user' }, { name => 'current_auth_user_prct' }, { name => 'current_user' } ],
closure_custom_output => $self->can('custom_success_auth_user_output'),
perfdatas => [
{ template => '%s', min => 0 }
]
}
},
{ label => 'current-auth-user-prct', nlabel => 'accesspoints.user.auth.percentage', display_ok => 1, set => {
key_values => [ { name => 'current_auth_user_prct' }, { name => 'current_auth_user' }, { name => 'current_user' } ],
closure_custom_output => $self->can('custom_current_auth_user_prct_output'),
perfdatas => [
{ template => '%.2f', unit => '%', min => 0, max => 100 }
]
}
}
];
}
sub new {
my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
bless $self, $class;
$options{options}->add_options(arguments => {});
return $self;
}
my $oid_normal = '.1.3.6.1.4.1.2011.6.139.12.1.5.6.0';# hwWlanServiceNormalAPCount
my $oid_total = '.1.3.6.1.4.1.2011.6.139.12.1.5.7.0';# hwWlanApCount
my $oid_cur_user = '.1.3.6.1.4.1.2011.6.139.12.1.2.2.0';# hwWlanCurAssocStaNum
my $oid_cur_auth_user = '.1.3.6.1.4.1.2011.6.139.12.1.2.3.0';# hwWlanCurAuthSuccessStaNum
sub manage_selection {
my ($self, %options) = @_;
$self->{global} = {
total => 0,
normal => 0,
normal_prct => 0,
fault => 0,
fault_prct => 0,
current_user => 0,
current_auth_user => 0
};
my $snmp_result = $options{snmp}->get_leef(
oids => [ $oid_normal, $oid_total, $oid_cur_user, $oid_cur_auth_user ],
nothing_quit => 0
);
$self->{global} = {
total => $snmp_result->{$oid_total},
normal => $snmp_result->{$oid_normal},
current_user => $snmp_result->{$oid_cur_user},
current_auth_user => $snmp_result->{$oid_cur_auth_user}
};
$self->{global}->{fault} = $self->{global}->{total} > 0 && $self->{global}->{normal} > 0 ?
$self->{global}->{total} - $self->{global}->{normal} : 0;
$self->{global}->{normal_prct} = $self->{global}->{total} > 0 ?
$self->{global}->{normal} * 100 / $self->{global}->{total} : 0;
$self->{global}->{fault_prct} = $self->{global}->{total} > 0 ?
$self->{global}->{fault} * 100 / $self->{global}->{total} : 0;
$self->{global}->{current_auth_user_prct} = $self->{global}->{current_user} > 0 ?
$self->{global}->{current_auth_user} * 100 / $self->{global}->{current_user} : 0;
}
1;
__END__
=head1 MODE
Check global WLAN access point count and user associated and authenticated.
=over 8
=item B<--warning-total>
Thresholds.
=item B<--critical-total>
Thresholds.
=item B<--warning-normal>
Thresholds.
=item B<--critical-normal>
Thresholds.
=item B<--warning-normal-prct>
Thresholds.
=item B<--critical-normal-prct>
Thresholds.
=item B<--warning-fault>
Thresholds.
=item B<--critical-fault>
Thresholds.
=item B<--warning-fault-prct>
Thresholds.
=item B<--critical-fault-prct>
Thresholds.
=item B<--warning-current-user>
Thresholds.
=item B<--critical-current-user>
Thresholds.
=item B<--warning-current-auth-user>
Thresholds.
=item B<--critical-current-auth-user>
Thresholds.
=item B<--warning-current-auth-user-prct>
Thresholds.
=item B<--critical-current-auth-user-prct>
Thresholds.
=back
=cut

View File

@ -0,0 +1,58 @@
#
# Copyright 2024 Centreon (http://www.centreon.com/)
#
# Centreon is a full-fledged industry-strength solution that meets
# the needs in IT infrastructure and application monitoring for
# service performance.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
package network::huawei::wlc::snmp::plugin;
use strict;
use warnings;
use base qw(centreon::plugins::script_snmp);
sub new {
my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
bless $self, $class;
$self->{modes} = {
'ap-health' => 'network::huawei::wlc::snmp::mode::aphealth',
'ap-radio' => 'network::huawei::wlc::snmp::mode::apradio',
'ap-status' => 'network::huawei::wlc::snmp::mode::apstatus',
'cpu' => 'centreon::common::huawei::standard::snmp::mode::cpu',
'hardware' => 'centreon::common::huawei::standard::snmp::mode::hardware',
'interfaces' => 'centreon::common::huawei::standard::snmp::mode::interfaces',
'list-aps' => 'network::huawei::wlc::snmp::mode::listaps',
'list-interfaces' => 'snmp_standard::mode::listinterfaces',
'list-radios' => 'network::huawei::wlc::snmp::mode::listradios',
'memory' => 'centreon::common::huawei::standard::snmp::mode::memory',
'uptime' => 'snmp_standard::mode::uptime',
'wlan-global' => 'network::huawei::wlc::snmp::mode::wlanglobal'
};
return $self;
}
1;
__END__
=head1 PLUGIN DESCRIPTION
Check Huawei WLC in SNMP.
=cut

View File

@ -161,7 +161,7 @@ sub run {
$interface_speed = $self->{option_results}->{speed};
}
if (defined($self->{option_results}->{skip_speed0}) && $interface_speed == 0) {
if (defined($self->{option_results}->{skip_speed0}) && ($interface_speed eq '' || $interface_speed == 0)) {
$self->{output}->output_add(long_msg => "skipping interface '" . $display_value . "': interface speed is 0 and option --skip-speed0 is set");
next;
}
@ -395,7 +395,7 @@ __END__
=item B<--interface>
Set the interface (number expected) example: 1,2,... (empty means 'check all interfaces').
Define which interfaces to monitor (number expected). Example: 1,2... (empty means 'check all interfaces').
=item B<--name>
@ -407,39 +407,41 @@ Set interface speed (in Mb).
=item B<--skip-speed0>
Don't display interface with speed 0.
Avoid displaying interfaces with bandwidth/speed equal to 0.
=item B<--filter-status>
Display interfaces matching the filter (example: 'up').
Filter interfaces based on their status using a regular expression (example: 'up|UP').
=item B<--use-adminstatus>
Display interfaces with AdminStatus 'up'.
Display interfaces with C<AdminStatus> 'up'.
=item B<--oid-filter>
Define the OID to be used to filter interfaces (default: ifName) (values: ifDesc, ifAlias, ifName).
Define the OID to be used to filter interfaces (default: C<ifName>).
Available OIDs: C<ifDesc>, C<ifAlias>, C<ifName>).
=item B<--oid-display>
Define the OID that will be used to name the interfaces (default: ifName) (values: ifDesc, ifAlias, ifName).
Define the OID that will be used to name the interfaces (default: ifName).
Available OIDs: C<ifDesc>, C<ifAlias>, C<ifName>).
=item B<--display-transform-src> B<--display-transform-dst>
Modify the interface name displayed by using a regular expression.
Example: adding --display-transform-src='eth' --display-transform-dst='ens' will replace all occurrences of 'eth' with 'ens'
Example: adding C<--display-transform-src='eth' --display-transform-dst='ens'> will replace all occurrences of 'eth' with 'ens'
=item B<--add-extra-oid>
Display an OID.
Example: --add-extra-oid='alias,.1.3.6.1.2.1.31.1.1.1.18'
or --add-extra-oid='vlan,.1.3.6.1.2.1.31.19,%{instance}\..*'
Example: C<--add-extra-oid='alias,.1.3.6.1.2.1.31.1.1.1.18'>
or C<--add-extra-oid='vlan,.1.3.6.1.2.1.31.19,%{instance}\..*'>
=item B<--add-mac-address>
Display interface mac address.
Display interfaces MAC addresses.
=back

View File

@ -0,0 +1,42 @@
*** Settings ***
Documentation Check AP health.
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s
Test Setup Ctn Generic Suite Setup
*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=network::huawei::wlc::snmp::plugin
*** Test Cases ***
ap-health ${tc}
[Tags] network snmp
${command} Catenate
... ${CMD}
... --mode=ap-health
... --hostname=${HOSTNAME}
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=network/huawei/wlc/snmp/slim_huawei_wlc
... --snmp-timeout=1
... ${extra_options}
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
Examples: tc extra_options expected_result --
... 1 --verbose --filter-name='Anonymized 065' OK: access point 'Anonymized 065' data link state: run, power-supply: normal, access point temperature: 42.00 C, access point Anonymized 065 online time is: 1d 22h 48m 58s, access point bootcount total: 424, access point memory: 22.00 %, access point cpu: 1.00%, access point up-Port speed: 1000 b/s, access point up-Port packet errors: 0.00%, access online user nums: 2 | 'Anonymized 065#ap.temperature.celsius'=42.00C;;;; 'Anonymized 065#ap.online.time'=168538;;;; 'Anonymized 065#ap.boot.total.count'=424;;;; 'Anonymized 065#ap.memory.used.percentage'=22.00%;;;; 'Anonymized 065#ap.cpu.used.percentage'=1.00%;;;; 'Anonymized 065#ap.up.port.bitspersecond'=1000b/s;;;; 'Anonymized 065#ap.up.port.package.error.percentage'=0.00;;;; 'Anonymized 065#ap.online.user.count'=2;;;; checking access point 'Anonymized 065' data link state: run, power-supply: normal, access point temperature: 42.00 C, access point Anonymized 065 online time is: 1d 22h 48m 58s, access point bootcount total: 424, access point memory: 22.00 %, access point cpu: 1.00%, access point up-Port speed: 1000 b/s, access point up-Port packet errors: 0.00%, access online user nums: 2
... 2 --filter-counters="" --filter-name='Anonymized 065' OK: access point 'Anonymized 065' data link state: run, power-supply: normal, access point temperature: 42.00 C, access point Anonymized 065 online time is: 1d 22h 48m 58s, access point bootcount total: 424, access point memory: 22.00 %, access point cpu: 1.00%, access point up-Port speed: 1000 b/s, access point up-Port packet errors: 0.00%, access online user nums: 2 | 'Anonymized 065#ap.temperature.celsius'=42.00C;;;; 'Anonymized 065#ap.online.time'=168538;;;; 'Anonymized 065#ap.boot.total.count'=424;;;; 'Anonymized 065#ap.memory.used.percentage'=22.00%;;;; 'Anonymized 065#ap.cpu.used.percentage'=1.00%;;;; 'Anonymized 065#ap.up.port.bitspersecond'=1000b/s;;;; 'Anonymized 065#ap.up.port.package.error.percentage'=0.00;;;; 'Anonymized 065#ap.online.user.count'=2;;;;
... 3 --filter-name='Anonymized 015' OK: access point 'Anonymized 015' data link state: run, power-supply: normal, access point temperature: 39.00 C, access point Anonymized 015 online time is: 18d 5h 17m 15s, access point bootcount total: 26, access point memory: 24.00 %, access point cpu: 1.00%, access point up-Port speed: 18000 b/s, access point up-Port packet errors: 0.00%, access online user nums: 1 | 'Anonymized 015#ap.temperature.celsius'=39.00C;;;; 'Anonymized 015#ap.online.time'=1574235;;;; 'Anonymized 015#ap.boot.total.count'=26;;;; 'Anonymized 015#ap.memory.used.percentage'=24.00%;;;; 'Anonymized 015#ap.cpu.used.percentage'=1.00%;;;; 'Anonymized 015#ap.up.port.bitspersecond'=18000b/s;;;; 'Anonymized 015#ap.up.port.package.error.percentage'=0.00;;;; 'Anonymized 015#ap.online.user.count'=1;;;;
... 4 --filter-address='' --filter-name='Anonymized 015' OK: access point 'Anonymized 015' data link state: run, power-supply: normal, access point temperature: 39.00 C, access point Anonymized 015 online time is: 18d 5h 17m 15s, access point bootcount total: 26, access point memory: 24.00 %, access point cpu: 1.00%, access point up-Port speed: 18000 b/s, access point up-Port packet errors: 0.00%, access online user nums: 1 | 'Anonymized 015#ap.temperature.celsius'=39.00C;;;; 'Anonymized 015#ap.online.time'=1574235;;;; 'Anonymized 015#ap.boot.total.count'=26;;;; 'Anonymized 015#ap.memory.used.percentage'=24.00%;;;; 'Anonymized 015#ap.cpu.used.percentage'=1.00%;;;; 'Anonymized 015#ap.up.port.bitspersecond'=18000b/s;;;; 'Anonymized 015#ap.up.port.package.error.percentage'=0.00;;;; 'Anonymized 015#ap.online.user.count'=1;;;;
... 5 --filter-group="" --filter-name='Anonymized 075' OK: access point 'Anonymized 075' data link state: run, power-supply: normal, access point temperature: 42.00 C, access point Anonymized 075 online time is: 1d 22h 48m 55s, access point bootcount total: 297, access point memory: 22.00 %, access point cpu: 1.00%, access point up-Port speed: 6000 b/s, access point up-Port packet errors: 0.00%, access online user nums: 7 | 'Anonymized 075#ap.temperature.celsius'=42.00C;;;; 'Anonymized 075#ap.online.time'=168535;;;; 'Anonymized 075#ap.boot.total.count'=297;;;; 'Anonymized 075#ap.memory.used.percentage'=22.00%;;;; 'Anonymized 075#ap.cpu.used.percentage'=1.00%;;;; 'Anonymized 075#ap.up.port.bitspersecond'=6000b/s;;;; 'Anonymized 075#ap.up.port.package.error.percentage'=0.00;;;; 'Anonymized 075#ap.online.user.count'=7;;;;
... 6 --warning-status='\\\%{powersupply} eq "limited"' --filter-name='Anonymized 030' CRITICAL: access point 'Anonymized 030' data link state: run, power-supply: limited | 'Anonymized 030#ap.temperature.celsius'=49.00C;;;; 'Anonymized 030#ap.online.time'=5281831;;;; 'Anonymized 030#ap.boot.total.count'=9;;;; 'Anonymized 030#ap.memory.used.percentage'=42.00%;;;; 'Anonymized 030#ap.cpu.used.percentage'=12.00%;;;; 'Anonymized 030#ap.up.port.bitspersecond'=235000b/s;;;; 'Anonymized 030#ap.up.port.package.error.percentage'=0.00;;;; 'Anonymized 030#ap.online.user.count'=8;;;;
... 7 --critical-status='\\\%{powersupply} =~ /insufficient|limited/ || \\\%{datalinkstate} !~ /run/' --filter-name='Anonymized 010' OK: access point 'Anonymized 010' data link state: run, power-supply: normal, access point temperature: 46.00 C, access point Anonymized 010 online time is: 56d 6h 55m 39s, access point bootcount total: 84, access point memory: 23.00 %, access point cpu: 1.00%, access point up-Port speed: 9933000 b/s, access point up-Port packet errors: 0.00%, access online user nums: 8 | 'Anonymized 010#ap.temperature.celsius'=46.00C;;;; 'Anonymized 010#ap.online.time'=4863339;;;; 'Anonymized 010#ap.boot.total.count'=84;;;; 'Anonymized 010#ap.memory.used.percentage'=23.00%;;;; 'Anonymized 010#ap.cpu.used.percentage'=1.00%;;;; 'Anonymized 010#ap.up.port.bitspersecond'=9933000b/s;;;; 'Anonymized 010#ap.up.port.package.error.percentage'=0.00;;;; 'Anonymized 010#ap.online.user.count'=8;;;;
... 8 --warning-temperature=0 --critical-temperature=100 --filter-name='Anonymized 010' WARNING: access point 'Anonymized 010' access point temperature: 46.00 C | 'Anonymized 010#ap.temperature.celsius'=46.00C;0:0;0:100;; 'Anonymized 010#ap.online.time'=4863339;;;; 'Anonymized 010#ap.boot.total.count'=84;;;; 'Anonymized 010#ap.memory.used.percentage'=23.00%;;;; 'Anonymized 010#ap.cpu.used.percentage'=1.00%;;;; 'Anonymized 010#ap.up.port.bitspersecond'=9933000b/s;;;; 'Anonymized 010#ap.up.port.package.error.percentage'=0.00;;;; 'Anonymized 010#ap.online.user.count'=8;;;;
... 9 --warning-bootcount-total=1 --critical-bootcount-total=2 --filter-name='Anonymized 010' CRITICAL: access point 'Anonymized 010' access point bootcount total: 84 | 'Anonymized 010#ap.temperature.celsius'=46.00C;;;; 'Anonymized 010#ap.online.time'=4863339;;;; 'Anonymized 010#ap.boot.total.count'=84;0:1;0:2;; 'Anonymized 010#ap.memory.used.percentage'=23.00%;;;; 'Anonymized 010#ap.cpu.used.percentage'=1.00%;;;; 'Anonymized 010#ap.up.port.bitspersecond'=9933000b/s;;;; 'Anonymized 010#ap.up.port.package.error.percentage'=0.00;;;; 'Anonymized 010#ap.online.user.count'=8;;;;
... 10 --warning-memory=0 --critical-memory=0 --filter-name='Anonymized 000' CRITICAL: access point 'Anonymized 000' access point memory: 23.00 % | 'Anonymized 000#ap.temperature.celsius'=45.00C;;;; 'Anonymized 000#ap.online.time'=2258619;;;; 'Anonymized 000#ap.boot.total.count'=115;;;; 'Anonymized 000#ap.memory.used.percentage'=23.00%;0:0;0:0;; 'Anonymized 000#ap.cpu.used.percentage'=1.00%;;;; 'Anonymized 000#ap.up.port.bitspersecond'=1000b/s;;;; 'Anonymized 000#ap.up.port.package.error.percentage'=0.00;;;; 'Anonymized 000#ap.online.user.count'=0;;;;
... 11 --warning-cpu='10' --critical-cpu='0' --filter-name='Anonymized 000' CRITICAL: access point 'Anonymized 000' access point cpu: 1.00% | 'Anonymized 000#ap.temperature.celsius'=45.00C;;;; 'Anonymized 000#ap.online.time'=2258619;;;; 'Anonymized 000#ap.boot.total.count'=115;;;; 'Anonymized 000#ap.memory.used.percentage'=23.00%;;;; 'Anonymized 000#ap.cpu.used.percentage'=1.00%;0:10;0:0;; 'Anonymized 000#ap.up.port.bitspersecond'=1000b/s;;;; 'Anonymized 000#ap.up.port.package.error.percentage'=0.00;;;; 'Anonymized 000#ap.online.user.count'=0;;;;
... 12 --warning-up-port-speed=0 --critical-up-port-speed=0 --filter-name='Anonymized 001' CRITICAL: access point 'Anonymized 001' data link state: run, power-supply: limited, access point up-Port speed: 1000 b/s | 'Anonymized 001#ap.temperature.celsius'=41.00C;;;; 'Anonymized 001#ap.online.time'=1319610;;;; 'Anonymized 001#ap.boot.total.count'=1023;;;; 'Anonymized 001#ap.memory.used.percentage'=22.00%;;;; 'Anonymized 001#ap.cpu.used.percentage'=1.00%;;;; 'Anonymized 001#ap.up.port.bitspersecond'=1000b/s;0:0;0:0;; 'Anonymized 001#ap.up.port.package.error.percentage'=0.00;;;; 'Anonymized 001#ap.online.user.count'=1;;;;
... 13 --warning-up-port-packet-err=0 --critical-up-port-packet-err=0 --filter-name='Anonymized 000' OK: access point 'Anonymized 000' data link state: run, power-supply: normal, access point temperature: 45.00 C, access point Anonymized 000 online time is: 26d 3h 23m 39s, access point bootcount total: 115, access point memory: 23.00 %, access point cpu: 1.00%, access point up-Port speed: 1000 b/s, access point up-Port packet errors: 0.00%, access online user nums: 0 | 'Anonymized 000#ap.temperature.celsius'=45.00C;;;; 'Anonymized 000#ap.online.time'=2258619;;;; 'Anonymized 000#ap.boot.total.count'=115;;;; 'Anonymized 000#ap.memory.used.percentage'=23.00%;;;; 'Anonymized 000#ap.cpu.used.percentage'=1.00%;;;; 'Anonymized 000#ap.up.port.bitspersecond'=1000b/s;;;; 'Anonymized 000#ap.up.port.package.error.percentage'=0.00;0:0;0:0;; 'Anonymized 000#ap.online.user.count'=0;;;;
... 14 --warning-online-user-num=0 --critical-online-user-num=0 --filter-name='Anonymized 000' OK: access point 'Anonymized 000' data link state: run, power-supply: normal, access point temperature: 45.00 C, access point Anonymized 000 online time is: 26d 3h 23m 39s, access point bootcount total: 115, access point memory: 23.00 %, access point cpu: 1.00%, access point up-Port speed: 1000 b/s, access point up-Port packet errors: 0.00%, access online user nums: 0 | 'Anonymized 000#ap.temperature.celsius'=45.00C;;;; 'Anonymized 000#ap.online.time'=2258619;;;; 'Anonymized 000#ap.boot.total.count'=115;;;; 'Anonymized 000#ap.memory.used.percentage'=23.00%;;;; 'Anonymized 000#ap.cpu.used.percentage'=1.00%;;;; 'Anonymized 000#ap.up.port.bitspersecond'=1000b/s;;;; 'Anonymized 000#ap.up.port.package.error.percentage'=0.00;;;; 'Anonymized 000#ap.online.user.count'=0;0:0;0:0;;

View File

@ -0,0 +1,41 @@
*** Settings ***
Documentation Check Huawei WLC equipments in SNMP.
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s
Test Setup Ctn Generic Suite Setup
*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=network::huawei::wlc::snmp::plugin
*** Test Cases ***
ap-radio ${tc}
[Tags] network snmp
${command} Catenate
... ${CMD}
... --mode=ap-radio
... --hostname=${HOSTNAME}
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=network/huawei/wlc/snmp/slim_huawei_wlc
... --snmp-timeout=1
... ${extra_options}
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
Examples: tc extra_options expected_result --
... 1 --filter-name='Anonymized 015' OK: access point 'Anonymized 015' run state: up, radio package error rate: 0.00%, radio noise: -95 dBm, radio channel utilization rate: 13.00%, radio channel interference rate: 6.00%, radio channel receive rate: 0 b/s, radio channel send rate: 523000 b/s | 'Anonymized 015#ap.radio.packageerror.percentage'=0.00%;;;; 'Anonymized 015#ap.radio.noise.dbm'=-95dBm;;;; 'Anonymized 015#ap.radio.channel.utilization.percentage'=13.00%;;;; 'Anonymized 015#ap.radio.channel.interference.percentage'=6.00%;;;; 'Anonymized 015#ap.radio.receive.bitspersecond'=0b/s;;;; 'Anonymized 015#ap.radio.send.bitspersecond'=523000b/s;;;;
... 2 --filter-counters="" --filter-name='Anonymized 015' OK: access point 'Anonymized 015' run state: up, radio package error rate: 0.00%, radio noise: -95 dBm, radio channel utilization rate: 13.00%, radio channel interference rate: 6.00%, radio channel receive rate: 0 b/s, radio channel send rate: 523000 b/s | 'Anonymized 015#ap.radio.packageerror.percentage'=0.00%;;;; 'Anonymized 015#ap.radio.noise.dbm'=-95dBm;;;; 'Anonymized 015#ap.radio.channel.utilization.percentage'=13.00%;;;; 'Anonymized 015#ap.radio.channel.interference.percentage'=6.00%;;;; 'Anonymized 015#ap.radio.receive.bitspersecond'=0b/s;;;; 'Anonymized 015#ap.radio.send.bitspersecond'=523000b/s;;;;
... 3 --filter-name='Anonymized 015' OK: access point 'Anonymized 015' run state: up, radio package error rate: 0.00%, radio noise: -95 dBm, radio channel utilization rate: 13.00%, radio channel interference rate: 6.00%, radio channel receive rate: 0 b/s, radio channel send rate: 523000 b/s | 'Anonymized 015#ap.radio.packageerror.percentage'=0.00%;;;; 'Anonymized 015#ap.radio.noise.dbm'=-95dBm;;;; 'Anonymized 015#ap.radio.channel.utilization.percentage'=13.00%;;;; 'Anonymized 015#ap.radio.channel.interference.percentage'=6.00%;;;; 'Anonymized 015#ap.radio.receive.bitspersecond'=0b/s;;;; 'Anonymized 015#ap.radio.send.bitspersecond'=523000b/s;;;;
... 4 --filter-address='' --filter-name='Anonymized 015' OK: access point 'Anonymized 015' run state: up, radio package error rate: 0.00%, radio noise: -95 dBm, radio channel utilization rate: 13.00%, radio channel interference rate: 6.00%, radio channel receive rate: 0 b/s, radio channel send rate: 523000 b/s | 'Anonymized 015#ap.radio.packageerror.percentage'=0.00%;;;; 'Anonymized 015#ap.radio.noise.dbm'=-95dBm;;;; 'Anonymized 015#ap.radio.channel.utilization.percentage'=13.00%;;;; 'Anonymized 015#ap.radio.channel.interference.percentage'=6.00%;;;; 'Anonymized 015#ap.radio.receive.bitspersecond'=0b/s;;;; 'Anonymized 015#ap.radio.send.bitspersecond'=523000b/s;;;;
... 5 --filter-group="" --filter-name='Anonymized 075' OK: access point 'Anonymized 075' run state: up, radio package error rate: 0.00%, radio noise: -95 dBm, radio channel utilization rate: 1.00%, radio channel interference rate: 0.00%, radio channel receive rate: 0 b/s, radio channel send rate: 0 b/s | 'Anonymized 075#ap.radio.packageerror.percentage'=0.00%;;;; 'Anonymized 075#ap.radio.noise.dbm'=-95dBm;;;; 'Anonymized 075#ap.radio.channel.utilization.percentage'=1.00%;;;; 'Anonymized 075#ap.radio.channel.interference.percentage'=0.00%;;;; 'Anonymized 075#ap.radio.receive.bitspersecond'=0b/s;;;; 'Anonymized 075#ap.radio.send.bitspersecond'=0b/s;;;;
... 6 --warning-status='\\\%{runstate}' --filter-name='Anonymized 030' WARNING: access point 'Anonymized 030' run state: up | 'Anonymized 030#ap.radio.packageerror.percentage'=0.00%;;;; 'Anonymized 030#ap.radio.noise.dbm'=-94dBm;;;; 'Anonymized 030#ap.radio.channel.utilization.percentage'=14.00%;;;; 'Anonymized 030#ap.radio.channel.interference.percentage'=15.00%;;;; 'Anonymized 030#ap.radio.receive.bitspersecond'=0b/s;;;; 'Anonymized 030#ap.radio.send.bitspersecond'=0b/s;;;;
... 7 --critical-status='\\\%{runstate} ne "up"' --filter-name='Anonymized 010' OK: access point 'Anonymized 010' run state: up, radio package error rate: 0.00%, radio noise: -95 dBm, radio channel utilization rate: 44.00%, radio channel interference rate: 2.00%, radio channel receive rate: 1813000 b/s, radio channel send rate: 38528000 b/s | 'Anonymized 010#ap.radio.packageerror.percentage'=0.00%;;;; 'Anonymized 010#ap.radio.noise.dbm'=-95dBm;;;; 'Anonymized 010#ap.radio.channel.utilization.percentage'=44.00%;;;; 'Anonymized 010#ap.radio.channel.interference.percentage'=2.00%;;;; 'Anonymized 010#ap.radio.receive.bitspersecond'=1813000b/s;;;; 'Anonymized 010#ap.radio.send.bitspersecond'=38528000b/s;;;;
... 8 --warning-package-error-rate=0 --critical-package-error-rate=100 --filter-name='Anonymized 010' OK: access point 'Anonymized 010' run state: up, radio package error rate: 0.00%, radio noise: -95 dBm, radio channel utilization rate: 44.00%, radio channel interference rate: 2.00%, radio channel receive rate: 1813000 b/s, radio channel send rate: 38528000 b/s | 'Anonymized 010#ap.radio.packageerror.percentage'=0.00%;0:0;0:100;; 'Anonymized 010#ap.radio.noise.dbm'=-95dBm;;;; 'Anonymized 010#ap.radio.channel.utilization.percentage'=44.00%;;;; 'Anonymized 010#ap.radio.channel.interference.percentage'=2.00%;;;; 'Anonymized 010#ap.radio.receive.bitspersecond'=1813000b/s;;;; 'Anonymized 010#ap.radio.send.bitspersecond'=38528000b/s;;;;
... 9 --warning-noise=1 --critical-noise=2 --filter-name='Anonymized 010' CRITICAL: access point 'Anonymized 010' radio noise: -95 dBm | 'Anonymized 010#ap.radio.packageerror.percentage'=0.00%;;;; 'Anonymized 010#ap.radio.noise.dbm'=-95dBm;0:1;0:2;; 'Anonymized 010#ap.radio.channel.utilization.percentage'=44.00%;;;; 'Anonymized 010#ap.radio.channel.interference.percentage'=2.00%;;;; 'Anonymized 010#ap.radio.receive.bitspersecond'=1813000b/s;;;; 'Anonymized 010#ap.radio.send.bitspersecond'=38528000b/s;;;;
... 10 --warning-channel-utilization-rate=0 --critical-channel-utilization-rate=10 --filter-name='Anonymized 000' WARNING: access point 'Anonymized 000' radio channel utilization rate: 2.00% | 'Anonymized 000#ap.radio.packageerror.percentage'=1.00%;;;; 'Anonymized 000#ap.radio.noise.dbm'=-95dBm;;;; 'Anonymized 000#ap.radio.channel.utilization.percentage'=2.00%;0:0;0:10;; 'Anonymized 000#ap.radio.channel.interference.percentage'=0.00%;;;; 'Anonymized 000#ap.radio.receive.bitspersecond'=5000b/s;;;; 'Anonymized 000#ap.radio.send.bitspersecond'=306000b/s;;;;
... 11 --warning-channel-interference-rate='10' --critical-channel-interference-rate='0' --filter-name='Anonymized 000' OK: access point 'Anonymized 000' run state: up, radio package error rate: 1.00%, radio noise: -95 dBm, radio channel utilization rate: 2.00%, radio channel interference rate: 0.00%, radio channel receive rate: 5000 b/s, radio channel send rate: 306000 b/s | 'Anonymized 000#ap.radio.packageerror.percentage'=1.00%;;;; 'Anonymized 000#ap.radio.noise.dbm'=-95dBm;;;; 'Anonymized 000#ap.radio.channel.utilization.percentage'=2.00%;;;; 'Anonymized 000#ap.radio.channel.interference.percentage'=0.00%;0:10;0:0;; 'Anonymized 000#ap.radio.receive.bitspersecond'=5000b/s;;;; 'Anonymized 000#ap.radio.send.bitspersecond'=306000b/s;;;;
... 12 --warning-receive-rate=0 --critical-receive-rate=0 --filter-name='Anonymized 001' CRITICAL: access point 'Anonymized 001' radio channel receive rate: 86000 b/s | 'Anonymized 001#ap.radio.packageerror.percentage'=0.00%;;;; 'Anonymized 001#ap.radio.noise.dbm'=-95dBm;;;; 'Anonymized 001#ap.radio.channel.utilization.percentage'=4.00%;;;; 'Anonymized 001#ap.radio.channel.interference.percentage'=0.00%;;;; 'Anonymized 001#ap.radio.receive.bitspersecond'=86000b/s;0:0;0:0;; 'Anonymized 001#ap.radio.send.bitspersecond'=1487000b/s;;;;
... 13 --warning-send-rate=0 --critical-send-rate=0 --filter-name='Anonymized 000' CRITICAL: access point 'Anonymized 000' radio channel send rate: 306000 b/s | 'Anonymized 000#ap.radio.packageerror.percentage'=1.00%;;;; 'Anonymized 000#ap.radio.noise.dbm'=-95dBm;;;; 'Anonymized 000#ap.radio.channel.utilization.percentage'=2.00%;;;; 'Anonymized 000#ap.radio.channel.interference.percentage'=0.00%;;;; 'Anonymized 000#ap.radio.receive.bitspersecond'=5000b/s;;;; 'Anonymized 000#ap.radio.send.bitspersecond'=306000b/s;0:0;0:0;;

View File

@ -0,0 +1,51 @@
*** Settings ***
Documentation Check Huawei equipments in SNMP.
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s
Test Setup Ctn Generic Suite Setup
*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=network::huawei::wlc::snmp::plugin
*** Test Cases ***
ap-status ${tc}
[Tags] network snmp
${command} Catenate
... ${CMD}
... --mode=ap-status
... --hostname=${HOSTNAME}
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=network/huawei/wlc/snmp/slim_huawei_wlc
... --snmp-timeout=1
... ${extra_options}
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
Examples: tc extra_options expected_result --
... 1 --verbose --filter-name='Anonymized 015' OK: Access points total: 1, idle: 0, autofind: 0, fault: 0, config: 0, config failed: 0, download: 0, normal: 1, committing: 0, commit failed: 0, standby: 0, version mismatch: 0, name conflicted: 0, invalid: 0, country code mismatch: 0 - access point 'Anonymized 015' status: normal | 'total'=1;;;0; 'total_idle'=0;;;0; 'total_autofind'=0;;;0; 'total_type_not_match'=0;;;0; 'total_fault'=0;;;0; 'total_config'=0;;;0; 'total_config_failed'=0;;;0; 'total_download'=0;;;0; 'total_normal'=1;;;0; 'total_committing'=0;;;0; 'total_commit_failed'=0;;;0; 'total_standby'=0;;;0; 'total_version_mismatch'=0;;;0; 'total_name_conflicted'=0;;;0; 'total_invalid'=0;;;0; 'total_country_code_mismatch'=0;;;0; checking access point 'Anonymized 015' status: normal
... 2 --filter-counters='^total$|^total-normal$' OK: Access points total: 225, normal: 217 - All access points are ok | 'total'=225;;;0; 'total_normal'=217;;;0;
... 3 --filter-name='Anonymized 015' OK: Access points total: 1, idle: 0, autofind: 0, fault: 0, config: 0, config failed: 0, download: 0, normal: 1, committing: 0, commit failed: 0, standby: 0, version mismatch: 0, name conflicted: 0, invalid: 0, country code mismatch: 0 - access point 'Anonymized 015' status: normal | 'total'=1;;;0; 'total_idle'=0;;;0; 'total_autofind'=0;;;0; 'total_type_not_match'=0;;;0; 'total_fault'=0;;;0; 'total_config'=0;;;0; 'total_config_failed'=0;;;0; 'total_download'=0;;;0; 'total_normal'=1;;;0; 'total_committing'=0;;;0; 'total_commit_failed'=0;;;0; 'total_standby'=0;;;0; 'total_version_mismatch'=0;;;0; 'total_name_conflicted'=0;;;0; 'total_invalid'=0;;;0; 'total_country_code_mismatch'=0;;;0;
... 4 --filter-address='' --filter-name='Anonymized 015' OK: Access points total: 1, idle: 0, autofind: 0, fault: 0, config: 0, config failed: 0, download: 0, normal: 1, committing: 0, commit failed: 0, standby: 0, version mismatch: 0, name conflicted: 0, invalid: 0, country code mismatch: 0 - access point 'Anonymized 015' status: normal | 'total'=1;;;0; 'total_idle'=0;;;0; 'total_autofind'=0;;;0; 'total_type_not_match'=0;;;0; 'total_fault'=0;;;0; 'total_config'=0;;;0; 'total_config_failed'=0;;;0; 'total_download'=0;;;0; 'total_normal'=1;;;0; 'total_committing'=0;;;0; 'total_commit_failed'=0;;;0; 'total_standby'=0;;;0; 'total_version_mismatch'=0;;;0; 'total_name_conflicted'=0;;;0; 'total_invalid'=0;;;0; 'total_country_code_mismatch'=0;;;0;
... 5 --filter-group="" --filter-name='Anonymized 075' OK: Access points total: 1, idle: 0, autofind: 0, fault: 0, config: 0, config failed: 0, download: 0, normal: 1, committing: 0, commit failed: 0, standby: 0, version mismatch: 0, name conflicted: 0, invalid: 0, country code mismatch: 0 - access point 'Anonymized 075' status: normal | 'total'=1;;;0; 'total_idle'=0;;;0; 'total_autofind'=0;;;0; 'total_type_not_match'=0;;;0; 'total_fault'=0;;;0; 'total_config'=0;;;0; 'total_config_failed'=0;;;0; 'total_download'=0;;;0; 'total_normal'=1;;;0; 'total_committing'=0;;;0; 'total_commit_failed'=0;;;0; 'total_standby'=0;;;0; 'total_version_mismatch'=0;;;0; 'total_name_conflicted'=0;;;0; 'total_invalid'=0;;;0; 'total_country_code_mismatch'=0;;;0;
... 6 --warning-status='\\\%{runstate} =~ /countryCodeMismatch|typeNotMatch/' --filter-name='Anonymized 030' OK: Access points total: 1, idle: 0, autofind: 0, fault: 0, config: 0, config failed: 0, download: 0, normal: 1, committing: 0, commit failed: 0, standby: 0, version mismatch: 0, name conflicted: 0, invalid: 0, country code mismatch: 0 - access point 'Anonymized 030' status: normal | 'total'=1;;;0; 'total_idle'=0;;;0; 'total_autofind'=0;;;0; 'total_type_not_match'=0;;;0; 'total_fault'=0;;;0; 'total_config'=0;;;0; 'total_config_failed'=0;;;0; 'total_download'=0;;;0; 'total_normal'=1;;;0; 'total_committing'=0;;;0; 'total_commit_failed'=0;;;0; 'total_standby'=0;;;0; 'total_version_mismatch'=0;;;0; 'total_name_conflicted'=0;;;0; 'total_invalid'=0;;;0; 'total_country_code_mismatch'=0;;;0;
... 7 --critical-status='\\\%{runstate} =~ /fault|configFailed|commitFailed|verMismatch|nameConflicted|invalid/' --filter-name='Anonymized 010' OK: Access points total: 1, idle: 0, autofind: 0, fault: 0, config: 0, config failed: 0, download: 0, normal: 1, committing: 0, commit failed: 0, standby: 0, version mismatch: 0, name conflicted: 0, invalid: 0, country code mismatch: 0 - access point 'Anonymized 010' status: normal | 'total'=1;;;0; 'total_idle'=0;;;0; 'total_autofind'=0;;;0; 'total_type_not_match'=0;;;0; 'total_fault'=0;;;0; 'total_config'=0;;;0; 'total_config_failed'=0;;;0; 'total_download'=0;;;0; 'total_normal'=1;;;0; 'total_committing'=0;;;0; 'total_commit_failed'=0;;;0; 'total_standby'=0;;;0; 'total_version_mismatch'=0;;;0; 'total_name_conflicted'=0;;;0; 'total_invalid'=0;;;0; 'total_country_code_mismatch'=0;;;0;
... 8 --warning-total=0 --critical-total=100 --filter-name='Anonymized 010' WARNING: Access points total: 1 | 'total'=1;0:0;0:100;0; 'total_idle'=0;;;0; 'total_autofind'=0;;;0; 'total_type_not_match'=0;;;0; 'total_fault'=0;;;0; 'total_config'=0;;;0; 'total_config_failed'=0;;;0; 'total_download'=0;;;0; 'total_normal'=1;;;0; 'total_committing'=0;;;0; 'total_commit_failed'=0;;;0; 'total_standby'=0;;;0; 'total_version_mismatch'=0;;;0; 'total_name_conflicted'=0;;;0; 'total_invalid'=0;;;0; 'total_country_code_mismatch'=0;;;0;
... 9 --warning-total-idle=1 --critical-total-idle=2 --filter-name='Anonymized 010' OK: Access points total: 1, idle: 0, autofind: 0, fault: 0, config: 0, config failed: 0, download: 0, normal: 1, committing: 0, commit failed: 0, standby: 0, version mismatch: 0, name conflicted: 0, invalid: 0, country code mismatch: 0 - access point 'Anonymized 010' status: normal | 'total'=1;;;0; 'total_idle'=0;0:1;0:2;0; 'total_autofind'=0;;;0; 'total_type_not_match'=0;;;0; 'total_fault'=0;;;0; 'total_config'=0;;;0; 'total_config_failed'=0;;;0; 'total_download'=0;;;0; 'total_normal'=1;;;0; 'total_committing'=0;;;0; 'total_commit_failed'=0;;;0; 'total_standby'=0;;;0; 'total_version_mismatch'=0;;;0; 'total_name_conflicted'=0;;;0; 'total_invalid'=0;;;0; 'total_country_code_mismatch'=0;;;0;
... 10 --warning-total-autofind=0 --critical-total-autofind=10 --filter-name='Anonymized 000' OK: Access points total: 1, idle: 0, autofind: 0, fault: 0, config: 0, config failed: 0, download: 0, normal: 1, committing: 0, commit failed: 0, standby: 0, version mismatch: 0, name conflicted: 0, invalid: 0, country code mismatch: 0 - access point 'Anonymized 000' status: normal | 'total'=1;;;0; 'total_idle'=0;;;0; 'total_autofind'=0;0:0;0:10;0; 'total_type_not_match'=0;;;0; 'total_fault'=0;;;0; 'total_config'=0;;;0; 'total_config_failed'=0;;;0; 'total_download'=0;;;0; 'total_normal'=1;;;0; 'total_committing'=0;;;0; 'total_commit_failed'=0;;;0; 'total_standby'=0;;;0; 'total_version_mismatch'=0;;;0; 'total_name_conflicted'=0;;;0; 'total_invalid'=0;;;0; 'total_country_code_mismatch'=0;;;0;
... 11 --warning-total-typeNotMatch='10' --critical-total-typeNotMatch='0' --filter-name='Anonymized 000' OK: Access points total: 1, idle: 0, autofind: 0, fault: 0, config: 0, config failed: 0, download: 0, normal: 1, committing: 0, commit failed: 0, standby: 0, version mismatch: 0, name conflicted: 0, invalid: 0, country code mismatch: 0 - access point 'Anonymized 000' status: normal | 'total'=1;;;0; 'total_idle'=0;;;0; 'total_autofind'=0;;;0; 'total_type_not_match'=0;0:10;0:0;0; 'total_fault'=0;;;0; 'total_config'=0;;;0; 'total_config_failed'=0;;;0; 'total_download'=0;;;0; 'total_normal'=1;;;0; 'total_committing'=0;;;0; 'total_commit_failed'=0;;;0; 'total_standby'=0;;;0; 'total_version_mismatch'=0;;;0; 'total_name_conflicted'=0;;;0; 'total_invalid'=0;;;0; 'total_country_code_mismatch'=0;;;0;
... 12 --warning-total-fault=0 --critical-total-fault=0 --filter-name='Anonymized 001' OK: Access points total: 1, idle: 0, autofind: 0, fault: 0, config: 0, config failed: 0, download: 0, normal: 1, committing: 0, commit failed: 0, standby: 0, version mismatch: 0, name conflicted: 0, invalid: 0, country code mismatch: 0 - access point 'Anonymized 001' status: normal | 'total'=1;;;0; 'total_idle'=0;;;0; 'total_autofind'=0;;;0; 'total_type_not_match'=0;;;0; 'total_fault'=0;0:0;0:0;0; 'total_config'=0;;;0; 'total_config_failed'=0;;;0; 'total_download'=0;;;0; 'total_normal'=1;;;0; 'total_committing'=0;;;0; 'total_commit_failed'=0;;;0; 'total_standby'=0;;;0; 'total_version_mismatch'=0;;;0; 'total_name_conflicted'=0;;;0; 'total_invalid'=0;;;0; 'total_country_code_mismatch'=0;;;0;
... 13 --warning-total-config=0 --critical-total-config=0 --filter-name='Anonymized 000' OK: Access points total: 1, idle: 0, autofind: 0, fault: 0, config: 0, config failed: 0, download: 0, normal: 1, committing: 0, commit failed: 0, standby: 0, version mismatch: 0, name conflicted: 0, invalid: 0, country code mismatch: 0 - access point 'Anonymized 000' status: normal | 'total'=1;;;0; 'total_idle'=0;;;0; 'total_autofind'=0;;;0; 'total_type_not_match'=0;;;0; 'total_fault'=0;;;0; 'total_config'=0;0:0;0:0;0; 'total_config_failed'=0;;;0; 'total_download'=0;;;0; 'total_normal'=1;;;0; 'total_committing'=0;;;0; 'total_commit_failed'=0;;;0; 'total_standby'=0;;;0; 'total_version_mismatch'=0;;;0; 'total_name_conflicted'=0;;;0; 'total_invalid'=0;;;0; 'total_country_code_mismatch'=0;;;0;
... 14 --warning-total-config-failed=0 --critical-total-config-failed=0 --filter-name='Anonymized 000' OK: Access points total: 1, idle: 0, autofind: 0, fault: 0, config: 0, config failed: 0, download: 0, normal: 1, committing: 0, commit failed: 0, standby: 0, version mismatch: 0, name conflicted: 0, invalid: 0, country code mismatch: 0 - access point 'Anonymized 000' status: normal | 'total'=1;;;0; 'total_idle'=0;;;0; 'total_autofind'=0;;;0; 'total_type_not_match'=0;;;0; 'total_fault'=0;;;0; 'total_config'=0;;;0; 'total_config_failed'=0;0:0;0:0;0; 'total_download'=0;;;0; 'total_normal'=1;;;0; 'total_committing'=0;;;0; 'total_commit_failed'=0;;;0; 'total_standby'=0;;;0; 'total_version_mismatch'=0;;;0; 'total_name_conflicted'=0;;;0; 'total_invalid'=0;;;0; 'total_country_code_mismatch'=0;;;0;
... 15 --warning-total-download=0 --critical-total-download=0 --filter-name='Anonymized 000' OK: Access points total: 1, idle: 0, autofind: 0, fault: 0, config: 0, config failed: 0, download: 0, normal: 1, committing: 0, commit failed: 0, standby: 0, version mismatch: 0, name conflicted: 0, invalid: 0, country code mismatch: 0 - access point 'Anonymized 000' status: normal | 'total'=1;;;0; 'total_idle'=0;;;0; 'total_autofind'=0;;;0; 'total_type_not_match'=0;;;0; 'total_fault'=0;;;0; 'total_config'=0;;;0; 'total_config_failed'=0;;;0; 'total_download'=0;0:0;0:0;0; 'total_normal'=1;;;0; 'total_committing'=0;;;0; 'total_commit_failed'=0;;;0; 'total_standby'=0;;;0; 'total_version_mismatch'=0;;;0; 'total_name_conflicted'=0;;;0; 'total_invalid'=0;;;0; 'total_country_code_mismatch'=0;;;0;
... 16 --warning-total-normal=0 --critical-total-normal=0 --filter-name='Anonymized 000' CRITICAL: Access points normal: 1 | 'total'=1;;;0; 'total_idle'=0;;;0; 'total_autofind'=0;;;0; 'total_type_not_match'=0;;;0; 'total_fault'=0;;;0; 'total_config'=0;;;0; 'total_config_failed'=0;;;0; 'total_download'=0;;;0; 'total_normal'=1;0:0;0:0;0; 'total_committing'=0;;;0; 'total_commit_failed'=0;;;0; 'total_standby'=0;;;0; 'total_version_mismatch'=0;;;0; 'total_name_conflicted'=0;;;0; 'total_invalid'=0;;;0; 'total_country_code_mismatch'=0;;;0;
... 17 --warning-total-committing=0 --critical-total-committing=0 --filter-name='Anonymized 000' OK: Access points total: 1, idle: 0, autofind: 0, fault: 0, config: 0, config failed: 0, download: 0, normal: 1, committing: 0, commit failed: 0, standby: 0, version mismatch: 0, name conflicted: 0, invalid: 0, country code mismatch: 0 - access point 'Anonymized 000' status: normal | 'total'=1;;;0; 'total_idle'=0;;;0; 'total_autofind'=0;;;0; 'total_type_not_match'=0;;;0; 'total_fault'=0;;;0; 'total_config'=0;;;0; 'total_config_failed'=0;;;0; 'total_download'=0;;;0; 'total_normal'=1;;;0; 'total_committing'=0;0:0;0:0;0; 'total_commit_failed'=0;;;0; 'total_standby'=0;;;0; 'total_version_mismatch'=0;;;0; 'total_name_conflicted'=0;;;0; 'total_invalid'=0;;;0; 'total_country_code_mismatch'=0;;;0;
... 18 --warning-total-commit-failed=0 --critical-total-commit-failed=0 --filter-name='Anonymized 000' OK: Access points total: 1, idle: 0, autofind: 0, fault: 0, config: 0, config failed: 0, download: 0, normal: 1, committing: 0, commit failed: 0, standby: 0, version mismatch: 0, name conflicted: 0, invalid: 0, country code mismatch: 0 - access point 'Anonymized 000' status: normal | 'total'=1;;;0; 'total_idle'=0;;;0; 'total_autofind'=0;;;0; 'total_type_not_match'=0;;;0; 'total_fault'=0;;;0; 'total_config'=0;;;0; 'total_config_failed'=0;;;0; 'total_download'=0;;;0; 'total_normal'=1;;;0; 'total_committing'=0;;;0; 'total_commit_failed'=0;0:0;0:0;0; 'total_standby'=0;;;0; 'total_version_mismatch'=0;;;0; 'total_name_conflicted'=0;;;0; 'total_invalid'=0;;;0; 'total_country_code_mismatch'=0;;;0;
... 19 --warning-total-version-mismatch=0 --critical-total-version-mismatch=0 --filter-name='Anonymized 000' OK: Access points total: 1, idle: 0, autofind: 0, fault: 0, config: 0, config failed: 0, download: 0, normal: 1, committing: 0, commit failed: 0, standby: 0, version mismatch: 0, name conflicted: 0, invalid: 0, country code mismatch: 0 - access point 'Anonymized 000' status: normal | 'total'=1;;;0; 'total_idle'=0;;;0; 'total_autofind'=0;;;0; 'total_type_not_match'=0;;;0; 'total_fault'=0;;;0; 'total_config'=0;;;0; 'total_config_failed'=0;;;0; 'total_download'=0;;;0; 'total_normal'=1;;;0; 'total_committing'=0;;;0; 'total_commit_failed'=0;;;0; 'total_standby'=0;;;0; 'total_version_mismatch'=0;0:0;0:0;0; 'total_name_conflicted'=0;;;0; 'total_invalid'=0;;;0; 'total_country_code_mismatch'=0;;;0;
... 20 --warning-total-name-conflicted=0 --critical-total-name-conflicted=0 --filter-name='Anonymized 000' OK: Access points total: 1, idle: 0, autofind: 0, fault: 0, config: 0, config failed: 0, download: 0, normal: 1, committing: 0, commit failed: 0, standby: 0, version mismatch: 0, name conflicted: 0, invalid: 0, country code mismatch: 0 - access point 'Anonymized 000' status: normal | 'total'=1;;;0; 'total_idle'=0;;;0; 'total_autofind'=0;;;0; 'total_type_not_match'=0;;;0; 'total_fault'=0;;;0; 'total_config'=0;;;0; 'total_config_failed'=0;;;0; 'total_download'=0;;;0; 'total_normal'=1;;;0; 'total_committing'=0;;;0; 'total_commit_failed'=0;;;0; 'total_standby'=0;;;0; 'total_version_mismatch'=0;;;0; 'total_name_conflicted'=0;0:0;0:0;0; 'total_invalid'=0;;;0; 'total_country_code_mismatch'=0;;;0;
... 21 --warning-total-invalid=0 --critical-total-invalid=0 --filter-name='Anonymized 000' OK: Access points total: 1, idle: 0, autofind: 0, fault: 0, config: 0, config failed: 0, download: 0, normal: 1, committing: 0, commit failed: 0, standby: 0, version mismatch: 0, name conflicted: 0, invalid: 0, country code mismatch: 0 - access point 'Anonymized 000' status: normal | 'total'=1;;;0; 'total_idle'=0;;;0; 'total_autofind'=0;;;0; 'total_type_not_match'=0;;;0; 'total_fault'=0;;;0; 'total_config'=0;;;0; 'total_config_failed'=0;;;0; 'total_download'=0;;;0; 'total_normal'=1;;;0; 'total_committing'=0;;;0; 'total_commit_failed'=0;;;0; 'total_standby'=0;;;0; 'total_version_mismatch'=0;;;0; 'total_name_conflicted'=0;;;0; 'total_invalid'=0;0:0;0:0;0; 'total_country_code_mismatch'=0;;;0;
... 22 --warning-total-country-code-mismatch=0 --critical-total-country-code-mismatch=0 --filter-name='Anonymized 000' OK: Access points total: 1, idle: 0, autofind: 0, fault: 0, config: 0, config failed: 0, download: 0, normal: 1, committing: 0, commit failed: 0, standby: 0, version mismatch: 0, name conflicted: 0, invalid: 0, country code mismatch: 0 - access point 'Anonymized 000' status: normal | 'total'=1;;;0; 'total_idle'=0;;;0; 'total_autofind'=0;;;0; 'total_type_not_match'=0;;;0; 'total_fault'=0;;;0; 'total_config'=0;;;0; 'total_config_failed'=0;;;0; 'total_download'=0;;;0; 'total_normal'=1;;;0; 'total_committing'=0;;;0; 'total_commit_failed'=0;;;0; 'total_standby'=0;;;0; 'total_version_mismatch'=0;;;0; 'total_name_conflicted'=0;;;0; 'total_invalid'=0;;;0; 'total_country_code_mismatch'=0;0:0;0:0;0;
... 23 --warning-total-standby=0 --critical-total-standby=0 --filter-name='Anonymized 010' OK: Access points total: 1, idle: 0, autofind: 0, fault: 0, config: 0, config failed: 0, download: 0, normal: 1, committing: 0, commit failed: 0, standby: 0, version mismatch: 0, name conflicted: 0, invalid: 0, country code mismatch: 0 - access point 'Anonymized 010' status: normal | 'total'=1;;;0; 'total_idle'=0;;;0; 'total_autofind'=0;;;0; 'total_type_not_match'=0;;;0; 'total_fault'=0;;;0; 'total_config'=0;;;0; 'total_config_failed'=0;;;0; 'total_download'=0;;;0; 'total_normal'=1;;;0; 'total_committing'=0;;;0; 'total_commit_failed'=0;;;0; 'total_standby'=0;0:0;0:0;0; 'total_version_mismatch'=0;;;0; 'total_name_conflicted'=0;;;0; 'total_invalid'=0;;;0; 'total_country_code_mismatch'=0;;;0;

View File

@ -0,0 +1,31 @@
*** Settings ***
Documentation Check CPU usages.
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s
Test Setup Ctn Generic Suite Setup
*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=network::huawei::wlc::snmp::plugin
*** Test Cases ***
cpu ${tc}
[Tags] network snmp
${command} Catenate
... ${CMD}
... --mode=cpu
... --hostname=${HOSTNAME}
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=network/huawei/wlc/snmp/slim_huawei_wlc
... --snmp-timeout=1
... ${extra_options}
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
Examples: tc extra_options expected_result --
... 1 --verbose OK: All CPU usages are ok | 'cpu_1'=14.00%;;;0;100 'cpu_2'=16.00%;;;0;100 'cpu_3'=14.00%;;;0;100 'cpu_4'=12.00%;;;0;100 'cpu_5'=13.00%;;;0;100 'cpu_6'=13.00%;;;0;100 'cpu_7'=21.00%;;;0;100 'cpu_8'=10.00%;;;0;100${\n}CPU '1' Usage : 14.00 %${\n}CPU '2' Usage : 16.00 %${\n}CPU '3' Usage : 14.00 %${\n}CPU '4' Usage : 12.00 %${\n}CPU '5' Usage : 13.00 %${\n}CPU '6' Usage : 13.00 %${\n}CPU '7' Usage : 21.00 %${\n}CPU '8' Usage : 10.00 %
... 2 --warning-usage="-5:5" WARNING: CPU '1' Usage : 14.00 % - CPU '2' Usage : 16.00 % - CPU '3' Usage : 14.00 % - CPU '4' Usage : 12.00 % - CPU '5' Usage : 13.00 % - CPU '6' Usage : 13.00 % - CPU '7' Usage : 21.00 % - CPU '8' Usage : 10.00 % | 'cpu_1'=14.00%;-5:5;;0;100 'cpu_2'=16.00%;-5:5;;0;100 'cpu_3'=14.00%;-5:5;;0;100 'cpu_4'=12.00%;-5:5;;0;100 'cpu_5'=13.00%;-5:5;;0;100 'cpu_6'=13.00%;-5:5;;0;100 'cpu_7'=21.00%;-5:5;;0;100 'cpu_8'=10.00%;-5:5;;0;100
... 3 --critical-usage="-10:10" CRITICAL: CPU '1' Usage : 14.00 % - CPU '2' Usage : 16.00 % - CPU '3' Usage : 14.00 % - CPU '4' Usage : 12.00 % - CPU '5' Usage : 13.00 % - CPU '6' Usage : 13.00 % - CPU '7' Usage : 21.00 % | 'cpu_1'=14.00%;;-10:10;0;100 'cpu_2'=16.00%;;-10:10;0;100 'cpu_3'=14.00%;;-10:10;0;100 'cpu_4'=12.00%;;-10:10;0;100 'cpu_5'=13.00%;;-10:10;0;100 'cpu_6'=13.00%;;-10:10;0;100 'cpu_7'=21.00%;;-10:10;0;100 'cpu_8'=10.00%;;-10:10;0;100

View File

@ -0,0 +1,43 @@
*** Settings ***
Documentation Check Huawei equipments in SNMP.
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s
Test Setup Ctn Generic Suite Setup
*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=network::huawei::wlc::snmp::plugin
*** Test Cases ***
interfaces ${tc}
[Tags] network snmp
${command} Catenate
... ${CMD}
... --mode=interfaces
... --hostname=${HOSTNAME}
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=network/huawei/wlc/snmp/slim_huawei_wlc
... --snmp-timeout=1
... ${extra_options}
Run ${command}
Ctn Verify Command Output ${command} ${expected_result}
Examples: tc extra_options expected_result --
... 1 --verbose CRITICAL: Interface 'Anonymized 012' Status : down (admin: up) - Interface 'Anonymized 221' Status : down (admin: up) - Interface 'Anonymized 003' Status : down (admin: up) - Interface 'Anonymized 232' Status : down (admin: up) - Interface 'Anonymized 109' Status : down (admin: up) - Interface 'Anonymized 034' Status : down (admin: up) - Interface 'Anonymized 012' Status : down (admin: up) - Interface 'Anonymized 016' Status : down (admin: up) - Interface 'Anonymized 214' Status : down (admin: up) - Interface 'Anonymized 118' Status : down (admin: up) - Interface 'Anonymized 039' Status : down (admin: up) - Interface 'Anonymized 180' Status : down (admin: up) - Interface 'Anonymized 164' Status : down (admin: up) - Interface 'Anonymized 082' Status : down (admin: up) - Interface 'Anonymized 149' Status : down (admin: up) - Interface 'Anonymized 144' Status : down (admin: up) - Interface 'Anonymized 052' Status : down (admin: up) - Interface 'Anonymized 126' Status : down (admin: up)
... 2 --name --interface='Anonymized 012' CRITICAL: Interface 'Anonymized 012' Status : down (admin: up) - Interface 'Anonymized 012' Status : down (admin: up) - Interface 'Anonymized 012' Status : down (admin: up)
... 3 --add-status --name --interface='Anonymized 012' CRITICAL: Interface 'Anonymized 012' Status : down (admin: up) - Interface 'Anonymized 012' Status : down (admin: up) - Interface 'Anonymized 012' Status : down (admin: up)
... 4 --add-duplex-status --name --interface='Anonymized 012' CRITICAL: Interface 'Anonymized 012' Status : down (admin: up) (duplex: n/a) - Interface 'Anonymized 012' Status : down (admin: up) (duplex: n/a) - Interface 'Anonymized 012' Status : down (admin: up) (duplex: n/a)
... 5 --add-speed --name --interface='Anonymized 012' CRITICAL: Interface 'Anonymized 012' Status : down (admin: up) - Interface 'Anonymized 012' Status : down (admin: up) - Interface 'Anonymized 012' Status : down (admin: up) | 'Anonymized 012#interface.speed.bitspersecond'=10000000000b/s;;;0; 'Anonymized 012#interface.speed.bitspersecond'=10000000000b/s;;;0; 'Anonymized 012#interface.speed.bitspersecond'=10000000000b/s;;;0;
... 6 --add-traffic --name --interface='Anonymized 012' OK: All interfaces are ok | 'Anonymized 012#interface.traffic.in.bitspersecond'=0.00b/s;;;0;10000000000 'Anonymized 012#interface.traffic.out.bitspersecond'=0.00b/s;;;0;10000000000 'Anonymized 012#interface.traffic.in.bitspersecond'=0.00b/s;;;0;10000000000 'Anonymized 012#interface.traffic.out.bitspersecond'=0.00b/s;;;0;10000000000 'Anonymized 012#interface.traffic.in.bitspersecond'=0.00b/s;;;0;10000000000 'Anonymized 012#interface.traffic.out.bitspersecond'=0.00b/s;;;0;10000000000
... 7 --add-volume --name --interface='Anonymized 012' CRITICAL: Interface 'Anonymized 012' Status : down (admin: up) - Interface 'Anonymized 012' Status : down (admin: up) - Interface 'Anonymized 012' Status : down (admin: up) | 'Anonymized 012#interface.volume.in.bytes'=0B;;;0; 'Anonymized 012#interface.volume.out.bytes'=0B;;;0; 'Anonymized 012#interface.volume.in.bytes'=0B;;;0; 'Anonymized 012#interface.volume.out.bytes'=0B;;;0; 'Anonymized 012#interface.volume.in.bytes'=0B;;;0; 'Anonymized 012#interface.volume.out.bytes'=0B;;;0;
... 8 --add-optical --name --interface='Anonymized 012' CRITICAL: Interface 'Anonymized 012' Status : down (admin: up) - Interface 'Anonymized 012' Status : down (admin: up) - Interface 'Anonymized 012' Status : down (admin: up) | 'Anonymized 012#interface.bias.current.milliampere'=-255mA;;;; 'Anonymized 012#interface.bias.current.milliampere'=-255mA;;;; 'Anonymized 012#interface.bias.current.milliampere'=-255mA;;;;
... 9 --add-traffic --name --interface='Anonymized 123' --speed=1 OK: Interface 'Anonymized 123' Traffic In : 0.00b/s (0.00%), Traffic Out : 0.00b/s (0.00%) | 'Anonymized 123#interface.traffic.in.bitspersecond'=0.00b/s;;;0;1000000 'Anonymized 123#interface.traffic.out.bitspersecond'=0.00b/s;;;0;1000000
... 10 --add-traffic --name --interface='Anonymized 123' --warning-in-traffic=1:1 --speed=1 WARNING: Interface 'Anonymized 123' Traffic In : 0.00b/s (0.00%) | 'Anonymized 123#interface.traffic.in.bitspersecond'=0.00b/s;10000:10000;;0;1000000 'Anonymized 123#interface.traffic.out.bitspersecond'=0.00b/s;;;0;1000000
... 11 --add-traffic --name --interface='Anonymized 123' --critical-in-traffic=1:1 --speed-in=1 CRITICAL: Interface 'Anonymized 123' Traffic In : 0.00b/s (0.00%) | 'Anonymized 123#interface.traffic.in.bitspersecond'=0.00b/s;;10000:10000;0;1000000 'Anonymized 123#interface.traffic.out.bitspersecond'=0.00b/s;;;0;10000000000
... 12 --add-traffic --name --interface='Anonymized 123' --warning-out-traffic=1:1 --speed-out=1 WARNING: Interface 'Anonymized 123' Traffic Out : 0.00b/s (0.00%) | 'Anonymized 123#interface.traffic.in.bitspersecond'=0.00b/s;;;0;10000000000 'Anonymized 123#interface.traffic.out.bitspersecond'=0.00b/s;10000:10000;;0;1000000
... 13 --add-traffic --name --interface='Anonymized 123' --critical-out-traffic=1:1 --force-counters32 CRITICAL: Interface 'Anonymized 123' Traffic Out : 0.00b/s (0.00%) | 'Anonymized 123#interface.traffic.in.bitspersecond'=0.00b/s;;;0;4294967295 'Anonymized 123#interface.traffic.out.bitspersecond'=0.00b/s;;42949672:42949672;0;4294967295
... 14 --display-transform-src='Anonymized' --display-transform-dst='Interface' --name --interface='Anonymized 123' OK: Interface 'Interface 123' Status : up (admin: up)

View File

@ -0,0 +1,32 @@
*** Settings ***
Documentation List wireless name.
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s
Test Setup Ctn Generic Suite Setup
*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=network::huawei::wlc::snmp::plugin
*** Test Cases ***
list-aps ${tc}
[Tags] network snmp
${command} Catenate
... ${CMD}
... --mode=list-aps
... --hostname=${HOSTNAME}
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=network/huawei/wlc/snmp/slim_huawei_wlc
... --snmp-timeout=1
... ${extra_options}
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
Examples: tc extra_options expected_result --
... 1 --verbose --filter-name='Anonymized 058' List aps [oid_path: 100.19.171.37.61.112] [name: Anonymized 058] [serial: Anonymized 021] [address: 192.168.42.33] [hardware: Anonymized 104] [software: Anonymized 014] [run_time: 1w 4d 3h 1m 45s] [ap_group: Anonymized 214] [oid_path: 128.105.51.109.163.32] [name: Anonymized 058] [serial: Anonymized 025] [address: 192.168.42.225] [hardware: Anonymized 167] [software: Anonymized 034] [run_time: 11M 1w 1d 6h 12m 17s] [ap_group: Anonymized 040] [oid_path: 52.30.107.186.232.64] [name: Anonymized 058] [serial: Anonymized 073] [address: 192.168.42.66] [hardware: Anonymized 033] [software: Anonymized 168] [run_time: 11M 1w 1d 6h 15m 30s] [ap_group: Anonymized 124]
... 2 --filter-name='Anonymized 058' List aps [oid_path: 100.19.171.37.61.112] [name: Anonymized 058] [serial: Anonymized 021] [address: 192.168.42.33] [hardware: Anonymized 104] [software: Anonymized 014] [run_time: 1w 4d 3h 1m 45s] [ap_group: Anonymized 214] [oid_path: 128.105.51.109.163.32] [name: Anonymized 058] [serial: Anonymized 025] [address: 192.168.42.225] [hardware: Anonymized 167] [software: Anonymized 034] [run_time: 11M 1w 1d 6h 12m 17s] [ap_group: Anonymized 040] [oid_path: 52.30.107.186.232.64] [name: Anonymized 058] [serial: Anonymized 073] [address: 192.168.42.66] [hardware: Anonymized 033] [software: Anonymized 168] [run_time: 11M 1w 1d 6h 15m 30s] [ap_group: Anonymized 124]
... 3 --filter-address='192.168.42.230' List aps [oid_path: 100.19.171.37.62.176] [name: Anonymized 140] [serial: Anonymized 036] [address: 192.168.42.230] [hardware: Anonymized 194] [software: Anonymized 196] [run_time: 1w 1d 2h 39m 24s] [ap_group: Anonymized 244] [oid_path: 244.29.107.141.73.192] [name: Anonymized 119] [serial: Anonymized 056] [address: 192.168.42.230] [hardware: Anonymized 070] [software: Anonymized 171] [run_time: 11M 1w 1d 6h 13m 59s] [ap_group: Anonymized 002] [oid_path: 244.29.107.141.80.64] [name: Anonymized 108] [serial: Anonymized 089] [address: 192.168.42.230] [hardware: Anonymized 062] [software: Anonymized 091] [run_time: 6d 6h 56m 42s] [ap_group: Anonymized 253]
... 4 --filter-group --filter-name='Anonymized 058' List aps [oid_path: 100.19.171.37.61.112] [name: Anonymized 058] [serial: Anonymized 021] [address: 192.168.42.33] [hardware: Anonymized 104] [software: Anonymized 014] [run_time: 1w 4d 3h 1m 45s] [ap_group: Anonymized 214] [oid_path: 128.105.51.109.163.32] [name: Anonymized 058] [serial: Anonymized 025] [address: 192.168.42.225] [hardware: Anonymized 167] [software: Anonymized 034] [run_time: 11M 1w 1d 6h 12m 17s] [ap_group: Anonymized 040] [oid_path: 52.30.107.186.232.64] [name: Anonymized 058] [serial: Anonymized 073] [address: 192.168.42.66] [hardware: Anonymized 033] [software: Anonymized 168] [run_time: 11M 1w 1d 6h 15m 30s] [ap_group: Anonymized 124]

View File

@ -0,0 +1,35 @@
*** Settings ***
Documentation Check Huawei equipments in SNMP.
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s
Test Setup Ctn Generic Suite Setup
*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=network::huawei::wlc::snmp::plugin
*** Test Cases ***
list-interfaces ${tc}
[Tags] network snmp
${command} Catenate
... ${CMD}
... --mode=list-interfaces
... --hostname=${HOSTNAME}
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=network/huawei/wlc/snmp/slim_huawei_wlc
... --snmp-timeout=1
... ${extra_options} | grep -v 'skipping interface' | wc -l
Ctn Verify Command Output ${command} ${expected_result}
Examples: tc extra_options expected_result --
... 1 ${EMPTY} 185
... 2 --interface=12 2
... 3 --name --interface='Anonymized 25' 8
... 4 --name --interface='Anonymized 23' 10
... 5 --name --interface='Anonymized 25' --skip-speed0 6
... 6 --filter-status='down' 154
... 7 --filter-status='down' --skip-speed0 153

View File

@ -0,0 +1,32 @@
*** Settings ***
Documentation Check Huawei equipments in SNMP.
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s
Test Setup Ctn Generic Suite Setup
*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=network::huawei::wlc::snmp::plugin
*** Test Cases ***
list-radios ${tc}
[Tags] network snmp
${command} Catenate
... ${CMD}
... --mode=list-radios
... --hostname=${HOSTNAME}
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=network/huawei/wlc/snmp/slim_huawei_wlc
... --snmp-timeout=1
... ${extra_options} | wc -l
Ctn Verify Command Output ${command} ${expected_result}
Examples: tc extra_options expected_result --
... 1 --filter-name='Anonymized 0' 100
... 2 --filter-name='Anonymized 1' 100
... 3 --filter-name='Anonymized 2' 56
... 4 ${EMPTY} 254

View File

@ -0,0 +1,32 @@
*** Settings ***
Documentation Check memory usage.
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s
Test Setup Ctn Generic Suite Setup
*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=network::huawei::wlc::snmp::plugin
*** Test Cases ***
memory ${tc}
[Tags] network snmp
${command} Catenate
... ${CMD}
... --mode=memory
... --hostname=${HOSTNAME}
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=network/huawei/wlc/snmp/slim_huawei_wlc
... --snmp-timeout=1
... ${extra_options}
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
Examples: tc extra_options expected_result --
... 1 ${EMPTY} OK: All memory usages are ok | 'used_1'=271388616B;;;0;1765801984 'used_2'=271382292B;;;0;1765801984 'used_3'=73684888B;;;0;1765801984 'used_4'=73684936B;;;0;1765801984 'used_5'=73708228B;;;0;1765801984 'used_6'=73690100B;;;0;1765801984 'used_7'=385327944B;;;0;1832910848 'used_8'=397826128B;;;0;1832910848
... 2 --warning-usage=10 WARNING: Memory '1' Total: 1.64 GB Used: 258.82 MB (15.37%) Free: 1.39 GB (84.63%) - Memory '2' Total: 1.64 GB Used: 258.81 MB (15.37%) Free: 1.39 GB (84.63%) - Memory '7' Total: 1.71 GB Used: 367.48 MB (21.02%) Free: 1.35 GB (78.98%) - Memory '8' Total: 1.71 GB Used: 379.40 MB (21.70%) Free: 1.34 GB (78.30%) | 'used_1'=271388616B;0:176580198;;0;1765801984 'used_2'=271382292B;0:176580198;;0;1765801984 'used_3'=73684888B;0:176580198;;0;1765801984 'used_4'=73684936B;0:176580198;;0;1765801984 'used_5'=73708228B;0:176580198;;0;1765801984 'used_6'=73690100B;0:176580198;;0;1765801984 'used_7'=385327944B;0:183291084;;0;1832910848 'used_8'=397826128B;0:183291084;;0;1832910848
... 3 --critical-usage=10 CRITICAL: Memory '1' Total: 1.64 GB Used: 258.82 MB (15.37%) Free: 1.39 GB (84.63%) - Memory '2' Total: 1.64 GB Used: 258.81 MB (15.37%) Free: 1.39 GB (84.63%) - Memory '7' Total: 1.71 GB Used: 367.48 MB (21.02%) Free: 1.35 GB (78.98%) - Memory '8' Total: 1.71 GB Used: 379.40 MB (21.70%) Free: 1.34 GB (78.30%) | 'used_1'=271388616B;;0:176580198;0;1765801984 'used_2'=271382292B;;0:176580198;0;1765801984 'used_3'=73684888B;;0:176580198;0;1765801984 'used_4'=73684936B;;0:176580198;0;1765801984 'used_5'=73708228B;;0:176580198;0;1765801984 'used_6'=73690100B;;0:176580198;0;1765801984 'used_7'=385327944B;;0:183291084;0;1832910848 'used_8'=397826128B;;0:183291084;0;1832910848

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,37 @@
*** Settings ***
Documentation Check system uptime.
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s
Test Setup Ctn Generic Suite Setup
*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=network::huawei::wlc::snmp::plugin
*** Test Cases ***
uptime ${tc}
[Tags] network snmp
${command} Catenate
... ${CMD}
... --mode=uptime
... --hostname=${HOSTNAME}
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=network/huawei/wlc/snmp/slim_huawei_wlc
... --snmp-timeout=1
... ${extra_options}
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
Examples: tc extra_options expected_result --
... 1 --verbose OK: System uptime is: 288d 20h 33m 6s | 'uptime'=24957186.00s;;;0;
... 2 --warning-uptime OK: System uptime is: 288d 20h 33m 6s | 'uptime'=24957186.00s;;;0;
... 3 --critical-uptime OK: System uptime is: 288d 20h 33m 6s | 'uptime'=24957186.00s;;;0;
... 4 --add-sysdesc OK: System uptime is: 288d 20h 33m 6s, Anonymized 023 | 'uptime'=24957186.00s;;;0;
... 5 --force-oid=.1.3.6.1.2.1.1.3.0 OK: System uptime is: 288d 20h 33m 6s | 'uptime'=24957186.00s;;;0;
... 6 --check-overload OK: System uptime is: 288d 20h 33m 6s | 'uptime'=24957186.00s;;;0;
... 7 --reboot-window OK: System uptime is: 288d 20h 33m 6s | 'uptime'=24957186.00s;;;0;
... 8 --unit='s' OK: System uptime is: 288d 20h 33m 6s | 'uptime'=24957186.00s;;;0;
... 9 --unit='m' OK: System uptime is: 288d 20h 33m 6s | 'uptime'=415953.10m;;;0;

View File

@ -0,0 +1,37 @@
*** Settings ***
Documentation Check global WLAN access point count and user associated and authenticated.
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s
Test Setup Ctn Generic Suite Setup
*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=network::huawei::wlc::snmp::plugin
*** Test Cases ***
wlan-global ${tc}
[Tags] network snmp
${command} Catenate
... ${CMD}
... --mode=wlan-global
... --hostname=${HOSTNAME}
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=network/huawei/wlc/snmp/slim_huawei_wlc
... --snmp-timeout=1
... ${extra_options}
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
Examples: tc extra_options expected_result --
... 1 --verbose OK: Access Points normal state 509 on 525 (96.95%), Access Points user authentications 92.06% (1113 on 1209) | 'total'=525;;;0; 'normal'=509;;;0; 'fault'=16;;;0; 'normal-prct'=96.95%;;;0;100 'fault-prct'=3.05%;;;0;100 'current-user'=1209;;;0; 'current-auth-user'=1113;;;0; 'current-auth-user-prct'=92.06%;;;0;100
... 2 --warning-total --critical-total OK: Access Points normal state 509 on 525 (96.95%), Access Points user authentications 92.06% (1113 on 1209) | 'total'=525;;;0; 'normal'=509;;;0; 'fault'=16;;;0; 'normal-prct'=96.95%;;;0;100 'fault-prct'=3.05%;;;0;100 'current-user'=1209;;;0; 'current-auth-user'=1113;;;0; 'current-auth-user-prct'=92.06%;;;0;100
... 3 --warning-normal --critical-normal OK: Access Points normal state 509 on 525 (96.95%), Access Points user authentications 92.06% (1113 on 1209) | 'total'=525;;;0; 'normal'=509;;;0; 'fault'=16;;;0; 'normal-prct'=96.95%;;;0;100 'fault-prct'=3.05%;;;0;100 'current-user'=1209;;;0; 'current-auth-user'=1113;;;0; 'current-auth-user-prct'=92.06%;;;0;100
... 4 --warning-normal-prct --critical-normal-prct OK: Access Points normal state 509 on 525 (96.95%), Access Points user authentications 92.06% (1113 on 1209) | 'total'=525;;;0; 'normal'=509;;;0; 'fault'=16;;;0; 'normal-prct'=96.95%;;;0;100 'fault-prct'=3.05%;;;0;100 'current-user'=1209;;;0; 'current-auth-user'=1113;;;0; 'current-auth-user-prct'=92.06%;;;0;100
... 5 --warning-fault --critical-fault OK: Access Points normal state 509 on 525 (96.95%), Access Points user authentications 92.06% (1113 on 1209) | 'total'=525;;;0; 'normal'=509;;;0; 'fault'=16;;;0; 'normal-prct'=96.95%;;;0;100 'fault-prct'=3.05%;;;0;100 'current-user'=1209;;;0; 'current-auth-user'=1113;;;0; 'current-auth-user-prct'=92.06%;;;0;100
... 6 --warning-fault-prct --critical-fault-prct OK: Access Points normal state 509 on 525 (96.95%), Access Points user authentications 92.06% (1113 on 1209) | 'total'=525;;;0; 'normal'=509;;;0; 'fault'=16;;;0; 'normal-prct'=96.95%;;;0;100 'fault-prct'=3.05%;;;0;100 'current-user'=1209;;;0; 'current-auth-user'=1113;;;0; 'current-auth-user-prct'=92.06%;;;0;100
... 7 --warning-current-user --critical-current-user OK: Access Points normal state 509 on 525 (96.95%), Access Points user authentications 92.06% (1113 on 1209) | 'total'=525;;;0; 'normal'=509;;;0; 'fault'=16;;;0; 'normal-prct'=96.95%;;;0;100 'fault-prct'=3.05%;;;0;100 'current-user'=1209;;;0; 'current-auth-user'=1113;;;0; 'current-auth-user-prct'=92.06%;;;0;100
... 8 --warning-current-auth-user --critical-current-auth-user OK: Access Points normal state 509 on 525 (96.95%), Access Points user authentications 92.06% (1113 on 1209) | 'total'=525;;;0; 'normal'=509;;;0; 'fault'=16;;;0; 'normal-prct'=96.95%;;;0;100 'fault-prct'=3.05%;;;0;100 'current-user'=1209;;;0; 'current-auth-user'=1113;;;0; 'current-auth-user-prct'=92.06%;;;0;100
... 9 --warning-current-auth-user-prct --critical-current-auth-user-prct OK: Access Points normal state 509 on 525 (96.95%), Access Points user authentications 92.06% (1113 on 1209) | 'total'=525;;;0; 'normal'=509;;;0; 'fault'=16;;;0; 'normal-prct'=96.95%;;;0;100 'fault-prct'=3.05%;;;0;100 'current-user'=1209;;;0; 'current-auth-user'=1113;;;0; 'current-auth-user-prct'=92.06%;;;0;100

View File

@ -1,61 +1,28 @@
2c
3COM
3CX
--3cx-version
7210SAS
7750SR
ACS
--add-cpu
--add-disk-io
--add-fc-fe-errors
--add-qos-limit
--add-sysdesc
ADSL
Alcatel
allCapacity
Ansible
--api-filter-orgs
api.meraki.com
--api-password
--api-path
--api-token
--api-username
--api-version
AppearTV
ASAM
Avigilon
Avocent
aws
AWSCLI
--aws-role-arn
Backbox
base64
blocked-by-uf
--cacert-file
cardtemperature
centreon
Centreon
centreonvault
--cert-pkcs12
--cert-pwd
CloudWatch
connections-dhcp
connections-dns
cpu-utilization
cpu-utilization-1m
cpu-utilization-5m
cpu-utilization-5s
--critical-authserver-clients-timeout
--critical-authserver-packets-access-accepts
--critical-authserver-packets-access-requests
--critical-authserver-roundtrip-time
--critical-authservers-total
--critical-backend-congestions
--critical-backend-outstanding-io
--critical-bytesallocatedpercentage
--critical-cpu-utilization
--critical-na
--critical-total-cpu-utilization
Datacore
datasource
DC4
@ -63,47 +30,30 @@ dcdiag
deduplication
deltaps
df
--dfsr
dfsrevent
--display-transform-dst
--display-transform-src
dns-resolve-time
--dyn-mode
-EncodedCommand
env
ESX
eth
--exclude-fs
--failback-file
fanspeed
FCCapacity
--filter-fs
--filter-imei
--filter-ppid
--filter-vdom
--filter-vm
--force-64bits-counters
--force-counters32
--force-counters64
--force-oid
Fortigate
Fortinet
frsevent
--get-param
HashiCorp
hashicorpvault
HPE
Huawei
ifAlias
ifDesc
ifName
--ignore-orgs-api-disabled
IMEI
in-bcast
in-crc
in-fcserror
in-mcast
-InputFormat
interface-dsl-name
InterrupibleSleep
in-ucast
IpAddr
@ -113,7 +63,6 @@ ISAM
Iwsva
jmeter
JMeter
--jobq
JOBQ
jobqueue
jobqueues
@ -123,60 +72,30 @@ keepass
Keysight
Kubernetes
ldap
--legacy-api-beta
license-instances-usage-prct
Loggly
--lookback
--lookup-perfdatas-nagios
machineaccount
--map-speed-dsl
MBean
McAfee
memAvailReal
memBuffer
--memexpiration
memTotalReal
Meraki
MIB
module-cellradio-csq
module-cellradio-rscp
module-cellradio-rsrp
module-cellradio-rsrq
module-cellradio-snr
modules-cellradio-detected
Mosquitto
--mqtt
MQTT
--mqtt-allow-insecure
--mqtt-ca-certificate
--mqtt-password
--mqtt-port
--mqtt-ssl
--mqtt-ssl-certificate
--mqtt-ssl-key
--mqtt-timeout
--mqtt-username
multiple
nagios
Nagios
NagVis
--nagvis-perfdata
Netscaler
net-snmp
NLCapacity
--noeventlog
--noidle
-NoLogo
--nomachineaccount
--ntlmv2
NTLMv2
NTP
NVOS
--oid
OID
--oid-display
--oid-extra-display
--oid-filter
OIDs
okta
oneaccess-sys-mib
out-bcast
@ -184,7 +103,6 @@ out-fc-wait
out-mcast
out-ucast
overprovisioning
--patch-redhat
perfdata
physicaldrive
PKCS1
@ -195,30 +113,20 @@ prct
Primera
Procurve
proto
--proxyurl
psu
QoS
queue-messages-inflighted
--redis-attribute
--redis-db
--redis-server
RestAPI
RFC1628
RRDCached
Sansymphony
SAS
scenarii
--scope-datacenter
sfp.temperature
--skip-ssl-check
SkyHigh
SNMP
space-usage-prct
--sql-errors-exit
SSDCapacity
SSH
statefile
--statefile-concat-cwd
SureBackup
systemd
SysVol
@ -228,12 +136,6 @@ Teldat
timeframe
TiMOS
tmnxSasAlarmInputDescription
topic-messages-inflighted
total-offline-prct
total-online-prct
total-oper-down
total-oper-up
tower-cli
TrendMicro
tsdb-version
UCD
@ -241,10 +143,8 @@ UDP
UninterrupibleSleep
uniq
uptime
--urlpath
usage-prct
userpass
--use-ucd
v1
v2
VDSL2
@ -255,16 +155,7 @@ VMware
VPN
vSAN
vSphere
--warning-authserver-clients-timeout
--warning-authserver-packets-access-accepts
--warning-authserver-packets-access-requests
--warning-authserver-roundtrip-time
--warning-authservers-total
--warning-backend-congestions
--warning-backend-outstanding-io
--warning-bytesallocatedpercentage
--warning-cpu-utilization
--warning-na
--warning-total-cpu-utilization
WLAN
WLC
WSMAN
XPath