diff --git a/src/centreon/common/huawei/standard/snmp/functions.pm b/src/centreon/common/huawei/standard/snmp/functions.pm new file mode 100644 index 0000000000..042601026d --- /dev/null +++ b/src/centreon/common/huawei/standard/snmp/functions.pm @@ -0,0 +1,57 @@ +# +# Copyright 2026-Present 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 centreon::common::huawei::standard::snmp::functions; + +use strict; +use warnings; + +use Exporter 'import'; + +our @EXPORT_OK = qw/get_serial_string/; + +sub get_serial_string($) { + # Get the raw OCTET STRING value for the serial number. + # It may contain both ASCII and binary data. + my ($raw_bytes) = @_; + + # Extract the first 4 bytes and interpret them as ASCII characters. + # Example: '52 43 4D 47' => 'RCMG' + my $ascii_part = substr($raw_bytes, 0, 4); + + # Extract the last 4 bytes, convert them to an uppercase hex string. + # Example: '1A 98 0E 53' => '1A980E53' + my $hex_part = uc(unpack("H*", substr($raw_bytes, 4, 4))); + + # Format the final output string, combining name, serial number, and state. + # The serial number is shown as: [first 4 bytes as ASCII][last 4 bytes as HEX]. + # Example: RCMG1A980E53 + return "$ascii_part$hex_part"; +} + +1; + +__END__ + +=head1 DESCRIPTION + +Huawei SNMP common functions. + +=cut diff --git a/src/centreon/plugins/misc.pm b/src/centreon/plugins/misc.pm index d69532c852..ab675c7765 100644 --- a/src/centreon/plugins/misc.pm +++ b/src/centreon/plugins/misc.pm @@ -934,13 +934,17 @@ sub sort_ips($$) { } # function to assess if a string has to be excluded given an include regexp and an exclude regexp -sub is_excluded($;$;$) { - my ($string, $include_regexp, $exclude_regexp) = @_; +sub is_excluded($;$;$;%) { + my ($string, $include_regexp, $exclude_regexp, %options) = @_; return 1 unless defined $string; if (defined $exclude_regexp) { $exclude_regexp = [ $exclude_regexp ] unless ref $exclude_regexp eq 'ARRAY'; - return 1 if grep { defined && $_ ne '' && $string =~ /$_/ } @$exclude_regexp; + if (grep { defined && $_ ne '' && $string =~ /$_/ } @$exclude_regexp) { + $options{output}->output_add(long_msg => "skipping '$string': excluded by a filter.", debug => 1) + if %options && $options{output}; + return 1 + } } return 0 unless defined $include_regexp; $include_regexp = [ $include_regexp ] unless ref $include_regexp eq 'ARRAY'; @@ -948,6 +952,9 @@ sub is_excluded($;$;$) { return 0 if grep { (not defined) || $_ eq '' || $string =~ /$_/ } @$include_regexp; + $options{output}->output_add(long_msg => "skipping '$string': not included by any filter.", debug => 1) + if %options && $options{output}; + return 1; } @@ -1592,7 +1599,7 @@ Returns a sorted array. =head2 is_excluded - my $excluded = is_excluded($string, $include_regexp, $exclude_regexp); + my $excluded = is_excluded($string, $include_regexp, $exclude_regexp, %options); Determines whether a string should be excluded based on include and exclude regular expressions. @@ -1604,6 +1611,8 @@ Determines whether a string should be excluded based on include and exclude regu =item * C<$exclude_regexp> - A regular expression to exclude the string. If defined and matches the string, the function returns 1 (excluded). +=item * C<%options> - An optional hash that allows defining the output module in order to log when the string is excluded. + =back Returns 1 if the string is excluded, 0 if it is included. diff --git a/src/network/huawei/standard/snmp/mode/gponontethernetport.pm b/src/network/huawei/standard/snmp/mode/gponontethernetport.pm new file mode 100644 index 0000000000..c472c0e500 --- /dev/null +++ b/src/network/huawei/standard/snmp/mode/gponontethernetport.pm @@ -0,0 +1,228 @@ +# +# Copyright 2026-Present 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::standard::snmp::mode::gponontethernetport; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; +use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold_ng); +use centreon::plugins::constants qw/:counters :values/; +use centreon::plugins::misc qw/is_excluded/; +use centreon::common::huawei::standard::snmp::functions qw/get_serial_string/; + +sub prefix_module_output { + my ($self, %options) = @_; + + return sprintf("ONT '%s' - %s(%s) ethernet port %d (%s) ", + $options{instance_value}->{display}, + $options{instance_value}->{serial}, + $options{instance_value}->{serial_hex}, + $options{instance_value}->{port_id}, + $options{instance_value}->{speed} + ); +} + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { + name => 'ethernet_ports', + type => COUNTER_TYPE_INSTANCE, + cb_prefix_output => 'prefix_module_output', + message_multiple => 'All ONT ethernet port are ok', + skipped_code => { NO_VALUE() => 1 } + } + ]; + + $self->{maps_counters}->{ethernet_ports} = [ + { + label => 'status', + type => COUNTER_KIND_TEXT, + critical_default => '%{online_state} ne "linkup" || %{speed} eq "invalid"', + set => + { + key_values => [ + { name => 'online_state' }, + { name => 'display' }, + { name => 'speed' } + ], + 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, force_new_perfdata => 1); + bless $self, $class; + + $options{options}->add_options(arguments => { + 'include-serial:s' => { name => 'include_serial', default => '' }, + 'exclude-serial:s' => { name => 'exclude_serial', default => '' } + }); + + return $self; +} + +my $mapping_online_status = { + 1 => 'linkup', + 2 => 'linkdown', + -1 => 'invalid' +}; + +my $mapping_speed = { + 1 => 'speed10M', + 2 => 'speed100M', + 3 => 'speed1000M', + 4 => 'autoneg', + 5 => 'autospeed10M', + 6 => 'autospeed100M', + 7 => 'autospeed1000M', + 8 => 'speed10G', + 9 => 'autospeed10G', + 10 => 'speed2500M', + 11 => 'autospeed2500M', + 12 => 'speed5000M', + 13 => 'autospeed5000M', + 14 => 'speed25000M', + 15 => 'autospeed25000M', + 16 => 'speed40000M', + 17 => 'autospeed40000M', + -1 => 'invalid' +}; + +sub manage_selection { + my ($self, %options) = @_; + + my $mapping = { + serial => { oid => '.1.3.6.1.4.1.2011.6.128.1.1.2.43.1.3' },# hwGponDeviceOntSn + name => { oid => '.1.3.6.1.4.1.2011.6.128.1.1.2.43.1.9' }# hwGponDeviceOntDespt + }; + + my $snmp_result = $options{snmp}->get_multiple_table( + oids => [ { oid => $mapping->{serial}->{oid} }, { oid => $mapping->{name}->{oid} } ], + return_type => 1, + nothing_quit => 1 + ); + + my %ont = (); + + foreach my $oid (keys %{$snmp_result}) { + next if ($oid !~ /^$mapping->{name}->{oid}\.(.*)$/); + my $instance = $1; + + my $result = $options{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => $instance); + my $serial = get_serial_string($result->{serial}) // ''; + + next if is_excluded($serial, $self->{option_results}->{include_serial}, $self->{option_results}->{exclude_serial}, output => $self->{output}); + + $ont{$instance} = { + name => $result->{name}, + serial => $serial, + serial_hex => uc(unpack("H*", $result->{serial})), + }; + } + + + $self->{output}->option_exit(short_msg => 'no ethernet_ports associated') + unless keys %ont; + + $mapping = { + online_state => { oid => '.1.3.6.1.4.1.2011.6.128.1.1.2.62.1.22', map => $mapping_online_status }, + speed => { oid => '.1.3.6.1.4.1.2011.6.128.1.1.2.62.1.4', map => $mapping_speed } + }; + + $snmp_result = $options{snmp}->get_multiple_table( + oids => [ { oid => $mapping->{online_state}->{oid} }, { oid => $mapping->{speed}->{oid} } ], + return_type => 1, + nothing_quit => 1 + ); + + foreach my $oid (keys %{$snmp_result}) { + next if ($oid !~ /^$mapping->{online_state}->{oid}\.(.*)$/); + my $ont_instance = $1; + my ($ont_index, $port_id) = $ont_instance =~ /^(.*)\.([^.]+)$/; + + if (defined($ont{$ont_index})) { + my $result = $options{snmp}->map_instance( + mapping => $mapping, + results => $snmp_result, + instance => $ont_instance + ); + + my $port_instance = $ont_index . '-' . $port_id; + + $self->{ethernet_ports}->{$port_instance} = { + online_state => $result->{online_state}, + speed => $result->{speed}, + port_id => $port_id, + instance => $port_instance, + display => $ont{$ont_index}->{name}, + serial => $ont{$ont_index}->{serial}, + serial_hex => $ont{$ont_index}->{serial_hex}, + }; + } + } +} + +1; + +__END__ + +=head1 MODE + +Shows the status of a ONT module ETH port for GPON + +=over 8 + +=item B<--include-serial> + +Filter ONT by serial (can be a regexp). + +=item B<--exclude-serial> + +Exclude ONT by serial (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: C<%{online_state}>, C<%{display}>, C<%(speed)>. +C<%(online_state)> can have one of these values: C, C, C. +C<%(speed)> can have one of these values: C, C, C, C, C, +C, C, C, C, C, C, C, +C, C, C, C, C, C + +=item B<--critical-status> + +Define the conditions to match for the status to be CRITICAL. (default: C<'%{online_state} ne "linkup" || %{speed} eq "invalid"'>). +You can use the following variables: C<%{online_state}>, C<%{display}>, C<%(speed)>. +C<%(online_state)> can have one of these values: C, C, C. +C<%(speed)> can have one of these values: C, C, C, C, C, +C, C, C, C, C, C, C, +C, C, C, C, C, C + +=back + +=cut diff --git a/src/network/huawei/standard/snmp/mode/gpononthealth.pm b/src/network/huawei/standard/snmp/mode/gpononthealth.pm new file mode 100644 index 0000000000..34de724265 --- /dev/null +++ b/src/network/huawei/standard/snmp/mode/gpononthealth.pm @@ -0,0 +1,302 @@ +# +# Copyright 2026-Present 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::standard::snmp::mode::gpononthealth; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; +use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold_ng); +use centreon::plugins::constants qw/:counters :values/; +use centreon::plugins::misc qw/is_excluded/; +use centreon::common::huawei::standard::snmp::functions qw/get_serial_string/; + +sub prefix_module_output { + my ($self, %options) = @_; + + return sprintf("ONT %s %s(%s) ", + $options{instance_value}->{display}, + $options{instance_value}->{serial}, + $options{instance_value}->{serial_hex}, + ); +} + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { + name => 'ont', + type => COUNTER_TYPE_INSTANCE, + cb_prefix_output => 'prefix_module_output', + message_multiple => 'All ONT modules are ok', + skipped_code => { NO_VALUE() => 1 } + } + ]; + + $self->{maps_counters}->{ont} = [ + { + label => 'status', + type => COUNTER_KIND_TEXT, + critical_default => '%{status} ne "active"', + set => + { + key_values => + [ { name => 'status' }, { name => 'display' } ], + output_template => 'status %s', + closure_custom_perfdata => + sub {return 0;}, + closure_custom_threshold_check => + \&catalog_status_threshold_ng + } + }, + { label => 'temperature', nlabel => 'module.temperature.celsius', set => { + key_values => [ { name => 'temperature' } ], + output_template => 'module temperature: %sC', + perfdatas => [ + { template => '%s', unit => 'C' }, + ] + } + }, + { label => 'voltage', nlabel => 'module.voltage.volt', display_ok => 0, set => { + key_values => [ { name => 'voltage', no_value => 0 } ], + output_template => 'module voltage: %s V', + perfdatas => [ + { template => '%s', unit => 'V' } + ] + } + }, + { label => 'tx-power', nlabel => 'module.tx.power.dbm', set => { + key_values => [ { name => 'tx_power' }, { name => 'display' } ], + output_template => 'Tx Power: %s dBm', + perfdatas => [ + { template => '%s', unit => 'dBm', label_extra_instance => 1, instance_use => 'display' } + ] + } + }, + { label => 'rx-power', nlabel => 'module.rx.power.dbm', set => { + key_values => [ { name => 'rx_power' }, { name => 'display' } ], + output_template => 'Rx power: %s dBm', + perfdatas => [ + { template => '%s', unit => 'dBm', label_extra_instance => 1, instance_use => 'display' } + ] + } + }, + { label => 'bias-current', nlabel => 'module.bias.current.milliampere', set => { + key_values => [ { name => 'bias_current' }, { name => 'display' } ], + output_template => 'Bias current: %s mA', + perfdatas => [ + { template => '%s', unit => 'mA', label_extra_instance => 1, instance_use => 'display' } + ] + } + }, + { label => 'olt-rx-ont-power', nlabel => 'olt.rx.ont.power.dbm', set => { + key_values => [ { name => 'olt_rx_ont_power' }, { name => 'display' } ], + output_template => 'OLT Rx ONT power: %s dBm', + perfdatas => [ + { template => '%s', unit => 'dBm', 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 => { + 'include-serial:s' => { name => 'include_serial', default => '' }, + 'exclude-serial:s' => { name => 'exclude_serial', default => '' } + }); + + return $self; +} + +my $mapping_status = { + 1 => 'active', + 2 => 'notInService', + 3 => 'notReady', + 4 => 'createAndGo', + 5 => 'createAndWait', + 6 => 'destroy' +}; + +sub manage_selection { + my ($self, %options) = @_; + + my $mapping = { + serial => + { oid => '.1.3.6.1.4.1.2011.6.128.1.1.2.43.1.3' },# hwGponDeviceOntSn + name => + { oid => '.1.3.6.1.4.1.2011.6.128.1.1.2.43.1.9' },# hwGponDeviceOntDespt + status => + { oid => '.1.3.6.1.4.1.2011.6.128.1.1.2.43.1.10', map => $mapping_status },# hwGponDeviceOntEntryStatus + }; + + my $snmp_result = $options{snmp}->get_multiple_table( + oids => [ + { oid => $mapping->{serial}->{oid} }, + { oid => $mapping->{name}->{oid} }, + { oid => $mapping->{status}->{oid} } + ], + return_type => 1, + nothing_quit => 1 + ); + + foreach my $oid (keys %{$snmp_result}) { + next if ($oid !~ /^$mapping->{name}->{oid}\.(.*)$/); + my $instance = $1; + + my $result = $options{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => $instance); + my $serial_hex = uc(unpack("H*", $result->{serial})); + my $serial = get_serial_string($result->{serial}); + + next if is_excluded($serial, $self->{option_results}->{include_serial}, $self->{option_results}->{exclude_serial}, output => $self->{output}); + + $self->{ont}{$serial_hex} = { + instance => $instance, + display => $result->{name}, + serial => $serial, + serial_hex => $serial_hex, + status => $result->{status} + }; + } + + $self->{output}->option_exit(short_msg => 'no ont associated') + unless keys %{$self->{ont}}; + + $mapping = { + temperature => { oid => '.1.3.6.1.4.1.2011.6.128.1.1.2.51.1.1' }, + bias_current => { oid => '.1.3.6.1.4.1.2011.6.128.1.1.2.51.1.2' }, + tx_power => { oid => '.1.3.6.1.4.1.2011.6.128.1.1.2.51.1.3' },# hwGponOntOpticalDdmTxPower + rx_power => { oid => '.1.3.6.1.4.1.2011.6.128.1.1.2.51.1.4' },# hwGponOntOpticalDdmRxPower + voltage => { oid => '.1.3.6.1.4.1.2011.6.128.1.1.2.51.1.5' },# hwGponOntOpticalDdmVoltage + olt_rx_ont_power => { oid => '.1.3.6.1.4.1.2011.6.128.1.1.2.51.1.6' },# hwGponOntOpticalDdmOltRxOntPower + }; + + $options{snmp}->load( + oids => [ map($_->{oid}, values(%$mapping)) ], + instances => [ map($_->{instance}, values %{$self->{ont}}) ], + instance_regexp => '^(.*)$' + ); + $snmp_result = $options{snmp}->get_leef(); + + foreach (sort keys %{$self->{ont}}) { + my $result = $options{snmp}->map_instance( + mapping => $mapping, + results => $snmp_result, + instance => $self->{ont}->{$_}->{instance} + ); + + $self->{ont}->{$_}->{temperature} = $result->{temperature}; + $self->{ont}->{$_}->{bias_current} = $result->{bias_current} * 0.01; + $self->{ont}->{$_}->{tx_power} = $result->{tx_power} * 0.01; + $self->{ont}->{$_}->{rx_power} = $result->{rx_power} * 0.01; + $self->{ont}->{$_}->{voltage} = $result->{voltage} / 1000; + # Actual value =((Node value - 10000) / 100) + $self->{ont}->{$_}->{olt_rx_ont_power} = ($result->{olt_rx_ont_power} - 10000) / 100; + } +} + +1; + +__END__ + +=head1 MODE + +Shows the ONT health with performance data for power, temperature and voltage for GPON + +=over 8 + +=item B<--include-serial> + +Filter ONT by serial (can be a regexp). + +=item B<--exclude-serial> + +Exclude ONT by serial (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: C<%{status}>, C<%{display}>. +C<%(status)> can have one of these values: C, C, C, C, C, C. + +=item B<--critical-status> + +Define the conditions to match for the status to be CRITICAL. (default: C<'%{status} ne "active"'>). +You can use the following variables: C<%{status}>, C<%{display}>. +C<%(status)> can have one of these values: C, C, C, C, C, C. + + +=item B<--warning-temperature> + +Warning threshold in Celsius degrees. + +=item B<--critical-temperature> + +Critical threshold in Celsius degrees. + +=item B<--warning-voltage> + +Warning threshold for the power feed voltage of the optical module (V). + +=item B<--critical-voltage> + +Critical threshold for the power feed voltage of the optical module (V). + +=item B<--warning-tx-power> + +Warning threshold for the transmitting power of the optical module (dBm). + +=item B<--critical-tx-power> + +Critical threshold for the transmitting power of the optical module (dBm). + +=item B<--warning-rx-power> + +Warning threshold for the receiving power of the optical module (dBm). + +=item B<--critical-rx-power> + +Critical threshold for the receiving power of the optical module (dBm). + +=item B<--warning-bias-current> + +Warning threshold for the bias current of the optical module (mA). + +=item B<--critical-bias-current> + +Critical threshold for the bias current of the optical module (mA). + +=item B<--warning-olt-rx-ont-power> + +Warning threshold for the ONT optical power received on the OLT (dBm). + +=item B<--critical-olt-rx-ont-power> + +Critical threshold for the ONT optical power received on the OLT (dBm). + +=back + +=cut diff --git a/src/network/huawei/standard/snmp/mode/gpononttraffic.pm b/src/network/huawei/standard/snmp/mode/gpononttraffic.pm new file mode 100644 index 0000000000..60793929cc --- /dev/null +++ b/src/network/huawei/standard/snmp/mode/gpononttraffic.pm @@ -0,0 +1,271 @@ +# +# Copyright 2026-Present 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::standard::snmp::mode::gpononttraffic; + +use base qw(centreon::plugins::templates::counter); + +use strict; +use warnings; +use Digest::SHA qw(sha256_hex); +use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold_ng); +use centreon::plugins::constants qw/:counters :values/; +use centreon::plugins::misc qw/is_excluded/; +use centreon::common::huawei::standard::snmp::functions qw/get_serial_string/; + +sub prefix_module_output { + my ($self, %options) = @_; + + return sprintf("ONT %s %s(%s) ", + $options{instance_value}->{display}, + $options{instance_value}->{serial}, + $options{instance_value}->{serial_hex} + ); +} + +sub set_counters { + my ($self, %options) = @_; + + $self->{maps_counters_type} = [ + { + name => 'ont', + type => 1, + cb_prefix_output => 'prefix_module_output', + message_multiple => 'All ONT modules are ok', + skipped_code => { -10 => 1 } + } + ]; + + $self->{maps_counters}->{ont} = [ + { label => 'traffic-in', nlabel => 'ont.traffic.in.bitspersecond', set => { + key_values => [ + { name => 'up_bytes', per_second => 1 }, { name => 'display' } + ], + output_template => 'traffic in: %.2f %s/s', + output_change_bytes => 2, + perfdatas => [ + { template => '%.2f', unit => 'b/s', min => 0, label_extra_instance => 1, instance_use => 'display' } + ] + } + }, + { label => 'traffic-out', nlabel => 'ont.traffic.out.bitspersecond', set => { + key_values => [ + { name => 'down_bytes', per_second => 1 }, { name => 'display' } + ], + output_template => 'traffic out: %.2f %s/s', + output_change_bytes => 2, + perfdatas => [ + { template => '%.2f', unit => 'b/s', min => 0, label_extra_instance => 1, instance_use => 'display' } + ] + } + }, + { label => 'up-packets', nlabel => 'ont.packets.up.persecond', set => { + key_values => [ { name => 'up_packets', per_second => 1 } ], + output_template => 'Up packets (per sec): %d', + perfdatas => [ + { label => 'up_packets', template => '%d', min => 0, unit => 'packets/s' } + ] + } + }, + { label => 'down-packets', nlabel => 'ont.packets.down.persecond', set => { + key_values => [ { name => 'down_packets', per_second => 1 } ], + output_template => 'Down packets (per sec): %d', + perfdatas => [ + { label => 'down_packets', template => '%d', min => 0, unit => 'packets/s' } + ] + } + }, + { label => 'up-drop-packets', nlabel => 'ont.packets.up.drop.persecond', set => { + key_values => [ { name => 'up_drop_packets', per_second => 1 } ], + output_template => 'Up dropped packets (per sec): %d', + perfdatas => [ + { label => 'up_drop_packets', template => '%d', min => 0, unit => 'packets/s' } + ] + } + }, + { label => 'down-drop-packets', nlabel => 'ont.packets.down.drop.persecond', set => { + key_values => [ { name => 'down_drop_packets', per_second => 1 } ], + output_template => 'Down drop packets (per sec): %d', + perfdatas => [ + { label => 'down_drop_packets', template => '%d', min => 0, unit => 'packets/s' } + ] + } + } + ]; +} + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1, statefile => 1); + bless $self, $class; + + $options{options}->add_options(arguments => { + 'include-serial:s' => { name => 'include_serial', default => '' }, + 'exclude-serial:s' => { name => 'exclude_serial', default => '' } + }); + + return $self; +} + +sub manage_selection { + my ($self, %options) = @_; + + $self->{output}->option_exit(short_msg => "Need to use SNMP v2c or v3.") + if $options{snmp}->is_snmpv1(); + + $self->{cache_name} = 'huawei_gpon_' . $self->{mode} . '_' . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() . '_' . + sha256_hex(($self->{option_results}->{filter_counters} || 'all') . '_' . ($self->{option_results}->{filter_serial} || 'all')); + + my $mapping = { + serial => { oid => '.1.3.6.1.4.1.2011.6.128.1.1.2.43.1.3' },# hwGponDeviceOntSn + name => { oid => '.1.3.6.1.4.1.2011.6.128.1.1.2.43.1.9' },# hwGponDeviceOntDespt + }; + + my $snmp_result = $options{snmp}->get_multiple_table( + oids => [ { oid => $mapping->{serial}->{oid} }, { oid => $mapping->{name}->{oid} }, ], + return_type => 1, + nothing_quit => 1 + ); + + foreach my $oid (keys %{$snmp_result}) { + next if ($oid !~ /^$mapping->{name}->{oid}\.(.*)$/); + my $instance = $1; + + my $result = $options{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => $instance); + my $serial_hex = uc(unpack("H*", $result->{serial})); + my $serial = get_serial_string($result->{serial}); + + next if is_excluded($serial, $self->{option_results}->{include_serial}, $self->{option_results}->{exclude_serial}, output => $self->{output}); + + $self->{ont}{$serial_hex} = { + instance => $instance, + display => $result->{name}, + serial => $serial, + serial_hex => $serial_hex, + }; + } + + $self->{output}->option_exit(short_msg => 'no ont associated') + unless keys %{$self->{ont}}; + + $mapping = { + up_packets => { oid => '.1.3.6.1.4.1.2011.6.128.1.1.4.23.1.1' },# hwGponOntStatisticUpPackts + down_packets => { oid => '.1.3.6.1.4.1.2011.6.128.1.1.4.23.1.2' },# hwGponOntStatisticDownPackts + up_bytes => { oid => '.1.3.6.1.4.1.2011.6.128.1.1.4.23.1.3' },# hwGponOntStatisticUpBytes + down_bytes => { oid => '.1.3.6.1.4.1.2011.6.128.1.1.4.23.1.4' },# hwGponOntStatisticDownBytes + up_drop_packets => { oid => '.1.3.6.1.4.1.2011.6.128.1.1.4.23.1.5' },# hwGponOntStatisticUpDropPackts + down_drop_packets => { oid => '.1.3.6.1.4.1.2011.6.128.1.1.4.23.1.6' },# hwGponOntStatisticDownDropPackts + }; + + $options{snmp}->load( + oids => [ map($_->{oid}, values(%$mapping)) ], + instances => [ map($_->{instance}, values %{$self->{ont}}) ], + instance_regexp => '^(.*)$' + ); + $snmp_result = $options{snmp}->get_leef(); + + foreach (sort keys %{$self->{ont}}) { + my $result = $options{snmp}->map_instance( + mapping => $mapping, + results => $snmp_result, + instance => $self->{ont}->{$_}->{instance} + ); + + $self->{ont}->{$_}->{up_packets} = $result->{up_packets}; + $self->{ont}->{$_}->{down_packets} = $result->{down_packets}; + + # convert to bits + $self->{ont}->{$_}->{up_bytes} = $result->{up_bytes} * 8; + $self->{ont}->{$_}->{down_bytes} = $result->{down_bytes} * 8; + + $self->{ont}->{$_}->{up_drop_packets} = $result->{up_drop_packets}; + $self->{ont}->{$_}->{down_drop_packets} = $result->{down_drop_packets}; + } +} + +1; + +__END__ + +=head1 MODE + +Shows the traffic on the ONT module for GPON + +=over 8 + +=item B<--include-serial> + +Filter ONT by serial (can be a regexp). + +=item B<--exclude-serial> + +Exclude ONT by serial (can be a regexp). + +=item B<--warning-traffic-in> + +Warning threshold for the downstream bytes (b/s). + +=item B<--critical-traffic-in> + +Critical threshold for the downstream bytes (b/s). + +=item B<--warning-traffic-out> + +Warning threshold for the upstream bytes (b/s). + +=item B<--critical-traffic-out> + +Critical threshold for the upstream bytes (b/s). + +=item B<--warning-down-packets> + +Warning threshold for the downstream frames. (packets/s) + +=item B<--critical-down-packets> + +Critical threshold for the downstream frames. (packets/s) + +=item B<--warning-up-packets> + +Warning threshold for the upstream frames. (packets/s) + +=item B<--critical-up-packets> + +Critical threshold for the upstream frames. (packets/s) + +=item B<--warning-up-drop-packets> + +Warning threshold for the upstream discarded frames. (packets/s) + +=item B<--critical-up-drop-packets> + +Critical threshold for the upstream discarded frames. (packets/s) + +=item B<--warning-down-drop-packets> + +Warning threshold for the downstream discarded frames. (packets/s) + +=item B<--critical-down-drop-packets> + +Critical threshold for the downstream discarded frames. (packets/s) + +=back + +=cut diff --git a/src/network/huawei/standard/snmp/mode/listgponont.pm b/src/network/huawei/standard/snmp/mode/listgponont.pm new file mode 100644 index 0000000000..9516d44b70 --- /dev/null +++ b/src/network/huawei/standard/snmp/mode/listgponont.pm @@ -0,0 +1,188 @@ +# +# Copyright 2026-Present 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::standard::snmp::mode::listgponont; + +use base qw(centreon::plugins::mode); +use centreon::plugins::misc qw/is_excluded/; +use centreon::common::huawei::standard::snmp::functions qw/get_serial_string/; + +use strict; +use warnings; + +my $mapping_status = { + 1 => 'active', + 2 => 'notInService', + 3 => 'notReady', + 4 => 'createAndGo', + 5 => 'createAndWait', + 6 => 'destroy' +}; + +sub new { + my ($class, %options) = @_; + my $self = $class->SUPER::new(package => __PACKAGE__, %options); + bless $self, $class; + + $options{options}->add_options( + arguments => { + 'include-name:s' => { name => 'include_name', default => '' }, + 'exclude-name:s' => { name => 'exclude_name', default => '' }, + 'include-status:s' => { name => 'include_status', default => '' }, + 'exclude-status:s' => { name => 'exclude_status', default => '' }, + 'include-serial:s' => { name => 'include_serial', default => '' }, + 'exclude-serial:s' => { name => 'exclude_serial', default => '' } + } + ); + + return $self; +} + +sub check_options { + my ($self, %options) = @_; + $self->SUPER::init(%options); +} + +sub manage_selection { + my ($self, %options) = @_; + + my $mapping = { + serial => + { oid => '.1.3.6.1.4.1.2011.6.128.1.1.2.43.1.3' },# hwGponDeviceOntSn + name => + { oid => '.1.3.6.1.4.1.2011.6.128.1.1.2.43.1.9' },# hwGponDeviceOntDespt + state => + { oid => '.1.3.6.1.4.1.2011.6.128.1.1.2.43.1.10', map => $mapping_status },# hwGponDeviceOntEntryStatus + }; + + my $snmp_result = $options{snmp}->get_multiple_table( + oids => [ + { oid => $mapping->{serial}->{oid} }, + { oid => $mapping->{name}->{oid} }, + { oid => $mapping->{state}->{oid} } + ], + return_type => 1, + nothing_quit => 1 + ); + + foreach my $oid ($options{snmp}->oid_lex_sort(sort keys %{$snmp_result})) { + next if ($oid !~ /^$mapping->{serial}->{oid}\.(.*)$/); + my $instance = $1; + + my $result = $options{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => $instance); + + my $serial = get_serial_string($result->{serial}); + $result->{serial_hex} = uc(unpack("H*", $result->{serial})); + $result->{serial} = $serial // ''; + next if is_excluded($result->{name} // '', $self->{option_results}->{include_name}, $self->{option_results}->{exclude_name}, output => $self->{output}); + next if is_excluded($result->{serial}, $self->{option_results}->{include_serial}, $self->{option_results}->{exclude_serial}, output => $self->{output}); + next if is_excluded($result->{state} // '', $self->{option_results}->{include_status}, $self->{option_results}->{exclude_status}, output => $self->{output}); + + push @{$self->{ont}}, $result; + } +} + +sub run { + my ($self, %options) = @_; + + $self->manage_selection(%options); + + $self->{output}->option_exit(short_msg => "No ONT found matching.") + unless keys @{$self->{ont}}; + + foreach (sort { $a->{name} cmp $b->{name} } @{$self->{ont}}) { + $self->{output}->output_add( + long_msg => + sprintf( + "[Name = %s] [Serial = %s] [Serial Hex = %s] [State = %s]", + $_->{name}, + $_->{serial}, + $_->{serial_hex}, + $_->{state} + ) + ); + } + + $self->{output}->output_add( + severity => 'OK', + short_msg => 'List ONT:' + ); + $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', 'serial_hex', 'state' ]); +} + +sub disco_show { + my ($self, %options) = @_; + + $self->manage_selection(%options); + + foreach (sort { $a->{name} cmp $b->{name} } @{$self->{ont}}) { + $self->{output}->add_disco_entry( + name => $_->{name}, + serial => $_->{serial}, + serial_hex => $_->{serial_hex}, + state => $_->{state} + ); + } +} + +1; + +__END__ + +=head1 MODE + +List ONT for GPON. + +=over 8 + +=item B<--include-name> + +Filter ONT by name (can be a regexp). + +=item B<--exclude-name> + +Exclude ONT by name (can be a regexp). + +=item B<--include-serial> + +Filter ONT by serial (can be a regexp). + +=item B<--exclude-serial> + +Exclude ONT by serial (can be a regexp). + +=item B<--include-status> + +Filter ONT by status + +=item B<--exclude-status> + +Exclude ONT by status + +=back + +=cut diff --git a/src/network/huawei/standard/snmp/plugin.pm b/src/network/huawei/standard/snmp/plugin.pm index 6e12a89448..ece667c40f 100644 --- a/src/network/huawei/standard/snmp/plugin.pm +++ b/src/network/huawei/standard/snmp/plugin.pm @@ -1,5 +1,5 @@ # -# Copyright 2024 Centreon (http://www.centreon.com/) +# Copyright 2026-Present Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for @@ -30,12 +30,16 @@ sub new { bless $self, $class; $self->{modes} = { - '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' => 'centreon::common::huawei::standard::snmp::mode::memory', - 'uptime' => 'snmp_standard::mode::uptime' + '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', + 'list-gpon-ont' => 'network::huawei::standard::snmp::mode::listgponont', + 'memory' => 'centreon::common::huawei::standard::snmp::mode::memory', + 'gpon-ont-ethernet-port' => 'network::huawei::standard::snmp::mode::gponontethernetport', + 'gpon-ont-health' => 'network::huawei::standard::snmp::mode::gpononthealth', + 'gpon-ont-traffic' => 'network::huawei::standard::snmp::mode::gpononttraffic', + 'uptime' => 'snmp_standard::mode::uptime' }; return $self; diff --git a/tests/network/huawei/standard/snmp/gpon-ont-ethernet-port.robot b/tests/network/huawei/standard/snmp/gpon-ont-ethernet-port.robot new file mode 100644 index 0000000000..f7f5d85fc0 --- /dev/null +++ b/tests/network/huawei/standard/snmp/gpon-ont-ethernet-port.robot @@ -0,0 +1,48 @@ +*** Settings *** +Documentation network::huawei::standard::snmp::plugin + +Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource + +Suite Setup Ctn Generic Suite Setup +Suite Teardown Ctn Generic Suite Teardown +Test Timeout 120s + + +*** Variables *** +${CMD} ${CENTREON_PLUGINS} +... --plugin=network::huawei::standard::snmp::plugin +... --mode=gpon-ont-ethernet-port +... --hostname=${HOSTNAME} +... --snmp-port=${SNMPPORT} +... --snmp-community=network/huawei/standard/snmp/huawei-gpon + + +*** Test Cases *** +Gpon-ont-ethernet-port ${tc} + [Tags] network huawei snmp + ${command} Catenate + ... ${CMD} + ... ${extra_options} + + Ctn Run Command And Check Result As Strings ${command} ${expected_result} + + Examples: + ... tc + ... extra_options + ... expected_result + ... -- + ... 1 + ... ${EMPTY} + ... CRITICAL: ONT 'xDSL ANO 2' - ANON00000002(414E4F4E00000002) ethernet port 1 (autospeed100M) status : linkdown + ... 2 + ... --include-serial=ANON00000001 + ... OK: ONT 'xDSL ANO 1' - ANON00000001(414E4F4E00000001) ethernet port 1 (autospeed10M) status : linkup + ... 3 + ... --exclude-serial=ANON00000002 + ... OK: All ONT ethernet port are ok + ... 4 + ... --warning-status='\\\%{online_state} =~ /linkdown/' --critical-status='' + ... WARNING: ONT 'xDSL ANO 2' - ANON00000002(414E4F4E00000002) ethernet port 1 (autospeed100M) status : linkdown + ... 5 + ... --critical-status='\\\%{online_state} =~ /linkup/' + ... CRITICAL: ONT 'xDSL ANO 1' - ANON00000001(414E4F4E00000001) ethernet port 1 (autospeed10M) status : linkup - ONT 'DSLAM ANO 3' - ANON00000003(414E4F4E00000003) ethernet port 1 (autospeed1000M) status : linkup diff --git a/tests/network/huawei/standard/snmp/gpon-ont-health.robot b/tests/network/huawei/standard/snmp/gpon-ont-health.robot new file mode 100644 index 0000000000..f90773471a --- /dev/null +++ b/tests/network/huawei/standard/snmp/gpon-ont-health.robot @@ -0,0 +1,84 @@ +*** Settings *** +Documentation network::huawei::standard::snmp::plugin + +Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource + +Suite Setup Ctn Generic Suite Setup +Suite Teardown Ctn Generic Suite Teardown +Test Timeout 120s + + +*** Variables *** +${CMD} ${CENTREON_PLUGINS} +... --plugin=network::huawei::standard::snmp::plugin +... --mode=gpon-ont-health +... --hostname=${HOSTNAME} +... --snmp-port=${SNMPPORT} +... --snmp-community=network/huawei/standard/snmp/huawei-gpon + + +*** Test Cases *** +Gpon-ont-health ${tc} + [Tags] network huawei snmp + ${command} Catenate + ... ${CMD} + ... ${extra_options} + + Ctn Run Command And Check Result As Strings ${command} ${expected_result} + + Examples: + ... tc + ... extra_options + ... expected_result + ... -- + ... 1 + ... ${EMPTY} + ... CRITICAL: ONT xDSL ANO 2 ANON00000002(414E4F4E00000002) status notReady | 'module.temperature.celsius'=41C;;;; 'module.voltage.volt'=3.22V;;;; 'xDSL ANO 1#module.tx.power.dbm'=2.13dBm;;;; 'xDSL ANO 1#module.rx.power.dbm'=-14.14dBm;;;; 'xDSL ANO 1#module.bias.current.milliampere'=0.19mA;;;; 'xDSL ANO 1#olt.rx.ont.power.dbm'=-19.36dBm;;;; 'module.temperature.celsius'=31C;;;; 'module.voltage.volt'=3.3V;;;; 'xDSL ANO 2#module.tx.power.dbm'=2.16dBm;;;; 'xDSL ANO 2#module.rx.power.dbm'=-15.65dBm;;;; 'xDSL ANO 2#module.bias.current.milliampere'=0.14mA;;;; 'xDSL ANO 2#olt.rx.ont.power.dbm'=-19.71dBm;;;; 'module.temperature.celsius'=51C;;;; 'module.voltage.volt'=3.34V;;;; 'DSLAM ANO 3#module.tx.power.dbm'=2.73dBm;;;; 'DSLAM ANO 3#module.rx.power.dbm'=-14.64dBm;;;; 'DSLAM ANO 3#module.bias.current.milliampere'=0.17mA;;;; 'DSLAM ANO 3#olt.rx.ont.power.dbm'=-18.57dBm;;;; + ... 2 + ... --include-serial=ANON00000001 + ... OK: ONT xDSL ANO 1 ANON00000001(414E4F4E00000001) status active, module temperature: 41C, Tx Power: 2.13 dBm, Rx power: -14.14 dBm, Bias current: 0.19 mA, OLT Rx ONT power: -19.36 dBm | 'module.temperature.celsius'=41C;;;; 'module.voltage.volt'=3.22V;;;; 'xDSL ANO 1#module.tx.power.dbm'=2.13dBm;;;; 'xDSL ANO 1#module.rx.power.dbm'=-14.14dBm;;;; 'xDSL ANO 1#module.bias.current.milliampere'=0.19mA;;;; 'xDSL ANO 1#olt.rx.ont.power.dbm'=-19.36dBm;;;; + ... 3 + ... --exclude-serial=ANON00000002 + ... OK: All ONT modules are ok | 'module.temperature.celsius'=41C;;;; 'module.voltage.volt'=3.22V;;;; 'xDSL ANO 1#module.tx.power.dbm'=2.13dBm;;;; 'xDSL ANO 1#module.rx.power.dbm'=-14.14dBm;;;; 'xDSL ANO 1#module.bias.current.milliampere'=0.19mA;;;; 'xDSL ANO 1#olt.rx.ont.power.dbm'=-19.36dBm;;;; 'module.temperature.celsius'=51C;;;; 'module.voltage.volt'=3.34V;;;; 'DSLAM ANO 3#module.tx.power.dbm'=2.73dBm;;;; 'DSLAM ANO 3#module.rx.power.dbm'=-14.64dBm;;;; 'DSLAM ANO 3#module.bias.current.milliampere'=0.17mA;;;; 'DSLAM ANO 3#olt.rx.ont.power.dbm'=-18.57dBm;;;; + ... 4 + ... --include-serial=ANON00000001 --warning-status='\\\%{status} =~ /active/' + ... WARNING: ONT xDSL ANO 1 ANON00000001(414E4F4E00000001) status active | 'module.temperature.celsius'=41C;;;; 'module.voltage.volt'=3.22V;;;; 'xDSL ANO 1#module.tx.power.dbm'=2.13dBm;;;; 'xDSL ANO 1#module.rx.power.dbm'=-14.14dBm;;;; 'xDSL ANO 1#module.bias.current.milliampere'=0.19mA;;;; 'xDSL ANO 1#olt.rx.ont.power.dbm'=-19.36dBm;;;; + ... 5 + ... --include-serial=ANON00000001 --critical-status='\\\%{status} =~ /active/' + ... CRITICAL: ONT xDSL ANO 1 ANON00000001(414E4F4E00000001) status active | 'module.temperature.celsius'=41C;;;; 'module.voltage.volt'=3.22V;;;; 'xDSL ANO 1#module.tx.power.dbm'=2.13dBm;;;; 'xDSL ANO 1#module.rx.power.dbm'=-14.14dBm;;;; 'xDSL ANO 1#module.bias.current.milliampere'=0.19mA;;;; 'xDSL ANO 1#olt.rx.ont.power.dbm'=-19.36dBm;;;; + ... 6 + ... --critical-status='' --warning-temperature=:1 + ... WARNING: ONT xDSL ANO 1 ANON00000001(414E4F4E00000001) module temperature: 41C - ONT xDSL ANO 2 ANON00000002(414E4F4E00000002) module temperature: 31C - ONT DSLAM ANO 3 ANON00000003(414E4F4E00000003) module temperature: 51C | 'module.temperature.celsius'=41C;0:1;;; 'module.voltage.volt'=3.22V;;;; 'xDSL ANO 1#module.tx.power.dbm'=2.13dBm;;;; 'xDSL ANO 1#module.rx.power.dbm'=-14.14dBm;;;; 'xDSL ANO 1#module.bias.current.milliampere'=0.19mA;;;; 'xDSL ANO 1#olt.rx.ont.power.dbm'=-19.36dBm;;;; 'module.temperature.celsius'=31C;0:1;;; 'module.voltage.volt'=3.3V;;;; 'xDSL ANO 2#module.tx.power.dbm'=2.16dBm;;;; 'xDSL ANO 2#module.rx.power.dbm'=-15.65dBm;;;; 'xDSL ANO 2#module.bias.current.milliampere'=0.14mA;;;; 'xDSL ANO 2#olt.rx.ont.power.dbm'=-19.71dBm;;;; 'module.temperature.celsius'=51C;0:1;;; 'module.voltage.volt'=3.34V;;;; 'DSLAM ANO 3#module.tx.power.dbm'=2.73dBm;;;; 'DSLAM ANO 3#module.rx.power.dbm'=-14.64dBm;;;; 'DSLAM ANO 3#module.bias.current.milliampere'=0.17mA;;;; 'DSLAM ANO 3#olt.rx.ont.power.dbm'=-18.57dBm;;;; + ... 7 + ... --critical-status='' --critical-temperature=:1 + ... CRITICAL: ONT xDSL ANO 1 ANON00000001(414E4F4E00000001) module temperature: 41C - ONT xDSL ANO 2 ANON00000002(414E4F4E00000002) module temperature: 31C - ONT DSLAM ANO 3 ANON00000003(414E4F4E00000003) module temperature: 51C | 'module.temperature.celsius'=41C;;0:1;; 'module.voltage.volt'=3.22V;;;; 'xDSL ANO 1#module.tx.power.dbm'=2.13dBm;;;; 'xDSL ANO 1#module.rx.power.dbm'=-14.14dBm;;;; 'xDSL ANO 1#module.bias.current.milliampere'=0.19mA;;;; 'xDSL ANO 1#olt.rx.ont.power.dbm'=-19.36dBm;;;; 'module.temperature.celsius'=31C;;0:1;; 'module.voltage.volt'=3.3V;;;; 'xDSL ANO 2#module.tx.power.dbm'=2.16dBm;;;; 'xDSL ANO 2#module.rx.power.dbm'=-15.65dBm;;;; 'xDSL ANO 2#module.bias.current.milliampere'=0.14mA;;;; 'xDSL ANO 2#olt.rx.ont.power.dbm'=-19.71dBm;;;; 'module.temperature.celsius'=51C;;0:1;; 'module.voltage.volt'=3.34V;;;; 'DSLAM ANO 3#module.tx.power.dbm'=2.73dBm;;;; 'DSLAM ANO 3#module.rx.power.dbm'=-14.64dBm;;;; 'DSLAM ANO 3#module.bias.current.milliampere'=0.17mA;;;; 'DSLAM ANO 3#olt.rx.ont.power.dbm'=-18.57dBm;;;; + ... 8 + ... --critical-status='' --warning-voltage=:1 + ... WARNING: ONT xDSL ANO 1 ANON00000001(414E4F4E00000001) module voltage: 3.22 V - ONT xDSL ANO 2 ANON00000002(414E4F4E00000002) module voltage: 3.3 V - ONT DSLAM ANO 3 ANON00000003(414E4F4E00000003) module voltage: 3.34 V | 'module.temperature.celsius'=41C;;;; 'module.voltage.volt'=3.22V;0:1;;; 'xDSL ANO 1#module.tx.power.dbm'=2.13dBm;;;; 'xDSL ANO 1#module.rx.power.dbm'=-14.14dBm;;;; 'xDSL ANO 1#module.bias.current.milliampere'=0.19mA;;;; 'xDSL ANO 1#olt.rx.ont.power.dbm'=-19.36dBm;;;; 'module.temperature.celsius'=31C;;;; 'module.voltage.volt'=3.3V;0:1;;; 'xDSL ANO 2#module.tx.power.dbm'=2.16dBm;;;; 'xDSL ANO 2#module.rx.power.dbm'=-15.65dBm;;;; 'xDSL ANO 2#module.bias.current.milliampere'=0.14mA;;;; 'xDSL ANO 2#olt.rx.ont.power.dbm'=-19.71dBm;;;; 'module.temperature.celsius'=51C;;;; 'module.voltage.volt'=3.34V;0:1;;; 'DSLAM ANO 3#module.tx.power.dbm'=2.73dBm;;;; 'DSLAM ANO 3#module.rx.power.dbm'=-14.64dBm;;;; 'DSLAM ANO 3#module.bias.current.milliampere'=0.17mA;;;; 'DSLAM ANO 3#olt.rx.ont.power.dbm'=-18.57dBm;;;; + ... 9 + ... --critical-status='' --critical-voltage=:1 + ... CRITICAL: ONT xDSL ANO 1 ANON00000001(414E4F4E00000001) module voltage: 3.22 V - ONT xDSL ANO 2 ANON00000002(414E4F4E00000002) module voltage: 3.3 V - ONT DSLAM ANO 3 ANON00000003(414E4F4E00000003) module voltage: 3.34 V | 'module.temperature.celsius'=41C;;;; 'module.voltage.volt'=3.22V;;0:1;; 'xDSL ANO 1#module.tx.power.dbm'=2.13dBm;;;; 'xDSL ANO 1#module.rx.power.dbm'=-14.14dBm;;;; 'xDSL ANO 1#module.bias.current.milliampere'=0.19mA;;;; 'xDSL ANO 1#olt.rx.ont.power.dbm'=-19.36dBm;;;; 'module.temperature.celsius'=31C;;;; 'module.voltage.volt'=3.3V;;0:1;; 'xDSL ANO 2#module.tx.power.dbm'=2.16dBm;;;; 'xDSL ANO 2#module.rx.power.dbm'=-15.65dBm;;;; 'xDSL ANO 2#module.bias.current.milliampere'=0.14mA;;;; 'xDSL ANO 2#olt.rx.ont.power.dbm'=-19.71dBm;;;; 'module.temperature.celsius'=51C;;;; 'module.voltage.volt'=3.34V;;0:1;; 'DSLAM ANO 3#module.tx.power.dbm'=2.73dBm;;;; 'DSLAM ANO 3#module.rx.power.dbm'=-14.64dBm;;;; 'DSLAM ANO 3#module.bias.current.milliampere'=0.17mA;;;; 'DSLAM ANO 3#olt.rx.ont.power.dbm'=-18.57dBm;;;; + ... 10 + ... --critical-status='' --warning-tx-power=:1 + ... WARNING: ONT xDSL ANO 1 ANON00000001(414E4F4E00000001) Tx Power: 2.13 dBm - ONT xDSL ANO 2 ANON00000002(414E4F4E00000002) Tx Power: 2.16 dBm - ONT DSLAM ANO 3 ANON00000003(414E4F4E00000003) Tx Power: 2.73 dBm | 'module.temperature.celsius'=41C;;;; 'module.voltage.volt'=3.22V;;;; 'xDSL ANO 1#module.tx.power.dbm'=2.13dBm;0:1;;; 'xDSL ANO 1#module.rx.power.dbm'=-14.14dBm;;;; 'xDSL ANO 1#module.bias.current.milliampere'=0.19mA;;;; 'xDSL ANO 1#olt.rx.ont.power.dbm'=-19.36dBm;;;; 'module.temperature.celsius'=31C;;;; 'module.voltage.volt'=3.3V;;;; 'xDSL ANO 2#module.tx.power.dbm'=2.16dBm;0:1;;; 'xDSL ANO 2#module.rx.power.dbm'=-15.65dBm;;;; 'xDSL ANO 2#module.bias.current.milliampere'=0.14mA;;;; 'xDSL ANO 2#olt.rx.ont.power.dbm'=-19.71dBm;;;; 'module.temperature.celsius'=51C;;;; 'module.voltage.volt'=3.34V;;;; 'DSLAM ANO 3#module.tx.power.dbm'=2.73dBm;0:1;;; 'DSLAM ANO 3#module.rx.power.dbm'=-14.64dBm;;;; 'DSLAM ANO 3#module.bias.current.milliampere'=0.17mA;;;; 'DSLAM ANO 3#olt.rx.ont.power.dbm'=-18.57dBm;;;; + ... 11 + ... --critical-status='' --critical-tx-power=:1 + ... CRITICAL: ONT xDSL ANO 1 ANON00000001(414E4F4E00000001) Tx Power: 2.13 dBm - ONT xDSL ANO 2 ANON00000002(414E4F4E00000002) Tx Power: 2.16 dBm - ONT DSLAM ANO 3 ANON00000003(414E4F4E00000003) Tx Power: 2.73 dBm | 'module.temperature.celsius'=41C;;;; 'module.voltage.volt'=3.22V;;;; 'xDSL ANO 1#module.tx.power.dbm'=2.13dBm;;0:1;; 'xDSL ANO 1#module.rx.power.dbm'=-14.14dBm;;;; 'xDSL ANO 1#module.bias.current.milliampere'=0.19mA;;;; 'xDSL ANO 1#olt.rx.ont.power.dbm'=-19.36dBm;;;; 'module.temperature.celsius'=31C;;;; 'module.voltage.volt'=3.3V;;;; 'xDSL ANO 2#module.tx.power.dbm'=2.16dBm;;0:1;; 'xDSL ANO 2#module.rx.power.dbm'=-15.65dBm;;;; 'xDSL ANO 2#module.bias.current.milliampere'=0.14mA;;;; 'xDSL ANO 2#olt.rx.ont.power.dbm'=-19.71dBm;;;; 'module.temperature.celsius'=51C;;;; 'module.voltage.volt'=3.34V;;;; 'DSLAM ANO 3#module.tx.power.dbm'=2.73dBm;;0:1;; 'DSLAM ANO 3#module.rx.power.dbm'=-14.64dBm;;;; 'DSLAM ANO 3#module.bias.current.milliampere'=0.17mA;;;; 'DSLAM ANO 3#olt.rx.ont.power.dbm'=-18.57dBm;;;; + ... 12 + ... --critical-status='' --warning-rx-power=:1 + ... WARNING: ONT xDSL ANO 1 ANON00000001(414E4F4E00000001) Rx power: -14.14 dBm - ONT xDSL ANO 2 ANON00000002(414E4F4E00000002) Rx power: -15.65 dBm - ONT DSLAM ANO 3 ANON00000003(414E4F4E00000003) Rx power: -14.64 dBm | 'module.temperature.celsius'=41C;;;; 'module.voltage.volt'=3.22V;;;; 'xDSL ANO 1#module.tx.power.dbm'=2.13dBm;;;; 'xDSL ANO 1#module.rx.power.dbm'=-14.14dBm;0:1;;; 'xDSL ANO 1#module.bias.current.milliampere'=0.19mA;;;; 'xDSL ANO 1#olt.rx.ont.power.dbm'=-19.36dBm;;;; 'module.temperature.celsius'=31C;;;; 'module.voltage.volt'=3.3V;;;; 'xDSL ANO 2#module.tx.power.dbm'=2.16dBm;;;; 'xDSL ANO 2#module.rx.power.dbm'=-15.65dBm;0:1;;; 'xDSL ANO 2#module.bias.current.milliampere'=0.14mA;;;; 'xDSL ANO 2#olt.rx.ont.power.dbm'=-19.71dBm;;;; 'module.temperature.celsius'=51C;;;; 'module.voltage.volt'=3.34V;;;; 'DSLAM ANO 3#module.tx.power.dbm'=2.73dBm;;;; 'DSLAM ANO 3#module.rx.power.dbm'=-14.64dBm;0:1;;; 'DSLAM ANO 3#module.bias.current.milliampere'=0.17mA;;;; 'DSLAM ANO 3#olt.rx.ont.power.dbm'=-18.57dBm;;;; + ... 13 + ... --critical-status='' --critical-rx-power=:1 + ... CRITICAL: ONT xDSL ANO 1 ANON00000001(414E4F4E00000001) Rx power: -14.14 dBm - ONT xDSL ANO 2 ANON00000002(414E4F4E00000002) Rx power: -15.65 dBm - ONT DSLAM ANO 3 ANON00000003(414E4F4E00000003) Rx power: -14.64 dBm | 'module.temperature.celsius'=41C;;;; 'module.voltage.volt'=3.22V;;;; 'xDSL ANO 1#module.tx.power.dbm'=2.13dBm;;;; 'xDSL ANO 1#module.rx.power.dbm'=-14.14dBm;;0:1;; 'xDSL ANO 1#module.bias.current.milliampere'=0.19mA;;;; 'xDSL ANO 1#olt.rx.ont.power.dbm'=-19.36dBm;;;; 'module.temperature.celsius'=31C;;;; 'module.voltage.volt'=3.3V;;;; 'xDSL ANO 2#module.tx.power.dbm'=2.16dBm;;;; 'xDSL ANO 2#module.rx.power.dbm'=-15.65dBm;;0:1;; 'xDSL ANO 2#module.bias.current.milliampere'=0.14mA;;;; 'xDSL ANO 2#olt.rx.ont.power.dbm'=-19.71dBm;;;; 'module.temperature.celsius'=51C;;;; 'module.voltage.volt'=3.34V;;;; 'DSLAM ANO 3#module.tx.power.dbm'=2.73dBm;;;; 'DSLAM ANO 3#module.rx.power.dbm'=-14.64dBm;;0:1;; 'DSLAM ANO 3#module.bias.current.milliampere'=0.17mA;;;; 'DSLAM ANO 3#olt.rx.ont.power.dbm'=-18.57dBm;;;; + ... 14 + ... --critical-status='' --warning-bias-current=1: + ... WARNING: ONT xDSL ANO 1 ANON00000001(414E4F4E00000001) Bias current: 0.19 mA - ONT xDSL ANO 2 ANON00000002(414E4F4E00000002) Bias current: 0.14 mA - ONT DSLAM ANO 3 ANON00000003(414E4F4E00000003) Bias current: 0.17 mA | 'module.temperature.celsius'=41C;;;; 'module.voltage.volt'=3.22V;;;; 'xDSL ANO 1#module.tx.power.dbm'=2.13dBm;;;; 'xDSL ANO 1#module.rx.power.dbm'=-14.14dBm;;;; 'xDSL ANO 1#module.bias.current.milliampere'=0.19mA;1:;;; 'xDSL ANO 1#olt.rx.ont.power.dbm'=-19.36dBm;;;; 'module.temperature.celsius'=31C;;;; 'module.voltage.volt'=3.3V;;;; 'xDSL ANO 2#module.tx.power.dbm'=2.16dBm;;;; 'xDSL ANO 2#module.rx.power.dbm'=-15.65dBm;;;; 'xDSL ANO 2#module.bias.current.milliampere'=0.14mA;1:;;; 'xDSL ANO 2#olt.rx.ont.power.dbm'=-19.71dBm;;;; 'module.temperature.celsius'=51C;;;; 'module.voltage.volt'=3.34V;;;; 'DSLAM ANO 3#module.tx.power.dbm'=2.73dBm;;;; 'DSLAM ANO 3#module.rx.power.dbm'=-14.64dBm;;;; 'DSLAM ANO 3#module.bias.current.milliampere'=0.17mA;1:;;; 'DSLAM ANO 3#olt.rx.ont.power.dbm'=-18.57dBm;;;; + ... 15 + ... --critical-status='' --critical-bias-current=1: + ... CRITICAL: ONT xDSL ANO 1 ANON00000001(414E4F4E00000001) Bias current: 0.19 mA - ONT xDSL ANO 2 ANON00000002(414E4F4E00000002) Bias current: 0.14 mA - ONT DSLAM ANO 3 ANON00000003(414E4F4E00000003) Bias current: 0.17 mA | 'module.temperature.celsius'=41C;;;; 'module.voltage.volt'=3.22V;;;; 'xDSL ANO 1#module.tx.power.dbm'=2.13dBm;;;; 'xDSL ANO 1#module.rx.power.dbm'=-14.14dBm;;;; 'xDSL ANO 1#module.bias.current.milliampere'=0.19mA;;1:;; 'xDSL ANO 1#olt.rx.ont.power.dbm'=-19.36dBm;;;; 'module.temperature.celsius'=31C;;;; 'module.voltage.volt'=3.3V;;;; 'xDSL ANO 2#module.tx.power.dbm'=2.16dBm;;;; 'xDSL ANO 2#module.rx.power.dbm'=-15.65dBm;;;; 'xDSL ANO 2#module.bias.current.milliampere'=0.14mA;;1:;; 'xDSL ANO 2#olt.rx.ont.power.dbm'=-19.71dBm;;;; 'module.temperature.celsius'=51C;;;; 'module.voltage.volt'=3.34V;;;; 'DSLAM ANO 3#module.tx.power.dbm'=2.73dBm;;;; 'DSLAM ANO 3#module.rx.power.dbm'=-14.64dBm;;;; 'DSLAM ANO 3#module.bias.current.milliampere'=0.17mA;;1:;; 'DSLAM ANO 3#olt.rx.ont.power.dbm'=-18.57dBm;;;; + ... 16 + ... --critical-status='' --warning-olt-rx-ont-power=:1 + ... WARNING: ONT xDSL ANO 1 ANON00000001(414E4F4E00000001) OLT Rx ONT power: -19.36 dBm - ONT xDSL ANO 2 ANON00000002(414E4F4E00000002) OLT Rx ONT power: -19.71 dBm - ONT DSLAM ANO 3 ANON00000003(414E4F4E00000003) OLT Rx ONT power: -18.57 dBm | 'module.temperature.celsius'=41C;;;; 'module.voltage.volt'=3.22V;;;; 'xDSL ANO 1#module.tx.power.dbm'=2.13dBm;;;; 'xDSL ANO 1#module.rx.power.dbm'=-14.14dBm;;;; 'xDSL ANO 1#module.bias.current.milliampere'=0.19mA;;;; 'xDSL ANO 1#olt.rx.ont.power.dbm'=-19.36dBm;0:1;;; 'module.temperature.celsius'=31C;;;; 'module.voltage.volt'=3.3V;;;; 'xDSL ANO 2#module.tx.power.dbm'=2.16dBm;;;; 'xDSL ANO 2#module.rx.power.dbm'=-15.65dBm;;;; 'xDSL ANO 2#module.bias.current.milliampere'=0.14mA;;;; 'xDSL ANO 2#olt.rx.ont.power.dbm'=-19.71dBm;0:1;;; 'module.temperature.celsius'=51C;;;; 'module.voltage.volt'=3.34V;;;; 'DSLAM ANO 3#module.tx.power.dbm'=2.73dBm;;;; 'DSLAM ANO 3#module.rx.power.dbm'=-14.64dBm;;;; 'DSLAM ANO 3#module.bias.current.milliampere'=0.17mA;;;; 'DSLAM ANO 3#olt.rx.ont.power.dbm'=-18.57dBm;0:1;;; + ... 17 + ... --critical-status='' --critical-olt-rx-ont-power=:1 + ... CRITICAL: ONT xDSL ANO 1 ANON00000001(414E4F4E00000001) OLT Rx ONT power: -19.36 dBm - ONT xDSL ANO 2 ANON00000002(414E4F4E00000002) OLT Rx ONT power: -19.71 dBm - ONT DSLAM ANO 3 ANON00000003(414E4F4E00000003) OLT Rx ONT power: -18.57 dBm | 'module.temperature.celsius'=41C;;;; 'module.voltage.volt'=3.22V;;;; 'xDSL ANO 1#module.tx.power.dbm'=2.13dBm;;;; 'xDSL ANO 1#module.rx.power.dbm'=-14.14dBm;;;; 'xDSL ANO 1#module.bias.current.milliampere'=0.19mA;;;; 'xDSL ANO 1#olt.rx.ont.power.dbm'=-19.36dBm;;0:1;; 'module.temperature.celsius'=31C;;;; 'module.voltage.volt'=3.3V;;;; 'xDSL ANO 2#module.tx.power.dbm'=2.16dBm;;;; 'xDSL ANO 2#module.rx.power.dbm'=-15.65dBm;;;; 'xDSL ANO 2#module.bias.current.milliampere'=0.14mA;;;; 'xDSL ANO 2#olt.rx.ont.power.dbm'=-19.71dBm;;0:1;; 'module.temperature.celsius'=51C;;;; 'module.voltage.volt'=3.34V;;;; 'DSLAM ANO 3#module.tx.power.dbm'=2.73dBm;;;; 'DSLAM ANO 3#module.rx.power.dbm'=-14.64dBm;;;; 'DSLAM ANO 3#module.bias.current.milliampere'=0.17mA;;;; 'DSLAM ANO 3#olt.rx.ont.power.dbm'=-18.57dBm;;0:1;; diff --git a/tests/network/huawei/standard/snmp/gpon-ont-traffic.robot b/tests/network/huawei/standard/snmp/gpon-ont-traffic.robot new file mode 100644 index 0000000000..805c31ec2f --- /dev/null +++ b/tests/network/huawei/standard/snmp/gpon-ont-traffic.robot @@ -0,0 +1,79 @@ +*** Settings *** +Documentation network::huawei::standard::snmp::plugin + +Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource + +Suite Setup Ctn Generic Suite Setup +Suite Teardown Ctn Generic Suite Teardown +Test Timeout 120s + + +*** Variables *** +${CMD} ${CENTREON_PLUGINS} +... --plugin=network::huawei::standard::snmp::plugin +... --mode=gpon-ont-traffic +... --hostname=${HOSTNAME} +... --snmp-port=${SNMPPORT} +... --snmp-version=v2 +... --snmp-community=network/huawei/standard/snmp/huawei-gpon + + +*** Test Cases *** +Gpon-ont-traffic ${tc} + [Tags] network huawei snmp + ${command} Catenate + ... ${CMD} + ... ${extra_options} + + Ctn Run Command And Check Result As Strings ${command} ${expected_result} + + Examples: + ... tc + ... extra_options + ... expected_result + ... -- + ... 1 + ... ${EMPTY} + ... OK: All ONT modules are ok + ... 2 + ... --include-serial=ANON00000001 + ... OK: ONT xDSL ANO 1 ANON00000001(414E4F4E00000001) traffic in: 0.00 b/s, traffic out: 0.00 b/s, Up packets (per sec): 0, Down packets (per sec): 0, Up dropped packets (per sec): 0, Down drop packets (per sec): 0 | 'xDSL ANO 1#ont.traffic.in.bitspersecond'=0.00b/s;;;0; 'xDSL ANO 1#ont.traffic.out.bitspersecond'=0.00b/s;;;0; 'ont.packets.up.persecond'=0packets/s;;;0; 'ont.packets.down.persecond'=0packets/s;;;0; 'ont.packets.up.drop.persecond'=0packets/s;;;0; 'ont.packets.down.drop.persecond'=0packets/s;;;0; + ... 3 + ... --exclude-serial=ANON00000001 + ... OK: All ONT modules are ok + ... 4 + ... --warning-traffic-in=1: + ... WARNING: ONT xDSL ANO 2 ANON00000002(414E4F4E00000002) traffic in: 0.00 b/s - ONT DSLAM ANO 3 ANON00000003(414E4F4E00000003) traffic in: 0.00 b/s | 'xDSL ANO 2#ont.traffic.in.bitspersecond'=0.00b/s;1:;;0; 'xDSL ANO 2#ont.traffic.out.bitspersecond'=0.00b/s;;;0; 'ont.packets.up.persecond'=0packets/s;;;0; 'ont.packets.down.persecond'=0packets/s;;;0; 'ont.packets.up.drop.persecond'=0packets/s;;;0; 'ont.packets.down.drop.persecond'=0packets/s;;;0; 'DSLAM ANO 3#ont.traffic.in.bitspersecond'=0.00b/s;1:;;0; 'DSLAM ANO 3#ont.traffic.out.bitspersecond'=0.00b/s;;;0; 'ont.packets.up.persecond'=0packets/s;;;0; 'ont.packets.down.persecond'=0packets/s;;;0; 'ont.packets.up.drop.persecond'=0packets/s;;;0; 'ont.packets.down.drop.persecond'=0packets/s;;;0; + ... 5 + ... --critical-traffic-in=1: + ... CRITICAL: ONT xDSL ANO 1 ANON00000001(414E4F4E00000001) traffic in: 0.00 b/s - ONT xDSL ANO 2 ANON00000002(414E4F4E00000002) traffic in: 0.00 b/s - ONT DSLAM ANO 3 ANON00000003(414E4F4E00000003) traffic in: 0.00 b/s | 'xDSL ANO 1#ont.traffic.in.bitspersecond'=0.00b/s;;1:;0; 'xDSL ANO 1#ont.traffic.out.bitspersecond'=0.00b/s;;;0; 'ont.packets.up.persecond'=0packets/s;;;0; 'ont.packets.down.persecond'=0packets/s;;;0; 'ont.packets.up.drop.persecond'=0packets/s;;;0; 'ont.packets.down.drop.persecond'=0packets/s;;;0; 'xDSL ANO 2#ont.traffic.in.bitspersecond'=0.00b/s;;1:;0; 'xDSL ANO 2#ont.traffic.out.bitspersecond'=0.00b/s;;;0; 'ont.packets.up.persecond'=0packets/s;;;0; 'ont.packets.down.persecond'=0packets/s;;;0; 'ont.packets.up.drop.persecond'=0packets/s;;;0; 'ont.packets.down.drop.persecond'=0packets/s;;;0; 'DSLAM ANO 3#ont.traffic.in.bitspersecond'=0.00b/s;;1:;0; 'DSLAM ANO 3#ont.traffic.out.bitspersecond'=0.00b/s;;;0; 'ont.packets.up.persecond'=0packets/s;;;0; 'ont.packets.down.persecond'=0packets/s;;;0; 'ont.packets.up.drop.persecond'=0packets/s;;;0; 'ont.packets.down.drop.persecond'=0packets/s;;;0; + ... 6 + ... --warning-traffic-out=1: + ... WARNING: ONT xDSL ANO 1 ANON00000001(414E4F4E00000001) traffic out: 0.00 b/s - ONT xDSL ANO 2 ANON00000002(414E4F4E00000002) traffic out: 0.00 b/s - ONT DSLAM ANO 3 ANON00000003(414E4F4E00000003) traffic out: 0.00 b/s | 'xDSL ANO 1#ont.traffic.in.bitspersecond'=0.00b/s;;;0; 'xDSL ANO 1#ont.traffic.out.bitspersecond'=0.00b/s;1:;;0; 'ont.packets.up.persecond'=0packets/s;;;0; 'ont.packets.down.persecond'=0packets/s;;;0; 'ont.packets.up.drop.persecond'=0packets/s;;;0; 'ont.packets.down.drop.persecond'=0packets/s;;;0; 'xDSL ANO 2#ont.traffic.in.bitspersecond'=0.00b/s;;;0; 'xDSL ANO 2#ont.traffic.out.bitspersecond'=0.00b/s;1:;;0; 'ont.packets.up.persecond'=0packets/s;;;0; 'ont.packets.down.persecond'=0packets/s;;;0; 'ont.packets.up.drop.persecond'=0packets/s;;;0; 'ont.packets.down.drop.persecond'=0packets/s;;;0; 'DSLAM ANO 3#ont.traffic.in.bitspersecond'=0.00b/s;;;0; 'DSLAM ANO 3#ont.traffic.out.bitspersecond'=0.00b/s;1:;;0; 'ont.packets.up.persecond'=0packets/s;;;0; 'ont.packets.down.persecond'=0packets/s;;;0; 'ont.packets.up.drop.persecond'=0packets/s;;;0; 'ont.packets.down.drop.persecond'=0packets/s;;;0; + ... 7 + ... --critical-traffic-out=1: + ... CRITICAL: ONT xDSL ANO 1 ANON00000001(414E4F4E00000001) traffic out: 0.00 b/s - ONT xDSL ANO 2 ANON00000002(414E4F4E00000002) traffic out: 0.00 b/s - ONT DSLAM ANO 3 ANON00000003(414E4F4E00000003) traffic out: 0.00 b/s | 'xDSL ANO 1#ont.traffic.in.bitspersecond'=0.00b/s;;;0; 'xDSL ANO 1#ont.traffic.out.bitspersecond'=0.00b/s;;1:;0; 'ont.packets.up.persecond'=0packets/s;;;0; 'ont.packets.down.persecond'=0packets/s;;;0; 'ont.packets.up.drop.persecond'=0packets/s;;;0; 'ont.packets.down.drop.persecond'=0packets/s;;;0; 'xDSL ANO 2#ont.traffic.in.bitspersecond'=0.00b/s;;;0; 'xDSL ANO 2#ont.traffic.out.bitspersecond'=0.00b/s;;1:;0; 'ont.packets.up.persecond'=0packets/s;;;0; 'ont.packets.down.persecond'=0packets/s;;;0; 'ont.packets.up.drop.persecond'=0packets/s;;;0; 'ont.packets.down.drop.persecond'=0packets/s;;;0; 'DSLAM ANO 3#ont.traffic.in.bitspersecond'=0.00b/s;;;0; 'DSLAM ANO 3#ont.traffic.out.bitspersecond'=0.00b/s;;1:;0; 'ont.packets.up.persecond'=0packets/s;;;0; 'ont.packets.down.persecond'=0packets/s;;;0; 'ont.packets.up.drop.persecond'=0packets/s;;;0; 'ont.packets.down.drop.persecond'=0packets/s;;;0; + ... 8 + ... --warning-down-packets=1: + ... WARNING: ONT xDSL ANO 1 ANON00000001(414E4F4E00000001) Down packets (per sec): 0 - ONT xDSL ANO 2 ANON00000002(414E4F4E00000002) Down packets (per sec): 0 - ONT DSLAM ANO 3 ANON00000003(414E4F4E00000003) Down packets (per sec): 0 | 'xDSL ANO 1#ont.traffic.in.bitspersecond'=0.00b/s;;;0; 'xDSL ANO 1#ont.traffic.out.bitspersecond'=0.00b/s;;;0; 'ont.packets.up.persecond'=0packets/s;;;0; 'ont.packets.down.persecond'=0packets/s;1:;;0; 'ont.packets.up.drop.persecond'=0packets/s;;;0; 'ont.packets.down.drop.persecond'=0packets/s;;;0; 'xDSL ANO 2#ont.traffic.in.bitspersecond'=0.00b/s;;;0; 'xDSL ANO 2#ont.traffic.out.bitspersecond'=0.00b/s;;;0; 'ont.packets.up.persecond'=0packets/s;;;0; 'ont.packets.down.persecond'=0packets/s;1:;;0; 'ont.packets.up.drop.persecond'=0packets/s;;;0; 'ont.packets.down.drop.persecond'=0packets/s;;;0; 'DSLAM ANO 3#ont.traffic.in.bitspersecond'=0.00b/s;;;0; 'DSLAM ANO 3#ont.traffic.out.bitspersecond'=0.00b/s;;;0; 'ont.packets.up.persecond'=0packets/s;;;0; 'ont.packets.down.persecond'=0packets/s;1:;;0; 'ont.packets.up.drop.persecond'=0packets/s;;;0; 'ont.packets.down.drop.persecond'=0packets/s;;;0; + ... 9 + ... --critical-down-packets=1: + ... CRITICAL: ONT xDSL ANO 1 ANON00000001(414E4F4E00000001) Down packets (per sec): 0 - ONT xDSL ANO 2 ANON00000002(414E4F4E00000002) Down packets (per sec): 0 - ONT DSLAM ANO 3 ANON00000003(414E4F4E00000003) Down packets (per sec): 0 | 'xDSL ANO 1#ont.traffic.in.bitspersecond'=0.00b/s;;;0; 'xDSL ANO 1#ont.traffic.out.bitspersecond'=0.00b/s;;;0; 'ont.packets.up.persecond'=0packets/s;;;0; 'ont.packets.down.persecond'=0packets/s;;1:;0; 'ont.packets.up.drop.persecond'=0packets/s;;;0; 'ont.packets.down.drop.persecond'=0packets/s;;;0; 'xDSL ANO 2#ont.traffic.in.bitspersecond'=0.00b/s;;;0; 'xDSL ANO 2#ont.traffic.out.bitspersecond'=0.00b/s;;;0; 'ont.packets.up.persecond'=0packets/s;;;0; 'ont.packets.down.persecond'=0packets/s;;1:;0; 'ont.packets.up.drop.persecond'=0packets/s;;;0; 'ont.packets.down.drop.persecond'=0packets/s;;;0; 'DSLAM ANO 3#ont.traffic.in.bitspersecond'=0.00b/s;;;0; 'DSLAM ANO 3#ont.traffic.out.bitspersecond'=0.00b/s;;;0; 'ont.packets.up.persecond'=0packets/s;;;0; 'ont.packets.down.persecond'=0packets/s;;1:;0; 'ont.packets.up.drop.persecond'=0packets/s;;;0; 'ont.packets.down.drop.persecond'=0packets/s;;;0; + ... 10 + ... --warning-up-packets=1: + ... WARNING: ONT xDSL ANO 1 ANON00000001(414E4F4E00000001) Up packets (per sec): 0 - ONT xDSL ANO 2 ANON00000002(414E4F4E00000002) Up packets (per sec): 0 - ONT DSLAM ANO 3 ANON00000003(414E4F4E00000003) Up packets (per sec): 0 | 'xDSL ANO 1#ont.traffic.in.bitspersecond'=0.00b/s;;;0; 'xDSL ANO 1#ont.traffic.out.bitspersecond'=0.00b/s;;;0; 'ont.packets.up.persecond'=0packets/s;1:;;0; 'ont.packets.down.persecond'=0packets/s;;;0; 'ont.packets.up.drop.persecond'=0packets/s;;;0; 'ont.packets.down.drop.persecond'=0packets/s;;;0; 'xDSL ANO 2#ont.traffic.in.bitspersecond'=0.00b/s;;;0; 'xDSL ANO 2#ont.traffic.out.bitspersecond'=0.00b/s;;;0; 'ont.packets.up.persecond'=0packets/s;1:;;0; 'ont.packets.down.persecond'=0packets/s;;;0; 'ont.packets.up.drop.persecond'=0packets/s;;;0; 'ont.packets.down.drop.persecond'=0packets/s;;;0; 'DSLAM ANO 3#ont.traffic.in.bitspersecond'=0.00b/s;;;0; 'DSLAM ANO 3#ont.traffic.out.bitspersecond'=0.00b/s;;;0; 'ont.packets.up.persecond'=0packets/s;1:;;0; 'ont.packets.down.persecond'=0packets/s;;;0; 'ont.packets.up.drop.persecond'=0packets/s;;;0; 'ont.packets.down.drop.persecond'=0packets/s;;;0; + ... 11 + ... --critical-up-packets=1: + ... CRITICAL: ONT xDSL ANO 1 ANON00000001(414E4F4E00000001) Up packets (per sec): 0 - ONT xDSL ANO 2 ANON00000002(414E4F4E00000002) Up packets (per sec): 0 - ONT DSLAM ANO 3 ANON00000003(414E4F4E00000003) Up packets (per sec): 0 | 'xDSL ANO 1#ont.traffic.in.bitspersecond'=0.00b/s;;;0; 'xDSL ANO 1#ont.traffic.out.bitspersecond'=0.00b/s;;;0; 'ont.packets.up.persecond'=0packets/s;;1:;0; 'ont.packets.down.persecond'=0packets/s;;;0; 'ont.packets.up.drop.persecond'=0packets/s;;;0; 'ont.packets.down.drop.persecond'=0packets/s;;;0; 'xDSL ANO 2#ont.traffic.in.bitspersecond'=0.00b/s;;;0; 'xDSL ANO 2#ont.traffic.out.bitspersecond'=0.00b/s;;;0; 'ont.packets.up.persecond'=0packets/s;;1:;0; 'ont.packets.down.persecond'=0packets/s;;;0; 'ont.packets.up.drop.persecond'=0packets/s;;;0; 'ont.packets.down.drop.persecond'=0packets/s;;;0; 'DSLAM ANO 3#ont.traffic.in.bitspersecond'=0.00b/s;;;0; 'DSLAM ANO 3#ont.traffic.out.bitspersecond'=0.00b/s;;;0; 'ont.packets.up.persecond'=0packets/s;;1:;0; 'ont.packets.down.persecond'=0packets/s;;;0; 'ont.packets.up.drop.persecond'=0packets/s;;;0; 'ont.packets.down.drop.persecond'=0packets/s;;;0; + ... 12 + ... --warning-up-drop-packets=1: + ... WARNING: ONT xDSL ANO 1 ANON00000001(414E4F4E00000001) Up dropped packets (per sec): 0 - ONT xDSL ANO 2 ANON00000002(414E4F4E00000002) Up dropped packets (per sec): 0 - ONT DSLAM ANO 3 ANON00000003(414E4F4E00000003) Up dropped packets (per sec): 0 | 'xDSL ANO 1#ont.traffic.in.bitspersecond'=0.00b/s;;;0; 'xDSL ANO 1#ont.traffic.out.bitspersecond'=0.00b/s;;;0; 'ont.packets.up.persecond'=0packets/s;;;0; 'ont.packets.down.persecond'=0packets/s;;;0; 'ont.packets.up.drop.persecond'=0packets/s;1:;;0; 'ont.packets.down.drop.persecond'=0packets/s;;;0; 'xDSL ANO 2#ont.traffic.in.bitspersecond'=0.00b/s;;;0; 'xDSL ANO 2#ont.traffic.out.bitspersecond'=0.00b/s;;;0; 'ont.packets.up.persecond'=0packets/s;;;0; 'ont.packets.down.persecond'=0packets/s;;;0; 'ont.packets.up.drop.persecond'=0packets/s;1:;;0; 'ont.packets.down.drop.persecond'=0packets/s;;;0; 'DSLAM ANO 3#ont.traffic.in.bitspersecond'=0.00b/s;;;0; 'DSLAM ANO 3#ont.traffic.out.bitspersecond'=0.00b/s;;;0; 'ont.packets.up.persecond'=0packets/s;;;0; 'ont.packets.down.persecond'=0packets/s;;;0; 'ont.packets.up.drop.persecond'=0packets/s;1:;;0; 'ont.packets.down.drop.persecond'=0packets/s;;;0; + ... 13 + ... --critical-up-drop-packets=1: + ... CRITICAL: ONT xDSL ANO 1 ANON00000001(414E4F4E00000001) Up dropped packets (per sec): 0 - ONT xDSL ANO 2 ANON00000002(414E4F4E00000002) Up dropped packets (per sec): 0 - ONT DSLAM ANO 3 ANON00000003(414E4F4E00000003) Up dropped packets (per sec): 0 | 'xDSL ANO 1#ont.traffic.in.bitspersecond'=0.00b/s;;;0; 'xDSL ANO 1#ont.traffic.out.bitspersecond'=0.00b/s;;;0; 'ont.packets.up.persecond'=0packets/s;;;0; 'ont.packets.down.persecond'=0packets/s;;;0; 'ont.packets.up.drop.persecond'=0packets/s;;1:;0; 'ont.packets.down.drop.persecond'=0packets/s;;;0; 'xDSL ANO 2#ont.traffic.in.bitspersecond'=0.00b/s;;;0; 'xDSL ANO 2#ont.traffic.out.bitspersecond'=0.00b/s;;;0; 'ont.packets.up.persecond'=0packets/s;;;0; 'ont.packets.down.persecond'=0packets/s;;;0; 'ont.packets.up.drop.persecond'=0packets/s;;1:;0; 'ont.packets.down.drop.persecond'=0packets/s;;;0; 'DSLAM ANO 3#ont.traffic.in.bitspersecond'=0.00b/s;;;0; 'DSLAM ANO 3#ont.traffic.out.bitspersecond'=0.00b/s;;;0; 'ont.packets.up.persecond'=0packets/s;;;0; 'ont.packets.down.persecond'=0packets/s;;;0; 'ont.packets.up.drop.persecond'=0packets/s;;1:;0; 'ont.packets.down.drop.persecond'=0packets/s;;;0; + ... 14 + ... --warning-down-drop-packets=1: + ... WARNING: ONT xDSL ANO 1 ANON00000001(414E4F4E00000001) Down drop packets (per sec): 0 - ONT xDSL ANO 2 ANON00000002(414E4F4E00000002) Down drop packets (per sec): 0 - ONT DSLAM ANO 3 ANON00000003(414E4F4E00000003) Down drop packets (per sec): 0 | 'xDSL ANO 1#ont.traffic.in.bitspersecond'=0.00b/s;;;0; 'xDSL ANO 1#ont.traffic.out.bitspersecond'=0.00b/s;;;0; 'ont.packets.up.persecond'=0packets/s;;;0; 'ont.packets.down.persecond'=0packets/s;;;0; 'ont.packets.up.drop.persecond'=0packets/s;;;0; 'ont.packets.down.drop.persecond'=0packets/s;1:;;0; 'xDSL ANO 2#ont.traffic.in.bitspersecond'=0.00b/s;;;0; 'xDSL ANO 2#ont.traffic.out.bitspersecond'=0.00b/s;;;0; 'ont.packets.up.persecond'=0packets/s;;;0; 'ont.packets.down.persecond'=0packets/s;;;0; 'ont.packets.up.drop.persecond'=0packets/s;;;0; 'ont.packets.down.drop.persecond'=0packets/s;1:;;0; 'DSLAM ANO 3#ont.traffic.in.bitspersecond'=0.00b/s;;;0; 'DSLAM ANO 3#ont.traffic.out.bitspersecond'=0.00b/s;;;0; 'ont.packets.up.persecond'=0packets/s;;;0; 'ont.packets.down.persecond'=0packets/s;;;0; 'ont.packets.up.drop.persecond'=0packets/s;;;0; 'ont.packets.down.drop.persecond'=0packets/s;1:;;0; + ... 15 + ... --critical-down-drop-packets=1: + ... CRITICAL: ONT xDSL ANO 1 ANON00000001(414E4F4E00000001) Down drop packets (per sec): 0 - ONT xDSL ANO 2 ANON00000002(414E4F4E00000002) Down drop packets (per sec): 0 - ONT DSLAM ANO 3 ANON00000003(414E4F4E00000003) Down drop packets (per sec): 0 | 'xDSL ANO 1#ont.traffic.in.bitspersecond'=0.00b/s;;;0; 'xDSL ANO 1#ont.traffic.out.bitspersecond'=0.00b/s;;;0; 'ont.packets.up.persecond'=0packets/s;;;0; 'ont.packets.down.persecond'=0packets/s;;;0; 'ont.packets.up.drop.persecond'=0packets/s;;;0; 'ont.packets.down.drop.persecond'=0packets/s;;1:;0; 'xDSL ANO 2#ont.traffic.in.bitspersecond'=0.00b/s;;;0; 'xDSL ANO 2#ont.traffic.out.bitspersecond'=0.00b/s;;;0; 'ont.packets.up.persecond'=0packets/s;;;0; 'ont.packets.down.persecond'=0packets/s;;;0; 'ont.packets.up.drop.persecond'=0packets/s;;;0; 'ont.packets.down.drop.persecond'=0packets/s;;1:;0; 'DSLAM ANO 3#ont.traffic.in.bitspersecond'=0.00b/s;;;0; 'DSLAM ANO 3#ont.traffic.out.bitspersecond'=0.00b/s;;;0; 'ont.packets.up.persecond'=0packets/s;;;0; 'ont.packets.down.persecond'=0packets/s;;;0; 'ont.packets.up.drop.persecond'=0packets/s;;;0; 'ont.packets.down.drop.persecond'=0packets/s;;1:;0; diff --git a/tests/network/huawei/standard/snmp/huawei-gpon.snmpwalk b/tests/network/huawei/standard/snmp/huawei-gpon.snmpwalk new file mode 100644 index 0000000000..0816e88982 --- /dev/null +++ b/tests/network/huawei/standard/snmp/huawei-gpon.snmpwalk @@ -0,0 +1,51 @@ +.1.3.6.1.4.1.2011.6.128.1.1.2.43.1.3.4194312192.1 = Hex-STRING: 41 4E 4F 4E 00 00 00 01 +.1.3.6.1.4.1.2011.6.128.1.1.2.43.1.3.4194312192.2 = Hex-STRING: 41 4E 4F 4E 00 00 00 02 +.1.3.6.1.4.1.2011.6.128.1.1.2.43.1.3.4194312192.3 = Hex-STRING: 41 4E 4F 4E 00 00 00 03 +.1.3.6.1.4.1.2011.6.128.1.1.2.43.1.9.4194312192.1 = STRING: "xDSL ANO 1" +.1.3.6.1.4.1.2011.6.128.1.1.2.43.1.9.4194312192.2 = STRING: "xDSL ANO 2" +.1.3.6.1.4.1.2011.6.128.1.1.2.43.1.9.4194312192.3 = STRING: "DSLAM ANO 3" +.1.3.6.1.4.1.2011.6.128.1.1.2.43.1.10.4194312192.1 = INTEGER: 1 +.1.3.6.1.4.1.2011.6.128.1.1.2.43.1.10.4194312192.2 = INTEGER: 3 +.1.3.6.1.4.1.2011.6.128.1.1.2.43.1.10.4194312192.3 = INTEGER: 1 +.1.3.6.1.4.1.2011.6.128.1.1.2.51.1.1.4194312192.1 = INTEGER: 41 +.1.3.6.1.4.1.2011.6.128.1.1.2.51.1.1.4194312192.2 = INTEGER: 31 +.1.3.6.1.4.1.2011.6.128.1.1.2.51.1.1.4194312192.3 = INTEGER: 51 +.1.3.6.1.4.1.2011.6.128.1.1.2.51.1.2.4194312192.1 = INTEGER: 19 +.1.3.6.1.4.1.2011.6.128.1.1.2.51.1.2.4194312192.2 = INTEGER: 14 +.1.3.6.1.4.1.2011.6.128.1.1.2.51.1.2.4194312192.3 = INTEGER: 17 +.1.3.6.1.4.1.2011.6.128.1.1.2.51.1.3.4194312192.1 = INTEGER: 213 +.1.3.6.1.4.1.2011.6.128.1.1.2.51.1.3.4194312192.2 = INTEGER: 216 +.1.3.6.1.4.1.2011.6.128.1.1.2.51.1.3.4194312192.3 = INTEGER: 273 +.1.3.6.1.4.1.2011.6.128.1.1.2.51.1.4.4194312192.1 = INTEGER: -1414 +.1.3.6.1.4.1.2011.6.128.1.1.2.51.1.4.4194312192.2 = INTEGER: -1565 +.1.3.6.1.4.1.2011.6.128.1.1.2.51.1.4.4194312192.3 = INTEGER: -1464 +.1.3.6.1.4.1.2011.6.128.1.1.2.51.1.5.4194312192.1 = INTEGER: 3220 +.1.3.6.1.4.1.2011.6.128.1.1.2.51.1.5.4194312192.2 = INTEGER: 3300 +.1.3.6.1.4.1.2011.6.128.1.1.2.51.1.5.4194312192.3 = INTEGER: 3340 +.1.3.6.1.4.1.2011.6.128.1.1.2.51.1.6.4194312192.1 = INTEGER: 8064 +.1.3.6.1.4.1.2011.6.128.1.1.2.51.1.6.4194312192.2 = INTEGER: 8029 +.1.3.6.1.4.1.2011.6.128.1.1.2.51.1.6.4194312192.3 = INTEGER: 8143 +.1.3.6.1.4.1.2011.6.128.1.1.2.62.1.4.4194312192.1.1 = INTEGER: 5 +.1.3.6.1.4.1.2011.6.128.1.1.2.62.1.4.4194312192.2.1 = INTEGER: 6 +.1.3.6.1.4.1.2011.6.128.1.1.2.62.1.4.4194312192.3.1 = INTEGER: 7 +.1.3.6.1.4.1.2011.6.128.1.1.2.62.1.22.4194312192.1.1 = INTEGER: 1 +.1.3.6.1.4.1.2011.6.128.1.1.2.62.1.22.4194312192.2.1 = INTEGER: 2 +.1.3.6.1.4.1.2011.6.128.1.1.2.62.1.22.4194312192.3.1 = INTEGER: 1 +.1.3.6.1.4.1.2011.6.128.1.1.4.23.1.1.4194312192.1 = Counter64: 436843050 +.1.3.6.1.4.1.2011.6.128.1.1.4.23.1.1.4194312192.2 = Counter64: 998208449 +.1.3.6.1.4.1.2011.6.128.1.1.4.23.1.1.4194312192.3 = Counter64: 3678001197 +.1.3.6.1.4.1.2011.6.128.1.1.4.23.1.2.4194312192.1 = Counter64: 763682981 +.1.3.6.1.4.1.2011.6.128.1.1.4.23.1.2.4194312192.2 = Counter64: 1728887925 +.1.3.6.1.4.1.2011.6.128.1.1.4.23.1.2.4194312192.3 = Counter64: 9205300844 +.1.3.6.1.4.1.2011.6.128.1.1.4.23.1.3.4194312192.1 = Counter64: 136888321822 +.1.3.6.1.4.1.2011.6.128.1.1.4.23.1.3.4194312192.2 = Counter64: 347104932968 +.1.3.6.1.4.1.2011.6.128.1.1.4.23.1.3.4194312192.3 = Counter64: 1121587301106 +.1.3.6.1.4.1.2011.6.128.1.1.4.23.1.4.4194312192.1 = Counter64: 722546186186 +.1.3.6.1.4.1.2011.6.128.1.1.4.23.1.4.4194312192.2 = Counter64: 1616996021246 +.1.3.6.1.4.1.2011.6.128.1.1.4.23.1.4.4194312192.3 = Counter64: 11743711188810 +.1.3.6.1.4.1.2011.6.128.1.1.4.23.1.5.4194312192.1 = Counter64: 0 +.1.3.6.1.4.1.2011.6.128.1.1.4.23.1.5.4194312192.2 = Counter64: 0 +.1.3.6.1.4.1.2011.6.128.1.1.4.23.1.5.4194312192.3 = Counter64: 0 +.1.3.6.1.4.1.2011.6.128.1.1.4.23.1.6.4194312192.1 = Counter64: 3654477 +.1.3.6.1.4.1.2011.6.128.1.1.4.23.1.6.4194312192.2 = Counter64: 3654499 +.1.3.6.1.4.1.2011.6.128.1.1.4.23.1.6.4194312192.3 = Counter64: 6041391 diff --git a/tests/network/huawei/standard/snmp/list-gpon-ont.robot b/tests/network/huawei/standard/snmp/list-gpon-ont.robot new file mode 100644 index 0000000000..01d8611092 --- /dev/null +++ b/tests/network/huawei/standard/snmp/list-gpon-ont.robot @@ -0,0 +1,57 @@ +*** Settings *** +Documentation network::huawei::standard::snmp::plugin + +Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource + +Suite Setup Ctn Generic Suite Setup +Suite Teardown Ctn Generic Suite Teardown +Test Timeout 120s + + +*** Variables *** +${CMD} ${CENTREON_PLUGINS} +... --plugin=network::huawei::standard::snmp::plugin +... --mode=list-gpon-ont +... --hostname=${HOSTNAME} +... --snmp-port=${SNMPPORT} +... --snmp-community=network/huawei/standard/snmp/huawei-gpon + + +*** Test Cases *** +List-gpon-ont ${tc} + [Tags] network huawei snmp + ${command} Catenate + ... ${CMD} + ... ${extra_options} + + Ctn Run Command And Check Result As Strings ${command} ${expected_result} + + Examples: + ... tc + ... extra_options + ... expected_result + ... -- + ... 1 + ... ${EMPTY} + ... List ONT: [Name = DSLAM ANO 3] [Serial = ANON00000003] [Serial Hex = 414E4F4E00000003] [State = active] [Name = xDSL ANO 1] [Serial = ANON00000001] [Serial Hex = 414E4F4E00000001] [State = active] [Name = xDSL ANO 2] [Serial = ANON00000002] [Serial Hex = 414E4F4E00000002] [State = notReady] + ... 2 + ... --include-name='xDSL ANO 1' + ... List ONT: [Name = xDSL ANO 1] [Serial = ANON00000001] [Serial Hex = 414E4F4E00000001] [State = active] + ... 3 + ... --exclude-name='xDSL ANO' + ... List ONT: [Name = DSLAM ANO 3] [Serial = ANON00000003] [Serial Hex = 414E4F4E00000003] [State = active] + ... 4 + ... --include-serial='ANON00000003' + ... List ONT: [Name = DSLAM ANO 3] [Serial = ANON00000003] [Serial Hex = 414E4F4E00000003] [State = active] + ... 5 + ... --exclude-serial='ANON00000003' + ... List ONT: [Name = xDSL ANO 1] [Serial = ANON00000001] [Serial Hex = 414E4F4E00000001] [State = active] [Name = xDSL ANO 2] [Serial = ANON00000002] [Serial Hex = 414E4F4E00000002] [State = notReady] + ... 6 + ... --include-status='notReady' + ... List ONT: [Name = xDSL ANO 2] [Serial = ANON00000002] [Serial Hex = 414E4F4E00000002] [State = notReady] + ... 7 + ... --exclude-status='active' --disco-show + ... + ... 8 + ... --disco-format + ... name serial serial_hex state diff --git a/tests/resources/spellcheck/stopwords.txt b/tests/resources/spellcheck/stopwords.txt index f9a47607e4..a788a32199 100644 --- a/tests/resources/spellcheck/stopwords.txt +++ b/tests/resources/spellcheck/stopwords.txt @@ -122,6 +122,7 @@ frsevent FSx GCP --get-param +GPON GraphQL GRAPHQL HAProxy @@ -254,6 +255,7 @@ OID --oid-filter OIDs okta +OLT oneaccess-sys-mib OneAPI OpenMetrics