Ctor 460 teldat snmp cells radio (#5102)

Co-authored-by: garnier-quentin <garnier.quentin@gmail.com>
Co-authored-by: Lucie Dubrunfaut <ldubrunfaut@CNTR-PORT-A198>
Co-authored-by: omercier <32134301+omercier@users.noreply.github.com>
Co-authored-by: omercier <omercier@centreon.com>
REFS: CTOR-460
This commit is contained in:
Lucie Dubrunfaut 2024-08-05 15:34:09 +02:00 committed by GitHub
parent 475d8f5a69
commit a75641aaf3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 1145 additions and 1348 deletions

View File

@ -1,346 +1,367 @@
# #
# Copyright 2024 Centreon (http://www.centreon.com/) # Copyright 2024 Centreon (http://www.centreon.com/)
# #
# Centreon is a full-fledged industry-strength solution that meets # Centreon is a full-fledged industry-strength solution that meets
# the needs in IT infrastructure and application monitoring for # the needs in IT infrastructure and application monitoring for
# service performance. # service performance.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at
# #
# http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
# #
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, # distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# #
package network::teldat::snmp::mode::cellsradio; package network::teldat::snmp::mode::cellsradio;
use base qw(centreon::plugins::templates::counter); use base qw(centreon::plugins::templates::counter);
use strict; use strict;
use warnings; use warnings;
use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold_ng); use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold_ng);
sub custom_signal_perfdata { sub custom_signal_perfdata {
my ($self) = @_; my ($self) = @_;
my $instances = []; my $instances = [];
foreach (@{$self->{instance_mode}->{custom_perfdata_instances}}) { foreach (@{$self->{instance_mode}->{custom_perfdata_instances}}) {
push @$instances, $self->{result_values}->{$_}; push @$instances, $self->{result_values}->{$_};
} }
$self->{output}->perfdata_add( $self->{output}->perfdata_add(
nlabel => $self->{nlabel}, nlabel => $self->{nlabel},
instances => $instances, instances => $instances,
value => $self->{result_values}->{ $self->{key_values}->[0]->{name} }, value => $self->{result_values}->{ $self->{key_values}->[0]->{name} },
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{thlabel}), warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{thlabel}),
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{thlabel}), critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{thlabel}),
min => 0 min => 0
); );
} }
sub custom_status_output { sub custom_status_output {
my ($self, %options) = @_; my ($self, %options) = @_;
return sprintf( return sprintf(
'sim status: %s [imsi: %s] [interface state: %s]', 'sim status: %s [operator: %s] [imsi: %s] [interface state: %s] [simIcc: %s]',
$self->{result_values}->{simStatus}, $self->{result_values}->{simStatus},
$self->{result_values}->{imsi}, $self->{result_values}->{operator},
$self->{result_values}->{interfaceState} $self->{result_values}->{imsi},
); $self->{result_values}->{interfaceState},
} $self->{result_values}->{simIcc}
);
sub cell_long_output { }
my ($self, %options) = @_;
sub cell_long_output {
return sprintf( my ($self, %options) = @_;
"checking cellular radio module '%s' [sim icc: %s, operator: %s]",
$options{instance_value}->{cellId}, return sprintf(
$options{instance_value}->{simIcc}, "checking cellular radio module '%s' interface '%s' [imei: %s] ",
$options{instance_value}->{operator} $options{instance_value}->{module_num},
); $options{instance_value}->{interfaceType},
} $options{instance_value}->{imei}
);
sub prefix_cell_output { }
my ($self, %options) = @_;
sub prefix_cell_output {
return sprintf( my ($self, %options) = @_;
"cellular radio module '%s' [sim icc: %s, operator: %s] ",
$options{instance_value}->{cellId}, return sprintf(
$options{instance_value}->{simIcc}, "cellular radio module '%s' interface '%s' [imei: %s] ",
$options{instance_value}->{operator} $options{instance_value}->{module_num},
); $options{instance_value}->{interfaceType},
} $options{instance_value}->{imei}
);
sub prefix_global_output { }
my ($self, %options) = @_;
sub prefix_global_output {
return 'Number of cellular radio modules '; my ($self, %options) = @_;
}
return 'Number of cellular radio interfaces';
sub set_counters { }
my ($self, %options) = @_;
sub set_counters {
$self->{maps_counters_type} = [ my ($self, %options) = @_;
{ name => 'global', type => 0, cb_prefix_output => 'prefix_global_output' },
{ name => 'cells', type => 3, cb_prefix_output => 'prefix_cell_output', cb_long_output => 'cell_long_output', $self->{maps_counters_type} = [
indent_long_output => ' ', message_multiple => 'All cellular radio modules are ok', { name => 'global', type => 0, cb_prefix_output => 'prefix_global_output' },
group => [ { name => 'cells', type => 3, cb_prefix_output => 'prefix_cell_output', cb_long_output => 'cell_long_output',
{ name => 'status', type => 0, skipped_code => { -10 => 1 } }, indent_long_output => ' ', message_multiple => 'All cellular radio interfaces are ok',
{ name => 'signal', type => 0, skipped_code => { -10 => 1 } } group => [
] { name => 'status', type => 0, skipped_code => { -10 => 1 } },
} { name => 'signal', type => 0, skipped_code => { -10 => 1 } }
]; ]
}
$self->{maps_counters}->{global} = [ ];
{ label => 'modules-cellradio-detected', display_ok => 0, nlabel => 'modules.cellradio.detected.count', set => {
key_values => [ { name => 'detected' } ], $self->{maps_counters}->{global} = [
output_template => 'detected: %s', { label => 'modules-cellradio-detected', display_ok => 0, nlabel => 'modules.cellradio.detected.count', set => {
perfdatas => [ key_values => [ { name => 'detected' } ],
{ template => '%s', min => 0, label_extra_instance => 1, instance_use => 'name'} output_template => 'detected: %s',
] perfdatas => [
} { template => '%s', min => 0 }
} ]
]; }
}
$self->{maps_counters}->{status} = [ ];
{
label => 'status', $self->{maps_counters}->{status} = [
type => 2, {
warning_default => '%{interfaceState} =~ /disconnect/', label => 'status',
critical_default => '%{simStatus} =~ /LOCKED/ || %{simStatus} =~ /DETECTING/', type => 2,
set => { warning_default => '%{interfaceState} =~ /disconnect/ && %{interfaceType} =~ /data primary/',
key_values => [ set => {
{ name => 'cellId' }, { name => 'operator' }, { name => 'imsi' }, { name => 'simIcc' }, key_values => [
{ name => 'simStatus' }, { name => 'interfaceState' } { name => 'module' }, { name => 'interfaceType' }, { name => 'imei' }, { name => 'simIcc' },
], { name => 'operator' }, { name => 'imsi' },
closure_custom_output => $self->can('custom_status_output'), { name => 'simStatus' }, { name => 'interfaceState' }
closure_custom_perfdata => sub { return 0; }, ],
closure_custom_threshold_check => \&catalog_status_threshold_ng closure_custom_output => $self->can('custom_status_output'),
} closure_custom_perfdata => sub { return 0; },
} closure_custom_threshold_check => \&catalog_status_threshold_ng
]; }
}
$self->{maps_counters}->{signal} = [ ];
{ label => 'module-cellradio-rsrp', nlabel => 'module.cellradio.rsrp.dbm', set => {
key_values => [ { name => 'rsrp' }, { name => 'cellId' }, { name => 'simIcc' }, { name => 'operator' } ], $self->{maps_counters}->{signal} = [
output_template => 'rsrp: %s dBm', { label => 'module-cellradio-rsrp', nlabel => 'module.cellradio.rsrp.dbm', set => {
closure_custom_perfdata => $self->can('custom_signal_perfdata') key_values => [ { name => 'rsrp' }, { name => 'module' }, { name => 'interfaceType' }, { name => 'imei' }, { name => 'simIcc' }, { name => 'operator' } ],
} output_template => 'rsrp: %s dBm',
}, closure_custom_perfdata => $self->can('custom_signal_perfdata')
{ label => 'module-cellradio-rsrq', nlabel => 'module.cellradio.rsrq.dbm', set => { }
key_values => [ { name => 'rsrq' }, { name => 'cellId' }, { name => 'simIcc' }, { name => 'operator' } ], },
output_template => 'rsrq: %s dBm', { label => 'module-cellradio-rsrq', nlabel => 'module.cellradio.rsrq.dbm', set => {
closure_custom_perfdata => $self->can('custom_signal_perfdata') key_values => [ { name => 'rsrq' }, { name => 'module' }, { name => 'interfaceType' }, { name => 'imei' }, { name => 'simIcc' }, { name => 'operator' } ],
} output_template => 'rsrq: %s dBm',
}, closure_custom_perfdata => $self->can('custom_signal_perfdata')
{ label => 'module-cellradio-snr', nlabel => 'module.cellradio.snr.db', set => { }
key_values => [ { name => 'snr' }, { name => 'cellId' }, { name => 'simIcc' }, { name => 'operator' } ], },
output_template => 'snr: %s dB', { label => 'module-cellradio-snr', nlabel => 'module.cellradio.snr.db', set => {
closure_custom_perfdata => $self->can('custom_signal_perfdata') key_values => [ { name => 'snr' }, { name => 'module' }, { name => 'interfaceType' }, { name => 'imei' }, { name => 'simIcc' }, { name => 'operator' } ],
} output_template => 'snr: %s dB',
}, closure_custom_perfdata => $self->can('custom_signal_perfdata')
{ label => 'module-cellradio-rscp', nlabel => 'module.cellradio.rscp.dbm', set => { }
key_values => [ { name => 'rscp' }, { name => 'cellId' }, { name => 'simIcc' }, { name => 'operator' } ], },
output_template => 'rscp: %s dBm', { label => 'module-cellradio-rscp', nlabel => 'module.cellradio.rscp.dbm', set => {
closure_custom_perfdata => $self->can('custom_signal_perfdata') key_values => [ { name => 'rscp' }, { name => 'module' }, { name => 'interfaceType' }, { name => 'imei' }, { name => 'simIcc' }, { name => 'operator' } ],
} output_template => 'rscp: %s dBm',
}, closure_custom_perfdata => $self->can('custom_signal_perfdata')
{ label => 'module-cellradio-csq', nlabel => 'module.cellradio.csq.dbm', set => { }
key_values => [ { name => 'csq' }, { name => 'cellId' }, { name => 'simIcc' }, { name => 'operator' } ], },
output_template => 'csq: %s dBm', { label => 'module-cellradio-csq', nlabel => 'module.cellradio.csq.dbm', set => {
closure_custom_perfdata => $self->can('custom_signal_perfdata') key_values => [ { name => 'csq' }, { name => 'module' }, { name => 'interfaceType' }, { name => 'imei' }, { name => 'simIcc' }, { name => 'operator' } ],
} output_template => 'csq: %s dBm',
} closure_custom_perfdata => $self->can('custom_signal_perfdata')
]; }
} }
];
sub new { }
my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1); sub new {
bless $self, $class; my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1);
$options{options}->add_options(arguments => { bless $self, $class;
'filter-cell-id:s' => { name => 'filter_cell_id' },
'custom-perfdata-instances:s' => { name => 'custom_perfdata_instances' } $options{options}->add_options(arguments => {
}); 'filter-module:s' => { name => 'filter_module' },
'filter-imei:s' => { name => 'filter_imei' },
return $self; 'filter-interface-type:s' => { name => 'filter_interface_type' },
} 'custom-perfdata-instances:s' => { name => 'custom_perfdata_instances' }
});
sub check_options {
my ($self, %options) = @_; return $self;
$self->SUPER::check_options(%options); }
if (!defined($self->{option_results}->{custom_perfdata_instances}) || $self->{option_results}->{custom_perfdata_instances} eq '') { sub check_options {
$self->{option_results}->{custom_perfdata_instances} = '%(cellId) %(operator)'; my ($self, %options) = @_;
} $self->SUPER::check_options(%options);
$self->{custom_perfdata_instances} = $self->custom_perfdata_instances( if (!defined($self->{option_results}->{custom_perfdata_instances}) || $self->{option_results}->{custom_perfdata_instances} eq '') {
option_name => '--custom-perfdata-instances', $self->{option_results}->{custom_perfdata_instances} = '%(module) %(interfaceType) %(imei)';
instances => $self->{option_results}->{custom_perfdata_instances}, }
labels => { cellId => 1, operator => 1, simIcc => 1}
); $self->{custom_perfdata_instances} = $self->custom_perfdata_instances(
} option_name => '--custom-perfdata-instances',
instances => $self->{option_results}->{custom_perfdata_instances},
my $mapping_info_interface = { labels => { module => 1, interfaceType => 1, imei => 1, imsi => 1, operator => 1, simIcc => 1}
imei => { oid => '.1.3.6.1.4.1.2007.4.1.2.2.2.18.1.1.5' }, # teldatCellularInfoInterfaceModuleIMEI : Cellular module IMEI. );
imsi => { oid => '.1.3.6.1.4.1.2007.4.1.2.2.2.18.1.1.6' }, # teldatCellularInfoInterfaceModuleIMSI : Cellular module IMSI. }
simIcc => { oid => '.1.3.6.1.4.1.2007.4.1.2.2.2.18.1.1.8' }, # teldatCellularInfoInterfaceSIMIcc : Cellular active SIM ICC.
}; my $mapping_info_interface = {
imei => { oid => '.1.3.6.1.4.1.2007.4.1.2.2.2.18.1.1.5' }, # teldatCellularInfoInterfaceModuleIMEI : Cellular module IMEI.
my $mapping_state_interface = { imsi => { oid => '.1.3.6.1.4.1.2007.4.1.2.2.2.18.1.1.6' }, # teldatCellularInfoInterfaceModuleIMSI : Cellular module IMSI.
interfaceState => { oid => '.1.3.6.1.4.1.2007.4.1.2.2.2.18.3.1.1.2' } # teldatCellularStateInterfaceState : Call state. simIcc => { oid => '.1.3.6.1.4.1.2007.4.1.2.2.2.18.1.1.8' } # teldatCellularInfoInterfaceSIMIcc : Cellular active SIM ICC.
}; };
my $mapping_state_mobile = { my $mapping_data_interface = {
techno => { oid => '.1.3.6.1.4.1.2007.4.1.2.2.2.18.3.2.1.6' }, # teldatCellularStateMobileRadioTechnology : Cellular mobile current radio access tecnology used (!GETRAT). interfaceState => { oid => '.1.3.6.1.4.1.2007.4.1.2.2.2.18.3.1.1.2' }, # teldatCellularStateInterfaceState : Call state.
rscp => { oid => '.1.3.6.1.4.1.2007.4.1.2.2.2.18.3.2.1.8' }, # teldatCellularStateMobileRxSignalCodePwr : Cellular mobile received signal code power (RSCP). techno => { oid => '.1.3.6.1.4.1.2007.4.1.2.2.2.18.3.2.1.6' }, # teldatCellularStateMobileRadioTechnology : Cellular mobile current radio access tecnology used (!GETRAT).
csq => { oid => '.1.3.6.1.4.1.2007.4.1.2.2.2.18.3.2.1.10' }, # teldatCellularStateMobileSignalQuality : Cellular mobile reception signal quality (+CSQ). rscp => { oid => '.1.3.6.1.4.1.2007.4.1.2.2.2.18.3.2.1.8' }, # teldatCellularStateMobileRxSignalCodePwr : Cellular mobile received signal code power (RSCP).
rsrp => { oid => '.1.3.6.1.4.1.2007.4.1.2.2.2.18.3.2.1.22' }, # teldatCellularStateMobileRxRSRP : Cellular mobile reference symbol received power (RSRP). csq => { oid => '.1.3.6.1.4.1.2007.4.1.2.2.2.18.3.2.1.10' }, # teldatCellularStateMobileSignalQuality : Cellular mobile reception signal quality (+CSQ).
rsrq => { oid => '.1.3.6.1.4.1.2007.4.1.2.2.2.18.3.2.1.23' }, # teldatCellularStateMobileRxRSRQ : Cellular mobile reference signal received quality (RSRQ). rsrp => { oid => '.1.3.6.1.4.1.2007.4.1.2.2.2.18.3.2.1.22' }, # teldatCellularStateMobileRxRSRP : Cellular mobile reference symbol received power (RSRP).
snr => { oid => '.1.3.6.1.4.1.2007.4.1.2.2.2.18.3.2.1.24' }, # teldatCellularStateMobileRxSINR : Cellular mobile signal versus noise ratio (SINR). rsrq => { oid => '.1.3.6.1.4.1.2007.4.1.2.2.2.18.3.2.1.23' }, # teldatCellularStateMobileRxRSRQ : Cellular mobile reference signal received quality (RSRQ).
simStatus => { oid => '.1.3.6.1.4.1.2007.4.1.2.2.2.18.3.2.1.26' } # teldatCellularStateMobileSIMStatus : Cellular mobile SIM status. snr => { oid => '.1.3.6.1.4.1.2007.4.1.2.2.2.18.3.2.1.24' }, # teldatCellularStateMobileRxSINR : Cellular mobile signal versus noise ratio (SINR).
}; simStatus => { oid => '.1.3.6.1.4.1.2007.4.1.2.2.2.18.3.2.1.26' }, # teldatCellularStateMobileSIMStatus : Cellular mobile SIM status.
operator => { oid => '.1.3.6.1.4.1.2007.4.1.2.2.2.18.3.4.1.2' }
my $mapping_prof_dial = { };
operator => { oid => '.1.3.6.1.4.1.2007.4.1.2.2.2.18.3.4.1.2' } # teldatCellularProfDialName1 : Dial Profile Name(1) associated to cellular interface.
}; my $oid_teldatCellularInfoInterfaceEntry = '.1.3.6.1.4.1.2007.4.1.2.2.2.18.1.1'; # teldatInfoInterfaceTable
my $oid_teldatCellularInfoInterfaceEntry = '.1.3.6.1.4.1.2007.4.1.2.2.2.18.1.1'; # teldatInfoInterfaceTable my $interface_types = {
my $oid_teldatCellularStateMobileEntry = '.1.3.6.1.4.1.2007.4.1.2.2.2.18.3.2.1'; # teldatStateMobileTable 1 => 'control vocal',
2 => 'data primary',
sub manage_selection { 3 => 'data auxiliary'
my ($self, %options) = @_; };
$self->{global} = { detected => 0 }; sub manage_selection {
$self->{cells} = {}; my ($self, %options) = @_;
my $snmp_result = $options{snmp}->get_multiple_table( my $snmp_result = $options{snmp}->get_table(
oids => [ oid => $oid_teldatCellularInfoInterfaceEntry,
{ oid => $mapping_state_interface->{interfaceState}->{oid} }, start => $mapping_info_interface->{imei}->{oid},
{ oid => $mapping_prof_dial->{operator}->{oid} }, end => $mapping_info_interface->{simIcc}->{oid},
{ oid => $oid_teldatCellularInfoInterfaceEntry, start => $mapping_info_interface->{imei}->{oid}, end => $mapping_info_interface->{simIcc}->{oid} }, nothing_quit => 1
{ oid => $oid_teldatCellularStateMobileEntry, start => $mapping_state_mobile->{techno}->{oid}, end => $mapping_state_mobile->{simStatus}->{oid} } );
],
nothing_quit => 1 $self->{global} = { detected => 0 };
); $self->{cells} = {};
my $modules = {};
foreach my $oid (keys %{$snmp_result->{$oid_teldatCellularInfoInterfaceEntry}}) { my $module_num = 0;
next if ($oid !~ /^$mapping_info_interface->{imei}->{oid}\.(.*)$/); my $interface_type = 0;
my $instance = $1; foreach my $oid ($options{snmp}->oid_lex_sort(keys %$snmp_result)) {
next if ($oid !~ /^$mapping_info_interface->{imei}->{oid}\.(.*)$/);
my $result = $options{snmp}->map_instance(mapping => $mapping_info_interface, results => $snmp_result->{$oid_teldatCellularInfoInterfaceEntry}, instance => $instance); my $instance = $1;
my $result2 = $options{snmp}->map_instance(mapping => $mapping_state_interface, results => $snmp_result->{$mapping_state_interface->{interfaceState}->{oid}}, instance => $instance);
my $result3 = $options{snmp}->map_instance(mapping => $mapping_prof_dial, results => $snmp_result->{$mapping_prof_dial->{operator}->{oid}}, instance => $instance); my $result = $options{snmp}->map_instance(mapping => $mapping_info_interface, results => $snmp_result, instance => $instance);
next if ($result->{imei} !~ /^[0-9]+$/);
my $cell_id = $result->{imei};
next if ($cell_id !~ /^(?:[0-9]+)$/); if (!defined($modules->{$module_num}) || $result->{imei} ne $modules->{$module_num}) {
next if (defined($self->{option_results}->{filter_cell_id}) && $self->{option_results}->{filter_cell_id} ne '' && $module_num++;
$cell_id !~ /$self->{option_results}->{filter_cell_id}/ && $result->{simIcc} !~ /$self->{option_results}->{filter_cell_id}/); $interface_type = 0;
$modules->{$module_num} = $result->{imei};
my $operator = $result3->{operator}; }
if($result3->{operator} =~ /^-+$/){ if (defined($modules->{$module_num})) {
$operator = "N/A"; $interface_type++;
} }
$self->{cells}->{$instance} = {
cellId => $cell_id, my $module = 'module' . $module_num;
simIcc => $result->{simIcc},
operator => $operator, next if (defined($self->{option_results}->{filter_module}) && $self->{option_results}->{filter_module} ne '' &&
status => { $module !~ /$self->{option_results}->{filter_module}/);
cellId => $cell_id, next if (defined($self->{option_results}->{filter_imei}) && $self->{option_results}->{filter_imei} ne '' &&
simIcc => $result->{simIcc}, $result->{imei} !~ /$self->{option_results}->{filter_imei}/);
operator => $operator, next if (defined($self->{option_results}->{filter_interface_type}) && $self->{option_results}->{filter_interface_type} ne '' &&
imsi => $result->{imsi}, $interface_types->{$interface_type} !~ /$self->{option_results}->{filter_interface_type}/);
interfaceState => $result2->{interfaceState}
}, $self->{cells}->{$instance} = {
signal => { module => $module,
cellId => $cell_id, module_num => $module_num,
simIcc => $result->{simIcc}, interfaceType => $interface_types->{$interface_type},
operator => $operator imei => $result->{imei},
} status => {
}; module => $module,
} interfaceType => $interface_types->{$interface_type},
imei => $result->{imei},
if (scalar(keys %{$self->{cells}}) <= 0 && defined($self->{option_results}->{filter_cell_id}) && $self->{option_results}->{filter_cell_id} ne '') { imsi => $result->{imsi},
$self->{output}->add_option_msg(short_msg => "No Cell ID found matching with filter : ".$self->{option_results}->{filter_cell_id}); simIcc => $result->{simIcc}
$self->{output}->option_exit(); },
} signal => {
# Return : OK: | 'modules.cellradio.detected.count'=0;;;0; module => $module,
# return if (scalar(keys %{$self->{cells}}) <= 0); interfaceType => $interface_types->{$interface_type},
imei => $result->{imei},
foreach my $instance (keys %{$self->{cells}}) { imsi => $result->{imsi},
my $result4 = $options{snmp}->map_instance(mapping => $mapping_state_mobile, results => $snmp_result->{$oid_teldatCellularStateMobileEntry}, instance => $instance); simIcc => $result->{simIcc}
}
$self->{cells}->{$instance}->{status}->{simStatus} = $result4->{simStatus}; };
if ($self->{cells}->{$instance}->{status}->{simIcc} ne '') { $self->{global}->{detected}++;
if($result4->{rsrp} ne '' && $result4->{rsrp} ne 0){ }
$self->{cells}->{$instance}->{signal}->{rsrp} = $result4->{rsrp};
} if (scalar(keys %{$self->{cells}}) <= 0 &&
if($result4->{rsrq} ne '' && $result4->{rsrq} ne 0) { (defined($self->{option_results}->{filter_module}) && $self->{option_results}->{filter_module} ne '') ||
$self->{cells}->{$instance}->{signal}->{rsrq} = $result4->{rsrq}; (defined($self->{option_results}->{filter_imei}) && $self->{option_results}->{filter_imei} ne '')) {
} $self->{output}->add_option_msg(short_msg => 'No interfaces found matching with filter');
if($result4->{snr} ne '' && $result4->{snr} ne 0) { $self->{output}->option_exit();
$self->{cells}->{$instance}->{signal}->{snr} = $result4->{snr}; }
}
if($result4->{rscp} ne '' && $result4->{rscp} ne 0) { $options{snmp}->load(
$self->{cells}->{$instance}->{signal}->{rscp} = $result4->{rscp}; oids => [ map($_->{oid}, values(%$mapping_data_interface)) ],
} instances => [ map($_, keys(%{$self->{cells}})) ],
if($result4->{csq} ne '' && $result4->{csq} ne 0) { instance_regexp => '^(.*)$'
$self->{cells}->{$instance}->{signal}->{csq} = $result4->{csq}; );
} $snmp_result = $options{snmp}->get_leef();
}
foreach (keys %{$self->{cells}}) {
$self->{global}->{detected}++; my $result = $options{snmp}->map_instance(mapping => $mapping_data_interface, results => $snmp_result, instance => $_);
}
} $self->{cells}->{$_}->{status}->{simStatus} = $result->{simStatus};
$self->{cells}->{$_}->{status}->{interfaceState} = $result->{interfaceState};
1; $self->{cells}->{$_}->{status}->{operator} = $result->{operator};
$self->{cells}->{$_}->{signal}->{operator} = $result->{operator};
__END__
next if ($self->{cells}->{$_}->{status}->{simIcc} eq '');
=head1 MODE
$self->{cells}->{$_}->{signal}->{rsrp} = $result->{rsrp} if ($result->{rsrp} ne '' && $result->{rsrp} != 0);
Check cellular radio modules. $self->{cells}->{$_}->{signal}->{rsrq} = $result->{rsrq} if ($result->{rsrq} ne '' && $result->{rsrq} != 0);
$self->{cells}->{$_}->{signal}->{snr} = $result->{snr} if ($result->{snr} ne '' && $result->{snr} != 0);
=over 8 $self->{cells}->{$_}->{signal}->{rscp} = $result->{rscp} if ($result->{rscp} ne '' && $result->{rscp} != 0);
$self->{cells}->{$_}->{signal}->{csq} = $result->{csq} if ($result->{csq} ne '' && $result->{csq} != 0);
=item B<--filter-cell-id> }
}
Filter cell modules by IMEI ID.
1;
=item B<--custom-perfdata-instances>
__END__
Define perfdatas instance (default: '%(cellId) %(operator)').
You can use the following variables: %{cellId}, %{simIcc}, %{operator} =head1 MODE
=item B<--unknown-status> Check cellular radio interfaces.
Define the conditions to match for the status to be UNKNOWN. =over 8
You can use the following variables: %{simStatus}, %{interfaceState}, %{cellId}, %{simIcc}, %{operator}, %{imsi}
=item B<--filter-module>
=item B<--warning-status>
Filter cellular radio interfaces by module.
Define the conditions to match for the status to be WARNING (default: '%{interfaceState} =~ /disconnect/').
You can use the following variables: %{simStatus}, %{interfaceState}, %{cellId}, %{simIcc}, %{operator}, %{imsi} =item B<--filter-imei>
=item B<--critical-status> Filter cellular radio interfaces by IMEI.
Define the conditions to match for the status to be CRITICAL (default: '%{simStatus} =~ /LOCKED/ || %{simStatus} =~ /DETECTING/'). =item B<--filter-interface-type>
You can use the following variables: %{simStatus}, %{interfaceState}, %{cellId}, %{simIcc}, %{operator}, %{imsi}
Filter cellular radio interfaces by type.
=item B<--warning-*> B<--critical-*>
=item B<--custom-perfdata-instances>
Thresholds.
Can be: 'modules-cellradio-detected', 'module-cellradio-rsrp', ''module-cellradio-rsrq', 'module-cellradio-rscp', 'module-cellradio-csq' Customize the name composition rule for the instances the metrics will be attached to (default: '%(module) %(interfaceType) %(imei)').
'module-cellradio-snr'. You can use the following variables: %(module), %(interfaceType), %(imei), %(operator), %(simIcc)
=back =item B<--unknown-status>
=cut Define the conditions to match for the status to be UNKNOWN.
You can use the following variables: %{module}, %{interfaceType}, %{imei}, %{operator}, %{imsi}, %{simIcc}, %{simStatus}, %{interfaceState}
=item B<--warning-status>
Define the conditions to match for the status to be WARNING (default: '%{interfaceState} =~ /disconnect/ && %{interfaceType} =~ /data primary/').
You can use the following variables: %{module}, %{interfaceType}, %{imei}, %{operator}, %{imsi}, %{simIcc}, %{simStatus}, %{interfaceState}
=item B<--critical-status>
Define the conditions to match for the status to be CRITICAL.
You can use the following variables: %{module}, %{interfaceType}, %{imei}, %{operator}, %{imsi}, %{simIcc}, %{simStatus}, %{interfaceState}
=item B<--warning-*> B<--critical-*>
Thresholds.
Can be: 'modules-cellradio-detected', 'module-cellradio-rsrp', ''module-cellradio-rsrq', 'module-cellradio-rscp', 'module-cellradio-csq'
'module-cellradio-snr'.
=back
=cut

View File

@ -1,116 +1,116 @@
# #
# Copyright 2024 Centreon (http://www.centreon.com/) # Copyright 2024 Centreon (http://www.centreon.com/)
# #
# Centreon is a full-fledged industry-strength solution that meets # Centreon is a full-fledged industry-strength solution that meets
# the needs in IT infrastructure and application monitoring for # the needs in IT infrastructure and application monitoring for
# service performance. # service performance.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at
# #
# http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
# #
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, # distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# #
package network::teldat::snmp::mode::cpu; package network::teldat::snmp::mode::cpu;
use base qw(centreon::plugins::templates::counter); use base qw(centreon::plugins::templates::counter);
use strict; use strict;
use warnings; use warnings;
sub prefix_cpu_output { sub prefix_cpu_output {
my ($self, %options) = @_; my ($self, %options) = @_;
return 'cpu average usage: '; return 'cpu average usage: ';
} }
sub set_counters { sub set_counters {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{maps_counters_type} = [ $self->{maps_counters_type} = [
{ name => 'global', type => 0, cb_prefix_output => 'prefix_cpu_output', skipped_code => { -10 => 1 } } { name => 'global', type => 0, cb_prefix_output => 'prefix_cpu_output', skipped_code => { -10 => 1 } }
]; ];
$self->{maps_counters}->{global} = [ $self->{maps_counters}->{global} = [
{ label => 'cpu-utilization-5s', nlabel => 'cpu.utilization.5s.percentage', set => { { label => 'cpu-utilization-5s', nlabel => 'cpu.utilization.5s.percentage', set => {
key_values => [ { name => 'cpu_load5s' } ], key_values => [ { name => 'cpu_load5s' } ],
output_template => '%.2f %% (5s)', output_template => '%.2f %% (5s)',
perfdatas => [ perfdatas => [
{ template => '%.2f', min => 0, max => 100, unit => '%' } { template => '%.2f', min => 0, max => 100, unit => '%' }
] ]
} }
}, },
{ label => 'cpu-utilization-1m', nlabel => 'cpu.utilization.1m.percentage', set => { { label => 'cpu-utilization-1m', nlabel => 'cpu.utilization.1m.percentage', set => {
key_values => [ { name => 'cpu_load1m' } ], key_values => [ { name => 'cpu_load1m' } ],
output_template => '%.2f %% (1m)', output_template => '%.2f %% (1m)',
perfdatas => [ perfdatas => [
{ template => '%.2f', min => 0, max => 100, unit => '%' } { template => '%.2f', min => 0, max => 100, unit => '%' }
] ]
} }
}, },
{ label => 'cpu-utilization-5m', nlabel => 'cpu.utilization.15m.percentage', set => { { label => 'cpu-utilization-5m', nlabel => 'cpu.utilization.15m.percentage', set => {
key_values => [ { name => 'cpu_load5m' } ], key_values => [ { name => 'cpu_load5m' } ],
output_template => '%.2f %% (5m)', output_template => '%.2f %% (5m)',
perfdatas => [ perfdatas => [
{ template => '%.2f', min => 0, max => 100, unit => '%' } { template => '%.2f', min => 0, max => 100, unit => '%' }
] ]
} }
} }
]; ];
} }
sub new { sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {
}); });
return $self; return $self;
} }
sub manage_selection { sub manage_selection {
my ($self, %options) = @_; my ($self, %options) = @_;
my $oid_cpu5s = '.1.3.6.1.4.1.2007.4.1.2.1.2.1.1.1.0'; # teldatCPUBusy5sec my $oid_cpu5s = '.1.3.6.1.4.1.2007.4.1.2.1.2.1.1.1.0'; # teldatCPUBusy5sec
my $oid_cpu1m = '.1.3.6.1.4.1.2007.4.1.2.1.2.1.1.2.0'; # teldatCPUBusy1min my $oid_cpu1m = '.1.3.6.1.4.1.2007.4.1.2.1.2.1.1.2.0'; # teldatCPUBusy1min
my $oid_cpu5m = '.1.3.6.1.4.1.2007.4.1.2.1.2.1.1.3.0'; # teldatCPUBusy5min my $oid_cpu5m = '.1.3.6.1.4.1.2007.4.1.2.1.2.1.1.3.0'; # teldatCPUBusy5min
my $snmp_result = $options{snmp}->get_leef( my $snmp_result = $options{snmp}->get_leef(
oids => [$oid_cpu5s, $oid_cpu1m, $oid_cpu5m], oids => [$oid_cpu5s, $oid_cpu1m, $oid_cpu5m],
nothing_quit => 1 nothing_quit => 1
); );
$self->{global} = { $self->{global} = {
cpu_load5s => $snmp_result->{$oid_cpu5s}, cpu_load5s => $snmp_result->{$oid_cpu5s},
cpu_load1m => $snmp_result->{$oid_cpu1m}, cpu_load1m => $snmp_result->{$oid_cpu1m},
cpu_load5m => $snmp_result->{$oid_cpu5m} cpu_load5m => $snmp_result->{$oid_cpu5m}
}; };
} }
1; 1;
__END__ __END__
=head1 MODE =head1 MODE
Check CPU usage. Check CPU usage.
=over 8 =over 8
=item B<--warning-*> B<--critical-*> =item B<--warning-*> B<--critical-*>
Thresholds. Thresholds.
Can be: 'cpu-utilization-5s', 'cpu-utilization-1m', 'cpu-utilization-5m'. Can be: 'cpu-utilization-5s', 'cpu-utilization-1m', 'cpu-utilization-5m'.
=back =back
=cut =cut

View File

@ -1,182 +1,180 @@
# #
# Copyright 2024 Centreon (http://www.centreon.com/) # Copyright 2024 Centreon (http://www.centreon.com/)
# #
# Centreon is a full-fledged industry-strength solution that meets # Centreon is a full-fledged industry-strength solution that meets
# the needs in IT infrastructure and application monitoring for # the needs in IT infrastructure and application monitoring for
# service performance. # service performance.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at
# #
# http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
# #
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, # distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# #
package network::teldat::snmp::mode::interfaces; package network::teldat::snmp::mode::interfaces;
use base qw(snmp_standard::mode::interfaces); use base qw(snmp_standard::mode::interfaces);
use strict; use strict;
use warnings; use warnings;
sub new { sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1);
bless $self, $class; bless $self, $class;
return $self; return $self;
} }
1; 1;
__END__ __END__
=head1 MODE =head1 MODE
Check interfaces. Check interfaces.
=over 8 =over 8
=item B<--add-global> =item B<--add-global>
Check global port statistics (By default if no --add-* option is set). Check global port statistics (By default if no --add-* option is set).
=item B<--add-status> =item B<--add-status>
Check interface status. Check interface status.
=item B<--add-duplex-status> =item B<--add-duplex-status>
Check duplex status (with --warning-status and --critical-status). Check duplex status (with --warning-status and --critical-status).
=item B<--add-traffic> =item B<--add-traffic>
Check interface traffic. Check interface traffic.
=item B<--add-errors> =item B<--add-errors>
Check interface errors. Check interface errors.
=item B<--add-cast> =item B<--add-cast>
Check interface cast. Check interface cast.
=item B<--add-speed> =item B<--add-speed>
Check interface speed. Check interface speed.
=item B<--add-volume> =item B<--add-volume>
Check interface data volume between two checks (not supposed to be graphed, useful for BI reporting). Check interface data volume between two checks (not supposed to be graphed, useful for BI reporting).
=item B<--check-metrics> =item B<--check-metrics>
If the expression is true, metrics are checked (Default: '%{opstatus} eq "up"'). If the expression is true, metrics are checked (Default: '%{opstatus} eq "up"').
=item B<--warning-status> =item B<--warning-status>
Set warning threshold for status. Set warning threshold for status.
You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display}
=item B<--critical-status> =item B<--critical-status>
Set critical threshold for status (Default: '%{admstatus} eq "up" and %{opstatus} ne "up"'). Set critical threshold for status (Default: '%{admstatus} eq "up" and %{opstatus} ne "up"').
You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display} You can use the following variables: %{admstatus}, %{opstatus}, %{duplexstatus}, %{display}
=item B<--warning-*> B<--critical-*> =item B<--warning-*> B<--critical-*>
Thresholds. Thresholds.
Can be: 'total-port', 'total-admin-up', 'total-admin-down', 'total-oper-up', 'total-oper-down', 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-traffic', 'out-traffic', 'in-error', 'in-discard', 'out-error', 'out-discard',
'in-ucast', 'in-bcast', 'in-mcast', 'out-ucast', 'out-bcast', 'out-mcast', 'in-ucast', 'in-bcast', 'in-mcast', 'out-ucast', 'out-bcast', 'out-mcast',
'speed' (b/s). 'speed' (b/s).
=item B<--units-traffic> =item B<--units-traffic>
Units of thresholds for the traffic (Default: 'percent_delta') ('percent_delta', 'bps', 'counter'). Units of thresholds for the traffic (Default: 'percent_delta') ('percent_delta', 'bps', 'counter').
=item B<--units-errors> =item B<--units-errors>
Units of thresholds for errors/discards (Default: 'percent_delta') ('percent_delta', 'percent', 'delta', 'deltaps', 'counter'). Units of thresholds for errors/discards (Default: 'percent_delta') ('percent_delta', 'percent', 'delta', 'deltaps', 'counter').
=item B<--units-cast> =item B<--units-cast>
Units of thresholds for communication types (Default: 'percent_delta') ('percent_delta', 'percent', 'delta', 'deltaps', 'counter'). Units of thresholds for communication types (Default: 'percent_delta') ('percent_delta', 'percent', 'delta', 'deltaps', 'counter').
=item B<--nagvis-perfdata> =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> =item B<--interface>
Set the interface (number expected) ex: 1,2,... (empty means 'check all interface'). Set the interface (number expected) ex: 1,2,... (empty means 'check all interface').
=item B<--name> =item B<--name>
Allows to use interface name with option --interface instead of interface oid index (Can be a regexp) Allows to use interface name with option --interface instead of interface OID index (Can be a regexp)
=item B<--speed> =item B<--speed>
Set interface speed for incoming/outgoing traffic (in Mb). Set interface speed for incoming/outgoing traffic (in Mb).
=item B<--speed-in> =item B<--speed-in>
Set interface speed for incoming traffic (in Mb). Set interface speed for incoming traffic (in Mb).
=item B<--speed-out> =item B<--speed-out>
Set interface speed for outgoing traffic (in Mb). Set interface speed for outgoing traffic (in Mb).
=item B<--map-speed-dsl> =item B<--map-speed-dsl>
Get interface speed configuration for interface type 'adsl' and 'vdsl2'. Get interface speed configuration for interface type 'ADSL' and 'VDSL2'.
Syntax: --map-speed-dsl=interface-src-name,interface-dsl-name Syntax: --map-speed-dsl=interface-src-name,interface-dsl-name
E.g: --map-speed-dsl=Et0.835,Et0-vdsl2 E.g: --map-speed-dsl=Et0.835,Et0-vdsl2
=item B<--force-counters64> =item B<--force-counters64>
Force to use 64 bits counters only. Can be used to improve performance. Force to use 64 bits counters only. Can be used to improve performance.
=item B<--force-counters32> =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 in SNMP version 2c and version 3). Should be used when 64 bits counters are buggy.
=item B<--reload-cache-time> =item B<--reload-cache-time>
Time in minutes before reloading cache file (default: 180). Time in minutes before reloading cache file (default: 180).
=item B<--oid-filter> =item B<--oid-filter>
Choose OID used to filter interface (default: ifName) (values: ifDesc, ifAlias, ifName, IpAddr). Choose OID used to filter interface (default: ifName) (values: ifDesc, ifAlias, ifName, IpAddr).
=item B<--oid-display> =item B<--oid-display>
Choose OID used to display interface (default: ifName) (values: ifDesc, ifAlias, ifName, IpAddr). Choose OID used to display interface (default: ifName) (values: ifDesc, ifAlias, ifName, IpAddr).
=item B<--oid-extra-display> =item B<--oid-extra-display>
Add an OID to display. Add an OID to display.
=item B<--display-transform-src> =item B<--display-transform-src> B<--display-transform-dst>
Regexp src to transform display value. Modify the interface name displayed by using a regular expression.
=item B<--display-transform-dst> Example: adding --display-transform-src='eth' --display-transform-dst='ens' will replace all occurrences of 'eth' with 'ens'
Regexp dst to transform display value. =item B<--show-cache>
=item B<--show-cache> Display cache interface data.
Display cache interface data. =back
=back =cut
=cut

View File

@ -0,0 +1,151 @@
#
# 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::teldat::snmp::mode::listcellsradio;
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 => {
});
return $self;
}
sub check_options {
my ($self, %options) = @_;
$self->SUPER::init(%options);
}
my $mapping = {
imei => { oid => '.1.3.6.1.4.1.2007.4.1.2.2.2.18.1.1.5' }, # teldatCellularInfoInterfaceModuleIMEI : Cellular module IMEI.
imsi => { oid => '.1.3.6.1.4.1.2007.4.1.2.2.2.18.1.1.6' }, # teldatCellularInfoInterfaceModuleIMSI : Cellular module IMSI.
simIcc => { oid => '.1.3.6.1.4.1.2007.4.1.2.2.2.18.1.1.8' } # teldatCellularInfoInterfaceSIMIcc : Cellular active SIM ICC.
};
my $oid_teldatCellularInfoInterfaceEntry = '.1.3.6.1.4.1.2007.4.1.2.2.2.18.1.1'; # teldatInfoInterfaceTable
my $interface_types = {
1 => 'control vocal',
2 => 'data primary',
3 => 'data auxiliary'
};
sub manage_selection {
my ($self, %options) = @_;
my $snmp_result = $options{snmp}->get_table(
oid => $oid_teldatCellularInfoInterfaceEntry,
start => $mapping->{imei}->{oid},
end => $mapping->{simIcc}->{oid},
nothing_quit => 1
);
my $results = {};
my $modules = {};
my $module_num = 0;
my $interface_type = 0;
foreach my $oid ($options{snmp}->oid_lex_sort(keys %$snmp_result)) {
next if ($oid !~ /^$mapping->{imei}->{oid}\.(.*)$/);
my $instance = $1;
my $result = $options{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => $instance);
next if ($result->{imei} !~ /^[0-9]+$/);
if (!defined($modules->{$module_num}) || $result->{imei} ne $modules->{$module_num}) {
$module_num++;
$interface_type = 0;
$modules->{$module_num} = $result->{imei};
}
if (defined($modules->{$module_num})) {
$interface_type++;
}
my $module = 'module' . $module_num;
$results->{$instance} = {
module => $module,
moduleNum => $module_num,
interfaceType => $interface_types->{$interface_type},
imei => $result->{imei},
imsi => $result->{imsi},
simIcc => $result->{simIcc}
};
}
return $results;
}
sub run {
my ($self, %options) = @_;
my $results = $self->manage_selection(snmp => $options{snmp});
foreach my $name (sort keys %$results) {
$self->{output}->output_add(long_msg =>
'[module = ' . $results->{$name}->{module} . ']' .
'[moduleNum = ' . $results->{$name}->{moduleNum} . ']' .
'[interfaceType = ' . $results->{$name}->{interfaceType} . ']' .
join('', map("[$_ = " . $results->{$name}->{$_} . ']', keys(%$mapping)))
);
}
$self->{output}->output_add(
severity => 'OK',
short_msg => 'List cellular radio interfaces:'
);
$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 => ['module', 'moduleNum', 'interfaceType', keys %$mapping]);
}
sub disco_show {
my ($self, %options) = @_;
my $results = $self->manage_selection(snmp => $options{snmp});
foreach (sort keys %$results) {
$self->{output}->add_disco_entry(
%{$results->{$_}}
);
}
}
1;
__END__
=head1 MODE
List cellular radio interfaces.
=over 8
=back
=cut

View File

@ -1,128 +1,128 @@
# #
# Copyright 2024 Centreon (http://www.centreon.com/) # Copyright 2024 Centreon (http://www.centreon.com/)
# #
# Centreon is a full-fledged industry-strength solution that meets # Centreon is a full-fledged industry-strength solution that meets
# the needs in IT infrastructure and application monitoring for # the needs in IT infrastructure and application monitoring for
# service performance. # service performance.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at
# #
# http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
# #
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, # distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# #
package network::teldat::snmp::mode::memory; package network::teldat::snmp::mode::memory;
use base qw(centreon::plugins::templates::counter); use base qw(centreon::plugins::templates::counter);
use strict; use strict;
use warnings; use warnings;
sub custom_usage_output { sub custom_usage_output {
my ($self, %options) = @_; my ($self, %options) = @_;
return sprintf( return sprintf(
'total: %s %s used: %s %s (%.2f%%) free: %s %s (%.2f%%)', 'total: %s %s used: %s %s (%.2f%%) free: %s %s (%.2f%%)',
$self->{perfdata}->change_bytes(value => $self->{result_values}->{total}), $self->{perfdata}->change_bytes(value => $self->{result_values}->{total}),
$self->{perfdata}->change_bytes(value => $self->{result_values}->{used}), $self->{perfdata}->change_bytes(value => $self->{result_values}->{used}),
$self->{result_values}->{prct_used}, $self->{result_values}->{prct_used},
$self->{perfdata}->change_bytes(value => $self->{result_values}->{free}), $self->{perfdata}->change_bytes(value => $self->{result_values}->{free}),
$self->{result_values}->{prct_free} $self->{result_values}->{prct_free}
); );
} }
sub prefix_memory_output { sub prefix_memory_output {
my ($self, %options) = @_; my ($self, %options) = @_;
return "Memory '" . $options{instance} . "' "; return "Memory '" . $options{instance} . "' ";
} }
sub set_counters { sub set_counters {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{maps_counters_type} = [ $self->{maps_counters_type} = [
{ name => 'memory', type => 1, cb_prefix_output => 'prefix_memory_output', message_multiple => 'All memory usages are ok', skipped_code => { -10 => 1 } } { name => 'memory', type => 1, cb_prefix_output => 'prefix_memory_output', message_multiple => 'All memory usages are ok', skipped_code => { -10 => 1 } }
]; ];
$self->{maps_counters}->{memory} = [ $self->{maps_counters}->{memory} = [
{ label => 'usage', nlabel => 'memory.usage.bytes', set => { { label => 'usage', nlabel => 'memory.usage.bytes', set => {
key_values => [ { name => 'used' }, { name => 'free' }, { name => 'prct_used' }, { name => 'prct_free' }, { name => 'total' } ], key_values => [ { name => 'used' }, { name => 'free' }, { name => 'prct_used' }, { name => 'prct_free' }, { name => 'total' } ],
closure_custom_output => $self->can('custom_usage_output'), closure_custom_output => $self->can('custom_usage_output'),
perfdatas => [ perfdatas => [
{ template => '%d', min => 0, max => 'total', unit => 'B', cast_int => 1, label_extra_instance => 1 } { template => '%d', min => 0, max => 'total', unit => 'B', cast_int => 1, label_extra_instance => 1 }
] ]
} }
}, },
{ label => 'usage-free', display_ok => 0, nlabel => 'memory.free.bytes', display_ok => 0, set => { { label => 'usage-free', display_ok => 0, nlabel => 'memory.free.bytes', display_ok => 0, set => {
key_values => [ { name => 'free' }, { name => 'used' }, { name => 'prct_used' }, { name => 'prct_free' }, { name => 'total' } ], key_values => [ { name => 'free' }, { name => 'used' }, { name => 'prct_used' }, { name => 'prct_free' }, { name => 'total' } ],
closure_custom_output => $self->can('custom_usage_output'), closure_custom_output => $self->can('custom_usage_output'),
perfdatas => [ perfdatas => [
{ template => '%d', min => 0, max => 'total', unit => 'B', cast_int => 1, label_extra_instance => 1 } { template => '%d', min => 0, max => 'total', unit => 'B', cast_int => 1, label_extra_instance => 1 }
] ]
} }
}, },
{ label => 'usage-prct', nlabel => 'memory.usage.percentage', display_ok => 0, set => { { label => 'usage-prct', nlabel => 'memory.usage.percentage', display_ok => 0, set => {
key_values => [ { name => 'prct_used' }, { name => 'used' }, { name => 'free' }, { name => 'prct_free' }, { name => 'total' } ], key_values => [ { name => 'prct_used' }, { name => 'used' }, { name => 'free' }, { name => 'prct_free' }, { name => 'total' } ],
closure_custom_output => $self->can('custom_usage_output'), closure_custom_output => $self->can('custom_usage_output'),
perfdatas => [ perfdatas => [
{ template => '%.2f', min => 0, max => 100, unit => '%', label_extra_instance => 1 } { template => '%.2f', min => 0, max => 100, unit => '%', label_extra_instance => 1 }
] ]
} }
} }
]; ];
} }
sub new { sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => {}); $options{options}->add_options(arguments => {});
return $self; return $self;
} }
sub manage_selection { sub manage_selection {
my ($self, %options) = @_; my ($self, %options) = @_;
my $oid_total = '.1.3.6.1.4.1.2007.4.1.2.1.1.26.0'; # telProdNpMonSistemMemTotal my $oid_total = '.1.3.6.1.4.1.2007.4.1.2.1.1.26.0'; # telProdNpMonSistemMemTotal
my $oid_free = '.1.3.6.1.4.1.2007.4.1.2.1.1.30.0'; # telProdNpMonSistemMemFreenoncache my $oid_free = '.1.3.6.1.4.1.2007.4.1.2.1.1.30.0'; # telProdNpMonSistemMemFreenoncache
my $snmp_result = $options{snmp}->get_leef( my $snmp_result = $options{snmp}->get_leef(
oids => [$oid_total, $oid_free], oids => [$oid_total, $oid_free],
nothing_quit => 1 nothing_quit => 1
); );
$self->{memory}->{system} = { $self->{memory}->{system} = {
used => $snmp_result->{$oid_total} - $snmp_result->{$oid_free}, used => $snmp_result->{$oid_total} - $snmp_result->{$oid_free},
free => $snmp_result->{$oid_free}, free => $snmp_result->{$oid_free},
prct_used => ($snmp_result->{$oid_total} - $snmp_result->{$oid_free}) * 100 / $snmp_result->{$oid_total}, prct_used => ($snmp_result->{$oid_total} - $snmp_result->{$oid_free}) * 100 / $snmp_result->{$oid_total},
prct_free => $snmp_result->{$oid_free} * 100 / $snmp_result->{$oid_total}, prct_free => $snmp_result->{$oid_free} * 100 / $snmp_result->{$oid_total},
total => $snmp_result->{$oid_total} total => $snmp_result->{$oid_total}
}; };
} }
1; 1;
__END__ __END__
=head1 MODE =head1 MODE
Check memory. Check memory.
=over 8 =over 8
=item B<--warning-*> B<--critical-*> =item B<--warning-*> B<--critical-*>
Thresholds. Thresholds.
Can be: 'usage' (B), 'usage-free' (B), 'usage-prct' (%). Can be: 'usage' (B), 'usage-free' (B), 'usage-prct' (%).
=back =back
=cut =cut

View File

@ -1,77 +1,77 @@
# #
# Copyright 2024 Centreon (http://www.centreon.com/) # Copyright 2024 Centreon (http://www.centreon.com/)
# #
# Centreon is a full-fledged industry-strength solution that meets # Centreon is a full-fledged industry-strength solution that meets
# the needs in IT infrastructure and application monitoring for # the needs in IT infrastructure and application monitoring for
# service performance. # service performance.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at
# #
# http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
# #
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, # distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# #
package network::teldat::snmp::mode::uptime; package network::teldat::snmp::mode::uptime;
use base qw(snmp_standard::mode::uptime); use base qw(snmp_standard::mode::uptime);
use strict; use strict;
use warnings; use warnings;
sub new { sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1);
bless $self, $class; bless $self, $class;
return $self; return $self;
} }
1; 1;
__END__ __END__
=head1 MODE =head1 MODE
Check system uptime. Check system uptime.
=over 8 =over 8
=item B<--warning-uptime> =item B<--warning-uptime>
Threshold warning. Threshold warning.
=item B<--critical-uptime> =item B<--critical-uptime>
Threshold critical. Threshold critical.
=item B<--add-sysdesc> =item B<--add-sysdesc>
Display system description. Display system description.
=item B<--force-oid> =item B<--force-oid>
Can choose your oid (numeric format only). Can choose your OID (numeric format only).
=item B<--check-overload> =item B<--check-overload>
Uptime counter limit is 4294967296 and overflow. Uptime counter limit is 4294967296 and overflow.
With that option, we manage the counter going back. But there is a few chance we can miss a reboot. With that option, we manage the counter going back. But there is a few chance we can miss a reboot.
=item B<--reboot-window> =item B<--reboot-window>
To be used with check-overload option. Time in milliseconds (Default: 5000) To be used with check-overload option. Time in milliseconds (Default: 5000)
You increase the chance of not missing a reboot if you decrease that value. You increase the chance of not missing a reboot if you decrease that value.
=item B<--unit> =item B<--unit>
Select the unit for performance data and thresholds. May be 's' for seconds, 'm' for minutes, Select the unit for performance data and thresholds. May be 's' for seconds, 'm' for minutes,
'h' for hours, 'd' for days, 'w' for weeks. Default is seconds 'h' for hours, 'd' for days, 'w' for weeks. Default is seconds
=back =back

View File

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

View File

@ -12,6 +12,7 @@
--dyn-mode --dyn-mode
--exclude-fs --exclude-fs
--filter-fs --filter-fs
--filter-imei
--filter-vdom --filter-vdom
--filter-vm --filter-vm
--force-counters32 --force-counters32
@ -49,18 +50,28 @@ ASAM
Alcatel Alcatel
Avigilon Avigilon
Centreon Centreon
cpu-utilization-1m
cpu-utilization-5m
cpu-utilization-5s
Datacore Datacore
Fortigate Fortigate
Fortinet Fortinet
HashiCorp HashiCorp
ISAM IMEI
IpAddr IpAddr
ISAM
Iwsva Iwsva
Loggly Loggly
MBean MBean
MIB MIB
MQTT MQTT
Meraki Meraki
module-cellradio-rscp
module-cellradio-csq
module-cellradio-rsrp
module-cellradio-rsrq
module-cellradio-snr
modules-cellradio-detected
Mosquitto Mosquitto
NTLMv2 NTLMv2
NagVis NagVis
@ -116,6 +127,7 @@ queue-messages-inflighted
sfp.temperature sfp.temperature
space-usage-prct space-usage-prct
teampass teampass
Teldat
timeframe timeframe
topic-messages-inflighted topic-messages-inflighted
total-offline-prct total-offline-prct
@ -123,6 +135,7 @@ total-online-prct
total-oper-down total-oper-down
total-oper-up total-oper-up
uptime uptime
usage-prct
userpass userpass
v1 v1
v2 v2

View File

@ -0,0 +1,59 @@
*** Settings ***
Documentation Network Teldat SNMP plugin
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s
*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=network::teldat::snmp::plugin
*** Test Cases ***
Cells radio ${tc}
[Tags] network teldat snmp
${command} Catenate
... ${CMD}
... --mode=cells-radio
... --hostname=127.0.0.1
... --snmp-version=2c
... --snmp-port=2024
... --snmp-community=network/teldat/snmp/teldat
... --custom-perfdata-instances=${customperfdatainstances}
... --critical-status=${criticalstatus}
... --warning-modules-cellradio-detected=${warningmodulescellradiodetected}
... --critical-modules-cellradio-detected=${criticalmodulescellradiodetected}
... --warning-module-cellradio-rsrp=${warningmodulecellradiorsrp}
... --critical-module-cellradio-rsrp=${criticalmodulecellradiorsrp}
... --warning-module-cellradio-rsrq=${warningmodulecellradiorsrq}
... --critical-module-cellradio-rsrq=${criticalmodulecellradiorsrq}
... --warning-module-cellradio-csq=${warningmodulecellradiocsq}
... --critical-module-cellradio-csq=${criticalmodulecellradiocsq}
... --warning-module-cellradio-snr=${warningmodulecellradiosnr}
... --critical-module-cellradio-snr=${criticalmodulecellradiosnr}
${output} Run ${command}
${output} Strip String ${output}
Should Be Equal As Strings
... ${output}
... ${result}
... Wrong output result for command:\n${command}\n\nObtained:\n${output}\n\nExpected:\n${result}\n
... values=False
... collapse_spaces=True
Examples: tc customperfdatainstances criticalstatus warningmodulescellradiodetected criticalmodulescellradiodetected warningmodulecellradiorsrp criticalmodulecellradiorsrp warningmodulecellradiorsrq criticalmodulecellradiorsrq warningmodulecellradiocsq criticalmodulecellradiocsq warningmodulecellradiosnr criticalmodulecellradiosnr result --
... 1 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} OK: All cellular radio interfaces are ok | 'modules.cellradio.detected.count'=3;;;0; 'module1~control vocal~359072066403821#module.cellradio.rsrp.dbm'=-114;;;0; 'module1~control vocal~359072066403821#module.cellradio.rsrq.dbm'=-18;;;0; 'module1~control vocal~359072066403821#module.cellradio.snr.db'=-1;;;0; 'module1~control vocal~359072066403821#module.cellradio.csq.dbm'=-73;;;0; 'module1~data primary~359072066403821#module.cellradio.rsrp.dbm'=-114;;;0; 'module1~data primary~359072066403821#module.cellradio.rsrq.dbm'=-18;;;0; 'module1~data primary~359072066403821#module.cellradio.snr.db'=-1;;;0; 'module1~data primary~359072066403821#module.cellradio.csq.dbm'=-73;;;0;
... 4 '%(operator) %(simIcc)' ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} OK: All cellular radio interfaces are ok | 'modules.cellradio.detected.count'=3;;;0; '---~89330122115801091660#module.cellradio.rsrp.dbm'=-114;;;0; '---~89330122115801091660#module.cellradio.rsrq.dbm'=-18;;;0; '---~89330122115801091660#module.cellradio.snr.db'=-1;;;0; '---~89330122115801091660#module.cellradio.csq.dbm'=-73;;;0; 'PHENIX~89330122115801091660#module.cellradio.rsrp.dbm'=-114;;;0; 'PHENIX~89330122115801091660#module.cellradio.rsrq.dbm'=-18;;;0; 'PHENIX~89330122115801091660#module.cellradio.snr.db'=-1;;;0; 'PHENIX~89330122115801091660#module.cellradio.csq.dbm'=-73;;;0;
... 5 ${EMPTY} ${EMPTY} 2 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} WARNING: Number of cellular radio interfacesdetected: 3 | 'modules.cellradio.detected.count'=3;0:2;;0; 'module1~control vocal~359072066403821#module.cellradio.rsrp.dbm'=-114;;;0; 'module1~control vocal~359072066403821#module.cellradio.rsrq.dbm'=-18;;;0; 'module1~control vocal~359072066403821#module.cellradio.snr.db'=-1;;;0; 'module1~control vocal~359072066403821#module.cellradio.csq.dbm'=-73;;;0; 'module1~data primary~359072066403821#module.cellradio.rsrp.dbm'=-114;;;0; 'module1~data primary~359072066403821#module.cellradio.rsrq.dbm'=-18;;;0; 'module1~data primary~359072066403821#module.cellradio.snr.db'=-1;;;0; 'module1~data primary~359072066403821#module.cellradio.csq.dbm'=-73;;;0;
... 6 ${EMPTY} ${EMPTY} ${EMPTY} 2 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} CRITICAL: Number of cellular radio interfacesdetected: 3 | 'modules.cellradio.detected.count'=3;;0:2;0; 'module1~control vocal~359072066403821#module.cellradio.rsrp.dbm'=-114;;;0; 'module1~control vocal~359072066403821#module.cellradio.rsrq.dbm'=-18;;;0; 'module1~control vocal~359072066403821#module.cellradio.snr.db'=-1;;;0; 'module1~control vocal~359072066403821#module.cellradio.csq.dbm'=-73;;;0; 'module1~data primary~359072066403821#module.cellradio.rsrp.dbm'=-114;;;0; 'module1~data primary~359072066403821#module.cellradio.rsrq.dbm'=-18;;;0; 'module1~data primary~359072066403821#module.cellradio.snr.db'=-1;;;0; 'module1~data primary~359072066403821#module.cellradio.csq.dbm'=-73;;;0;
... 7 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} -100 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} WARNING: cellular radio module '1' interface 'control vocal' [imei: 359072066403821] rsrp: -114 dBm - cellular radio module '1' interface 'data primary' [imei: 359072066403821] rsrp: -114 dBm | 'modules.cellradio.detected.count'=3;;;0; 'module1~control vocal~359072066403821#module.cellradio.rsrp.dbm'=-114;0:-100;;0; 'module1~control vocal~359072066403821#module.cellradio.rsrq.dbm'=-18;;;0; 'module1~control vocal~359072066403821#module.cellradio.snr.db'=-1;;;0; 'module1~control vocal~359072066403821#module.cellradio.csq.dbm'=-73;;;0; 'module1~data primary~359072066403821#module.cellradio.rsrp.dbm'=-114;0:-100;;0; 'module1~data primary~359072066403821#module.cellradio.rsrq.dbm'=-18;;;0; 'module1~data primary~359072066403821#module.cellradio.snr.db'=-1;;;0; 'module1~data primary~359072066403821#module.cellradio.csq.dbm'=-73;;;0;
... 8 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} -100 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} CRITICAL: cellular radio module '1' interface 'control vocal' [imei: 359072066403821] rsrp: -114 dBm - cellular radio module '1' interface 'data primary' [imei: 359072066403821] rsrp: -114 dBm | 'modules.cellradio.detected.count'=3;;;0; 'module1~control vocal~359072066403821#module.cellradio.rsrp.dbm'=-114;;0:-100;0; 'module1~control vocal~359072066403821#module.cellradio.rsrq.dbm'=-18;;;0; 'module1~control vocal~359072066403821#module.cellradio.snr.db'=-1;;;0; 'module1~control vocal~359072066403821#module.cellradio.csq.dbm'=-73;;;0; 'module1~data primary~359072066403821#module.cellradio.rsrp.dbm'=-114;;0:-100;0; 'module1~data primary~359072066403821#module.cellradio.rsrq.dbm'=-18;;;0; 'module1~data primary~359072066403821#module.cellradio.snr.db'=-1;;;0; 'module1~data primary~359072066403821#module.cellradio.csq.dbm'=-73;;;0;
... 9 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} 10 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} WARNING: cellular radio module '1' interface 'control vocal' [imei: 359072066403821] rsrq: -18 dBm - cellular radio module '1' interface 'data primary' [imei: 359072066403821] rsrq: -18 dBm | 'modules.cellradio.detected.count'=3;;;0; 'module1~control vocal~359072066403821#module.cellradio.rsrp.dbm'=-114;;;0; 'module1~control vocal~359072066403821#module.cellradio.rsrq.dbm'=-18;0:10;;0; 'module1~control vocal~359072066403821#module.cellradio.snr.db'=-1;;;0; 'module1~control vocal~359072066403821#module.cellradio.csq.dbm'=-73;;;0; 'module1~data primary~359072066403821#module.cellradio.rsrp.dbm'=-114;;;0; 'module1~data primary~359072066403821#module.cellradio.rsrq.dbm'=-18;0:10;;0; 'module1~data primary~359072066403821#module.cellradio.snr.db'=-1;;;0; 'module1~data primary~359072066403821#module.cellradio.csq.dbm'=-73;;;0;
... 10 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} 10 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} CRITICAL: cellular radio module '1' interface 'control vocal' [imei: 359072066403821] rsrq: -18 dBm - cellular radio module '1' interface 'data primary' [imei: 359072066403821] rsrq: -18 dBm | 'modules.cellradio.detected.count'=3;;;0; 'module1~control vocal~359072066403821#module.cellradio.rsrp.dbm'=-114;;;0; 'module1~control vocal~359072066403821#module.cellradio.rsrq.dbm'=-18;;0:10;0; 'module1~control vocal~359072066403821#module.cellradio.snr.db'=-1;;;0; 'module1~control vocal~359072066403821#module.cellradio.csq.dbm'=-73;;;0; 'module1~data primary~359072066403821#module.cellradio.rsrp.dbm'=-114;;;0; 'module1~data primary~359072066403821#module.cellradio.rsrq.dbm'=-18;;0:10;0; 'module1~data primary~359072066403821#module.cellradio.snr.db'=-1;;;0; 'module1~data primary~359072066403821#module.cellradio.csq.dbm'=-73;;;0;
... 11 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} 10 ${EMPTY} ${EMPTY} ${EMPTY} WARNING: cellular radio module '1' interface 'control vocal' [imei: 359072066403821] csq: -73 dBm - cellular radio module '1' interface 'data primary' [imei: 359072066403821] csq: -73 dBm | 'modules.cellradio.detected.count'=3;;;0; 'module1~control vocal~359072066403821#module.cellradio.rsrp.dbm'=-114;;;0; 'module1~control vocal~359072066403821#module.cellradio.rsrq.dbm'=-18;;;0; 'module1~control vocal~359072066403821#module.cellradio.snr.db'=-1;;;0; 'module1~control vocal~359072066403821#module.cellradio.csq.dbm'=-73;0:10;;0; 'module1~data primary~359072066403821#module.cellradio.rsrp.dbm'=-114;;;0; 'module1~data primary~359072066403821#module.cellradio.rsrq.dbm'=-18;;;0; 'module1~data primary~359072066403821#module.cellradio.snr.db'=-1;;;0; 'module1~data primary~359072066403821#module.cellradio.csq.dbm'=-73;0:10;;0;
... 12 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} 10 ${EMPTY} ${EMPTY} CRITICAL: cellular radio module '1' interface 'control vocal' [imei: 359072066403821] csq: -73 dBm - cellular radio module '1' interface 'data primary' [imei: 359072066403821] csq: -73 dBm | 'modules.cellradio.detected.count'=3;;;0; 'module1~control vocal~359072066403821#module.cellradio.rsrp.dbm'=-114;;;0; 'module1~control vocal~359072066403821#module.cellradio.rsrq.dbm'=-18;;;0; 'module1~control vocal~359072066403821#module.cellradio.snr.db'=-1;;;0; 'module1~control vocal~359072066403821#module.cellradio.csq.dbm'=-73;;0:10;0; 'module1~data primary~359072066403821#module.cellradio.rsrp.dbm'=-114;;;0; 'module1~data primary~359072066403821#module.cellradio.rsrq.dbm'=-18;;;0; 'module1~data primary~359072066403821#module.cellradio.snr.db'=-1;;;0; 'module1~data primary~359072066403821#module.cellradio.csq.dbm'=-73;;0:10;0;
... 13 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} 0 ${EMPTY} WARNING: cellular radio module '1' interface 'control vocal' [imei: 359072066403821] snr: -1 dB - cellular radio module '1' interface 'data primary' [imei: 359072066403821] snr: -1 dB | 'modules.cellradio.detected.count'=3;;;0; 'module1~control vocal~359072066403821#module.cellradio.rsrp.dbm'=-114;;;0; 'module1~control vocal~359072066403821#module.cellradio.rsrq.dbm'=-18;;;0; 'module1~control vocal~359072066403821#module.cellradio.snr.db'=-1;0:0;;0; 'module1~control vocal~359072066403821#module.cellradio.csq.dbm'=-73;;;0; 'module1~data primary~359072066403821#module.cellradio.rsrp.dbm'=-114;;;0; 'module1~data primary~359072066403821#module.cellradio.rsrq.dbm'=-18;;;0; 'module1~data primary~359072066403821#module.cellradio.snr.db'=-1;0:0;;0; 'module1~data primary~359072066403821#module.cellradio.csq.dbm'=-73;;;0;
... 14 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} 0 CRITICAL: cellular radio module '1' interface 'control vocal' [imei: 359072066403821] snr: -1 dB - cellular radio module '1' interface 'data primary' [imei: 359072066403821] snr: -1 dB | 'modules.cellradio.detected.count'=3;;;0; 'module1~control vocal~359072066403821#module.cellradio.rsrp.dbm'=-114;;;0; 'module1~control vocal~359072066403821#module.cellradio.rsrq.dbm'=-18;;;0; 'module1~control vocal~359072066403821#module.cellradio.snr.db'=-1;;0:0;0; 'module1~control vocal~359072066403821#module.cellradio.csq.dbm'=-73;;;0; 'module1~data primary~359072066403821#module.cellradio.rsrp.dbm'=-114;;;0; 'module1~data primary~359072066403821#module.cellradio.rsrq.dbm'=-18;;;0; 'module1~data primary~359072066403821#module.cellradio.snr.db'=-1;;0:0;0; 'module1~data primary~359072066403821#module.cellradio.csq.dbm'=-73;;;0;
... 15 ${EMPTY} '\\\%{interfaceState} =~ /disconnect/' ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} CRITICAL: cellular radio module '1' interface 'control vocal' [imei: 359072066403821] sim status: OK [operator: ---] [imsi: 208015606540916] [interface state: disconnect(1)] [simIcc: 89330122115801091660] - cellular radio module '1' interface 'data auxiliary' [imei: 359072066403821] sim status: DETECTING [operator: ---] [imsi: 208015606540916] [interface state: disconnect(1)] [simIcc: 89330122115801091660] | 'modules.cellradio.detected.count'=3;;;0; 'module1~control vocal~359072066403821#module.cellradio.rsrp.dbm'=-114;;;0; 'module1~control vocal~359072066403821#module.cellradio.rsrq.dbm'=-18;;;0; 'module1~control vocal~359072066403821#module.cellradio.snr.db'=-1;;;0; 'module1~control vocal~359072066403821#module.cellradio.csq.dbm'=-73;;;0; 'module1~data primary~359072066403821#module.cellradio.rsrp.dbm'=-114;;;0; 'module1~data primary~359072066403821#module.cellradio.rsrq.dbm'=-18;;;0; 'module1~data primary~359072066403821#module.cellradio.snr.db'=-1;;;0; 'module1~data primary~359072066403821#module.cellradio.csq.dbm'=-73;;;0;

View File

@ -9,338 +9,6 @@ Test Timeout 120s
*** Variables *** *** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=network::teldat::snmp::plugin ${CMD} ${CENTREON_PLUGINS} --plugin=network::teldat::snmp::plugin
# Test simple usage of the cellsradio mode
&{teldat_cellsradio_test1}
... filtercellid=
... customperfdatainstances=
... unknownstatus=
... warningstatus=
... criticalstatus=
... warningmodulescellradiodetected=
... criticalmodulescellradiodetected=
... warningmodulecellradiorsrp=
... criticalmodulecellradiorsrp=
... warningmodulecellradiorsrq=
... criticalmodulecellradiorsrq=
... warningmodulecellradiorscp=
... criticalmodulecellradiorscp=
... warningmodulecellradiocsq=
... criticalmodulecellradiocsq=
... warningmodulecellradiosnr=
... criticalmodulecellradiosnr=
... result=CRITICAL: cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: PHENIX] sim status: LOCKED [imsi: 208015606540916] [interface state: connect(9)] - cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: N/A] sim status: DETECTING [imsi: 208015606540916] [interface state: disconnect(1)] WARNING: cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: N/A] sim status: OK [imsi: 208015606540916] [interface state: disconnect(1)] | 'modules.cellradio.detected.count'=3;;;0; '359072066403821~N/A#module.cellradio.rsrp.dbm'=-114;;;0; '359072066403821~N/A#module.cellradio.rsrq.dbm'=-18;;;0; '359072066403821~N/A#module.cellradio.snr.db'=-1;;;0; '359072066403821~N/A#module.cellradio.csq.dbm'=-73;;;0; '359072066403821~PHENIX#module.cellradio.rsrp.dbm'=-114;;;0; '359072066403821~PHENIX#module.cellradio.rsrq.dbm'=-18;;;0; '359072066403821~PHENIX#module.cellradio.snr.db'=-1;;;0; '359072066403821~PHENIX#module.cellradio.csq.dbm'=-73;;;0;
# Test cellsradio mode with filter-cell-id option set to a fake value
&{teldat_cellsradio_test2}
... filtercellid=toto
... customperfdatainstances=
... unknownstatus=
... warningstatus=
... criticalstatus=
... warningmodulescellradiodetected=
... criticalmodulescellradiodetected=
... warningmodulecellradiorsrp=
... criticalmodulecellradiorsrp=
... warningmodulecellradiorsrq=
... criticalmodulecellradiorsrq=
... warningmodulecellradiorscp=
... criticalmodulecellradiorscp=
... warningmodulecellradiocsq=
... criticalmodulecellradiocsq=
... warningmodulecellradiosnr=
... criticalmodulecellradiosnr=
... result=UNKNOWN: No Cell ID found matching with filter : toto
# Test cellsradio mode with filter-cell-id option set to a imei value
&{teldat_cellsradio_test3}
... filtercellid='359072066403821'
... customperfdatainstances=
... unknownstatus=
... warningstatus=
... criticalstatus=
... warningmodulescellradiodetected=
... criticalmodulescellradiodetected=
... warningmodulecellradiorsrp=
... criticalmodulecellradiorsrp=
... warningmodulecellradiorsrq=
... criticalmodulecellradiorsrq=
... warningmodulecellradiorscp=
... criticalmodulecellradiorscp=
... warningmodulecellradiocsq=
... criticalmodulecellradiocsq=
... warningmodulecellradiosnr=
... criticalmodulecellradiosnr=
... result=CRITICAL: cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: PHENIX] sim status: LOCKED [imsi: 208015606540916] [interface state: connect(9)] - cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: N/A] sim status: DETECTING [imsi: 208015606540916] [interface state: disconnect(1)] WARNING: cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: N/A] sim status: OK [imsi: 208015606540916] [interface state: disconnect(1)] | 'modules.cellradio.detected.count'=3;;;0; '359072066403821~N/A#module.cellradio.rsrp.dbm'=-114;;;0; '359072066403821~N/A#module.cellradio.rsrq.dbm'=-18;;;0; '359072066403821~N/A#module.cellradio.snr.db'=-1;;;0; '359072066403821~N/A#module.cellradio.csq.dbm'=-73;;;0; '359072066403821~PHENIX#module.cellradio.rsrp.dbm'=-114;;;0; '359072066403821~PHENIX#module.cellradio.rsrq.dbm'=-18;;;0; '359072066403821~PHENIX#module.cellradio.snr.db'=-1;;;0; '359072066403821~PHENIX#module.cellradio.csq.dbm'=-73;;;0;
# Test cellsradio mode with custom-perfdata-instances option set to '%(cellId) %(simIcc)'
&{teldat_cellsradio_test4}
... filtercellid=
... customperfdatainstances='%(cellId) %(simIcc)'
... unknownstatus=
... warningstatus=
... criticalstatus=
... warningmodulescellradiodetected=
... criticalmodulescellradiodetected=
... warningmodulecellradiorsrp=
... criticalmodulecellradiorsrp=
... warningmodulecellradiorsrq=
... criticalmodulecellradiorsrq=
... warningmodulecellradiorscp=
... criticalmodulecellradiorscp=
... warningmodulecellradiocsq=
... criticalmodulecellradiocsq=
... warningmodulecellradiosnr=
... criticalmodulecellradiosnr=
... result=CRITICAL: cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: PHENIX] sim status: LOCKED [imsi: 208015606540916] [interface state: connect(9)] - cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: N/A] sim status: DETECTING [imsi: 208015606540916] [interface state: disconnect(1)] WARNING: cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: N/A] sim status: OK [imsi: 208015606540916] [interface state: disconnect(1)] | 'modules.cellradio.detected.count'=3;;;0; '359072066403821~89330122115801091660#module.cellradio.rsrp.dbm'=-114;;;0; '359072066403821~89330122115801091660#module.cellradio.rsrq.dbm'=-18;;;0; '359072066403821~89330122115801091660#module.cellradio.snr.db'=-1;;;0; '359072066403821~89330122115801091660#module.cellradio.csq.dbm'=-73;;;0; '359072066403821~89330122115801091660#module.cellradio.rsrp.dbm'=-114;;;0; '359072066403821~89330122115801091660#module.cellradio.rsrq.dbm'=-18;;;0; '359072066403821~89330122115801091660#module.cellradio.snr.db'=-1;;;0; '359072066403821~89330122115801091660#module.cellradio.csq.dbm'=-73;;;0;
# Test cellsradio mode with warning-modules-cellradio-detected option set to a 2
&{teldat_cellsradio_test5}
... filtercellid=
... customperfdatainstances=
... unknownstatus=
... warningstatus=
... criticalstatus=
... warningmodulescellradiodetected=2
... criticalmodulescellradiodetected=
... warningmodulecellradiorsrp=
... criticalmodulecellradiorsrp=
... warningmodulecellradiorsrq=
... criticalmodulecellradiorsrq=
... warningmodulecellradiorscp=
... criticalmodulecellradiorscp=
... warningmodulecellradiocsq=
... criticalmodulecellradiocsq=
... warningmodulecellradiosnr=
... criticalmodulecellradiosnr=
... result=CRITICAL: cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: PHENIX] sim status: LOCKED [imsi: 208015606540916] [interface state: connect(9)] - cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: N/A] sim status: DETECTING [imsi: 208015606540916] [interface state: disconnect(1)] WARNING: Number of cellular radio modules detected: 3 - cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: N/A] sim status: OK [imsi: 208015606540916] [interface state: disconnect(1)] | 'modules.cellradio.detected.count'=3;0:2;;0; '359072066403821~N/A#module.cellradio.rsrp.dbm'=-114;;;0; '359072066403821~N/A#module.cellradio.rsrq.dbm'=-18;;;0; '359072066403821~N/A#module.cellradio.snr.db'=-1;;;0; '359072066403821~N/A#module.cellradio.csq.dbm'=-73;;;0; '359072066403821~PHENIX#module.cellradio.rsrp.dbm'=-114;;;0; '359072066403821~PHENIX#module.cellradio.rsrq.dbm'=-18;;;0; '359072066403821~PHENIX#module.cellradio.snr.db'=-1;;;0; '359072066403821~PHENIX#module.cellradio.csq.dbm'=-73;;;0;
# Test cellsradio mode with critical-modules-cellradio-detected option set to a 2
&{teldat_cellsradio_test6}
... filtercellid=
... customperfdatainstances=
... unknownstatus=
... warningstatus=
... criticalstatus=
... warningmodulescellradiodetected=
... criticalmodulescellradiodetected=2
... warningmodulecellradiorsrp=
... criticalmodulecellradiorsrp=
... warningmodulecellradiorsrq=
... criticalmodulecellradiorsrq=
... warningmodulecellradiorscp=
... criticalmodulecellradiorscp=
... warningmodulecellradiocsq=
... criticalmodulecellradiocsq=
... warningmodulecellradiosnr=
... criticalmodulecellradiosnr=
... result=CRITICAL: Number of cellular radio modules detected: 3 - cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: PHENIX] sim status: LOCKED [imsi: 208015606540916] [interface state: connect(9)] - cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: N/A] sim status: DETECTING [imsi: 208015606540916] [interface state: disconnect(1)] WARNING: cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: N/A] sim status: OK [imsi: 208015606540916] [interface state: disconnect(1)] | 'modules.cellradio.detected.count'=3;;0:2;0; '359072066403821~N/A#module.cellradio.rsrp.dbm'=-114;;;0; '359072066403821~N/A#module.cellradio.rsrq.dbm'=-18;;;0; '359072066403821~N/A#module.cellradio.snr.db'=-1;;;0; '359072066403821~N/A#module.cellradio.csq.dbm'=-73;;;0; '359072066403821~PHENIX#module.cellradio.rsrp.dbm'=-114;;;0; '359072066403821~PHENIX#module.cellradio.rsrq.dbm'=-18;;;0; '359072066403821~PHENIX#module.cellradio.snr.db'=-1;;;0; '359072066403821~PHENIX#module.cellradio.csq.dbm'=-73;;;0;
# Test cellsradio mode with warning-module-cellradio-rsrp option set to a -100
&{teldat_cellsradio_test7}
... filtercellid=
... customperfdatainstances=
... unknownstatus=
... warningstatus=
... criticalstatus=
... warningmodulescellradiodetected=
... criticalmodulescellradiodetected=
... warningmodulecellradiorsrp=-100
... criticalmodulecellradiorsrp=
... warningmodulecellradiorsrq=
... criticalmodulecellradiorsrq=
... warningmodulecellradiorscp=
... criticalmodulecellradiorscp=
... warningmodulecellradiocsq=
... criticalmodulecellradiocsq=
... warningmodulecellradiosnr=
... criticalmodulecellradiosnr=
... result=CRITICAL: cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: PHENIX] sim status: LOCKED [imsi: 208015606540916] [interface state: connect(9)] - cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: N/A] sim status: DETECTING [imsi: 208015606540916] [interface state: disconnect(1)] WARNING: cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: N/A] sim status: OK [imsi: 208015606540916] [interface state: disconnect(1)] - rsrp: -114 dBm - cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: PHENIX] rsrp: -114 dBm | 'modules.cellradio.detected.count'=3;;;0; '359072066403821~N/A#module.cellradio.rsrp.dbm'=-114;0:-100;;0; '359072066403821~N/A#module.cellradio.rsrq.dbm'=-18;;;0; '359072066403821~N/A#module.cellradio.snr.db'=-1;;;0; '359072066403821~N/A#module.cellradio.csq.dbm'=-73;;;0; '359072066403821~PHENIX#module.cellradio.rsrp.dbm'=-114;0:-100;;0; '359072066403821~PHENIX#module.cellradio.rsrq.dbm'=-18;;;0; '359072066403821~PHENIX#module.cellradio.snr.db'=-1;;;0; '359072066403821~PHENIX#module.cellradio.csq.dbm'=-73;;;0;
# Test cellsradio mode with critical-module-cellradio-rsrp option set to a -100
&{teldat_cellsradio_test8}
... filtercellid=
... customperfdatainstances=
... unknownstatus=
... warningstatus=
... criticalstatus=
... warningmodulescellradiodetected=
... criticalmodulescellradiodetected=
... warningmodulecellradiorsrp=
... criticalmodulecellradiorsrp=-100
... warningmodulecellradiorsrq=
... criticalmodulecellradiorsrq=
... warningmodulecellradiorscp=
... criticalmodulecellradiorscp=
... warningmodulecellradiocsq=
... criticalmodulecellradiocsq=
... warningmodulecellradiosnr=
... criticalmodulecellradiosnr=
... result=CRITICAL: cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: N/A] rsrp: -114 dBm - cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: PHENIX] sim status: LOCKED [imsi: 208015606540916] [interface state: connect(9)] - rsrp: -114 dBm - cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: N/A] sim status: DETECTING [imsi: 208015606540916] [interface state: disconnect(1)] WARNING: cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: N/A] sim status: OK [imsi: 208015606540916] [interface state: disconnect(1)] | 'modules.cellradio.detected.count'=3;;;0; '359072066403821~N/A#module.cellradio.rsrp.dbm'=-114;;0:-100;0; '359072066403821~N/A#module.cellradio.rsrq.dbm'=-18;;;0; '359072066403821~N/A#module.cellradio.snr.db'=-1;;;0; '359072066403821~N/A#module.cellradio.csq.dbm'=-73;;;0; '359072066403821~PHENIX#module.cellradio.rsrp.dbm'=-114;;0:-100;0; '359072066403821~PHENIX#module.cellradio.rsrq.dbm'=-18;;;0; '359072066403821~PHENIX#module.cellradio.snr.db'=-1;;;0; '359072066403821~PHENIX#module.cellradio.csq.dbm'=-73;;;0;
# Test cellsradio mode with warning-module-cellradio-rsrq option set to a -10
&{teldat_cellsradio_test9}
... filtercellid=
... customperfdatainstances=
... unknownstatus=
... warningstatus=
... criticalstatus=
... warningmodulescellradiodetected=
... criticalmodulescellradiodetected=
... warningmodulecellradiorsrp=
... criticalmodulecellradiorsrp=
... warningmodulecellradiorsrq=-10
... criticalmodulecellradiorsrq=
... warningmodulecellradiorscp=
... criticalmodulecellradiorscp=
... warningmodulecellradiocsq=
... criticalmodulecellradiocsq=
... warningmodulecellradiosnr=
... criticalmodulecellradiosnr=
... result=CRITICAL: cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: PHENIX] sim status: LOCKED [imsi: 208015606540916] [interface state: connect(9)] - cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: N/A] sim status: DETECTING [imsi: 208015606540916] [interface state: disconnect(1)] WARNING: cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: N/A] sim status: OK [imsi: 208015606540916] [interface state: disconnect(1)] - rsrq: -18 dBm - cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: PHENIX] rsrq: -18 dBm | 'modules.cellradio.detected.count'=3;;;0; '359072066403821~N/A#module.cellradio.rsrp.dbm'=-114;;;0; '359072066403821~N/A#module.cellradio.rsrq.dbm'=-18;0:-10;;0; '359072066403821~N/A#module.cellradio.snr.db'=-1;;;0; '359072066403821~N/A#module.cellradio.csq.dbm'=-73;;;0; '359072066403821~PHENIX#module.cellradio.rsrp.dbm'=-114;;;0; '359072066403821~PHENIX#module.cellradio.rsrq.dbm'=-18;0:-10;;0; '359072066403821~PHENIX#module.cellradio.snr.db'=-1;;;0; '359072066403821~PHENIX#module.cellradio.csq.dbm'=-73;;;0;
# Test cellsradio mode with critical-module-cellradio-rsrq option set to a -10
&{teldat_cellsradio_test10}
... filtercellid=
... customperfdatainstances=
... unknownstatus=
... warningstatus=
... criticalstatus=
... warningmodulescellradiodetected=
... criticalmodulescellradiodetected=
... warningmodulecellradiorsrp=
... criticalmodulecellradiorsrp=
... warningmodulecellradiorsrq=
... criticalmodulecellradiorsrq=-10
... warningmodulecellradiorscp=
... criticalmodulecellradiorscp=
... warningmodulecellradiocsq=
... criticalmodulecellradiocsq=
... warningmodulecellradiosnr=
... criticalmodulecellradiosnr=
... result=CRITICAL: cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: N/A] rsrq: -18 dBm - cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: PHENIX] sim status: LOCKED [imsi: 208015606540916] [interface state: connect(9)] - rsrq: -18 dBm - cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: N/A] sim status: DETECTING [imsi: 208015606540916] [interface state: disconnect(1)] WARNING: cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: N/A] sim status: OK [imsi: 208015606540916] [interface state: disconnect(1)] | 'modules.cellradio.detected.count'=3;;;0; '359072066403821~N/A#module.cellradio.rsrp.dbm'=-114;;;0; '359072066403821~N/A#module.cellradio.rsrq.dbm'=-18;;0:-10;0; '359072066403821~N/A#module.cellradio.snr.db'=-1;;;0; '359072066403821~N/A#module.cellradio.csq.dbm'=-73;;;0; '359072066403821~PHENIX#module.cellradio.rsrp.dbm'=-114;;;0; '359072066403821~PHENIX#module.cellradio.rsrq.dbm'=-18;;0:-10;0; '359072066403821~PHENIX#module.cellradio.snr.db'=-1;;;0; '359072066403821~PHENIX#module.cellradio.csq.dbm'=-73;;;0;
# Test cellsradio mode with warning-module-cellradio-csq option set to a -10
&{teldat_cellsradio_test11}
... filtercellid=
... customperfdatainstances=
... unknownstatus=
... warningstatus=
... criticalstatus=
... warningmodulescellradiodetected=
... criticalmodulescellradiodetected=
... warningmodulecellradiorsrp=
... criticalmodulecellradiorsrp=
... warningmodulecellradiorsrq=
... criticalmodulecellradiorsrq=
... warningmodulecellradiorscp=
... criticalmodulecellradiorscp=
... warningmodulecellradiocsq=-10
... criticalmodulecellradiocsq=
... warningmodulecellradiosnr=
... criticalmodulecellradiosnr=
... result=CRITICAL: cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: PHENIX] sim status: LOCKED [imsi: 208015606540916] [interface state: connect(9)] - cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: N/A] sim status: DETECTING [imsi: 208015606540916] [interface state: disconnect(1)] WARNING: cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: N/A] sim status: OK [imsi: 208015606540916] [interface state: disconnect(1)] - csq: -73 dBm - cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: PHENIX] csq: -73 dBm | 'modules.cellradio.detected.count'=3;;;0; '359072066403821~N/A#module.cellradio.rsrp.dbm'=-114;;;0; '359072066403821~N/A#module.cellradio.rsrq.dbm'=-18;;;0; '359072066403821~N/A#module.cellradio.snr.db'=-1;;;0; '359072066403821~N/A#module.cellradio.csq.dbm'=-73;0:-10;;0; '359072066403821~PHENIX#module.cellradio.rsrp.dbm'=-114;;;0; '359072066403821~PHENIX#module.cellradio.rsrq.dbm'=-18;;;0; '359072066403821~PHENIX#module.cellradio.snr.db'=-1;;;0; '359072066403821~PHENIX#module.cellradio.csq.dbm'=-73;0:-10;;0;
# Test cellsradio mode with critical-module-cellradio-csq option set to a -10
&{teldat_cellsradio_test12}
... filtercellid=
... customperfdatainstances=
... unknownstatus=
... warningstatus=
... criticalstatus=
... warningmodulescellradiodetected=
... criticalmodulescellradiodetected=
... warningmodulecellradiorsrp=
... criticalmodulecellradiorsrp=
... warningmodulecellradiorsrq=
... criticalmodulecellradiorsrq=
... warningmodulecellradiorscp=
... criticalmodulecellradiorscp=
... warningmodulecellradiocsq=
... criticalmodulecellradiocsq=-10
... warningmodulecellradiosnr=
... criticalmodulecellradiosnr=
... result=CRITICAL: cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: N/A] csq: -73 dBm - cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: PHENIX] sim status: LOCKED [imsi: 208015606540916] [interface state: connect(9)] - csq: -73 dBm - cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: N/A] sim status: DETECTING [imsi: 208015606540916] [interface state: disconnect(1)] WARNING: cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: N/A] sim status: OK [imsi: 208015606540916] [interface state: disconnect(1)] | 'modules.cellradio.detected.count'=3;;;0; '359072066403821~N/A#module.cellradio.rsrp.dbm'=-114;;;0; '359072066403821~N/A#module.cellradio.rsrq.dbm'=-18;;;0; '359072066403821~N/A#module.cellradio.snr.db'=-1;;;0; '359072066403821~N/A#module.cellradio.csq.dbm'=-73;;0:-10;0; '359072066403821~PHENIX#module.cellradio.rsrp.dbm'=-114;;;0; '359072066403821~PHENIX#module.cellradio.rsrq.dbm'=-18;;;0; '359072066403821~PHENIX#module.cellradio.snr.db'=-1;;;0; '359072066403821~PHENIX#module.cellradio.csq.dbm'=-73;;0:-10;0;
# Test cellsradio mode with warning-module-cellradio-snr option set to a 0
&{teldat_cellsradio_test13}
... filtercellid=
... customperfdatainstances=
... unknownstatus=
... warningstatus=
... criticalstatus=
... warningmodulescellradiodetected=
... criticalmodulescellradiodetected=
... warningmodulecellradiorsrp=
... criticalmodulecellradiorsrp=
... warningmodulecellradiorsrq=
... criticalmodulecellradiorsrq=
... warningmodulecellradiorscp=
... criticalmodulecellradiorscp=
... warningmodulecellradiocsq=
... criticalmodulecellradiocsq=
... warningmodulecellradiosnr=0
... criticalmodulecellradiosnr=
... result=CRITICAL: cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: PHENIX] sim status: LOCKED [imsi: 208015606540916] [interface state: connect(9)] - cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: N/A] sim status: DETECTING [imsi: 208015606540916] [interface state: disconnect(1)] WARNING: cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: N/A] sim status: OK [imsi: 208015606540916] [interface state: disconnect(1)] - snr: -1 dB - cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: PHENIX] snr: -1 dB | 'modules.cellradio.detected.count'=3;;;0; '359072066403821~N/A#module.cellradio.rsrp.dbm'=-114;;;0; '359072066403821~N/A#module.cellradio.rsrq.dbm'=-18;;;0; '359072066403821~N/A#module.cellradio.snr.db'=-1;0:0;;0; '359072066403821~N/A#module.cellradio.csq.dbm'=-73;;;0; '359072066403821~PHENIX#module.cellradio.rsrp.dbm'=-114;;;0; '359072066403821~PHENIX#module.cellradio.rsrq.dbm'=-18;;;0; '359072066403821~PHENIX#module.cellradio.snr.db'=-1;0:0;;0; '359072066403821~PHENIX#module.cellradio.csq.dbm'=-73;;;0;
# Test cellsradio mode with critical-module-cellradio-snr option set to a 0
&{teldat_cellsradio_test14}
... filtercellid=
... customperfdatainstances=
... unknownstatus=
... warningstatus=
... criticalstatus=
... warningmodulescellradiodetected=
... criticalmodulescellradiodetected=
... warningmodulecellradiorsrp=
... criticalmodulecellradiorsrp=
... warningmodulecellradiorsrq=
... criticalmodulecellradiorsrq=
... warningmodulecellradiorscp=
... criticalmodulecellradiorscp=
... warningmodulecellradiocsq=
... criticalmodulecellradiocsq=
... warningmodulecellradiosnr=
... criticalmodulecellradiosnr=0
... result=CRITICAL: cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: N/A] snr: -1 dB - cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: PHENIX] sim status: LOCKED [imsi: 208015606540916] [interface state: connect(9)] - snr: -1 dB - cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: N/A] sim status: DETECTING [imsi: 208015606540916] [interface state: disconnect(1)] WARNING: cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: N/A] sim status: OK [imsi: 208015606540916] [interface state: disconnect(1)] | 'modules.cellradio.detected.count'=3;;;0; '359072066403821~N/A#module.cellradio.rsrp.dbm'=-114;;;0; '359072066403821~N/A#module.cellradio.rsrq.dbm'=-18;;;0; '359072066403821~N/A#module.cellradio.snr.db'=-1;;0:0;0; '359072066403821~N/A#module.cellradio.csq.dbm'=-73;;;0; '359072066403821~PHENIX#module.cellradio.rsrp.dbm'=-114;;;0; '359072066403821~PHENIX#module.cellradio.rsrq.dbm'=-18;;;0; '359072066403821~PHENIX#module.cellradio.snr.db'=-1;;0:0;0; '359072066403821~PHENIX#module.cellradio.csq.dbm'=-73;;;0;
# Test cellsradio mode with critical-status option set to '%{interfaceState} =~ /disconnect/'
&{teldat_cellsradio_test15}
... filtercellid=
... customperfdatainstances=
... unknownstatus=
... warningstatus=
... criticalstatus='\%{interfaceState} =~ /disconnect/'
... warningmodulescellradiodetected=
... criticalmodulescellradiodetected=
... warningmodulecellradiorsrp=
... criticalmodulecellradiorsrp=
... warningmodulecellradiorsrq=
... criticalmodulecellradiorsrq=
... warningmodulecellradiorscp=
... criticalmodulecellradiorscp=
... warningmodulecellradiocsq=
... criticalmodulecellradiocsq=
... warningmodulecellradiosnr=
... criticalmodulecellradiosnr=
... result=CRITICAL: cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: N/A] sim status: OK [imsi: 208015606540916] [interface state: disconnect(1)] - cellular radio module '359072066403821' [sim icc: 89330122115801091660, operator: N/A] sim status: DETECTING [imsi: 208015606540916] [interface state: disconnect(1)] | 'modules.cellradio.detected.count'=3;;;0; '359072066403821~N/A#module.cellradio.rsrp.dbm'=-114;;;0; '359072066403821~N/A#module.cellradio.rsrq.dbm'=-18;;;0; '359072066403821~N/A#module.cellradio.snr.db'=-1;;;0; '359072066403821~N/A#module.cellradio.csq.dbm'=-73;;;0; '359072066403821~PHENIX#module.cellradio.rsrp.dbm'=-114;;;0; '359072066403821~PHENIX#module.cellradio.rsrq.dbm'=-18;;;0; '359072066403821~PHENIX#module.cellradio.snr.db'=-1;;;0; '359072066403821~PHENIX#module.cellradio.csq.dbm'=-73;;;0;
@{teldat_cellsradio_tests}
... &{teldat_cellsradio_test1}
... &{teldat_cellsradio_test2}
... &{teldat_cellsradio_test3}
... &{teldat_cellsradio_test4}
... &{teldat_cellsradio_test5}
... &{teldat_cellsradio_test6}
... &{teldat_cellsradio_test7}
... &{teldat_cellsradio_test8}
... &{teldat_cellsradio_test9}
... &{teldat_cellsradio_test10}
... &{teldat_cellsradio_test11}
... &{teldat_cellsradio_test12}
... &{teldat_cellsradio_test13}
... &{teldat_cellsradio_test14}
... &{teldat_cellsradio_test15}
# Test simple usage of the CPU mode # Test simple usage of the CPU mode
&{teldat_cpu_test1} &{teldat_cpu_test1}
... warningcpuutilization5s= ... warningcpuutilization5s=
@ -501,120 +169,6 @@ ${CMD} ${CENTREON_PLUGINS} --plugin=network::teldat::sn
*** Test Cases *** *** Test Cases ***
Network Teldat SNMP cells radio
[Documentation] Network Teldat SNMP cells radio
[Tags] network teldat snmp
FOR ${teldat_cellsradio_test} IN @{teldat_cellsradio_tests}
${command} Catenate
... ${CMD}
... --mode=cells-radio
... --hostname=127.0.0.1
... --snmp-version=2c
... --snmp-port=2024
... --snmp-community=network/teldat/snmp/teldat
${length} Get Length ${teldat_cellsradio_test.filtercellid}
IF ${length} > 0
${command} Catenate ${command} --filter-cell-id=${teldat_cellsradio_test.filtercellid}
END
${length} Get Length ${teldat_cellsradio_test.customperfdatainstances}
IF ${length} > 0
${command} Catenate
... ${command}
... --custom-perfdata-instances=${teldat_cellsradio_test.customperfdatainstances}
END
${length} Get Length ${teldat_cellsradio_test.unknownstatus}
IF ${length} > 0
${command} Catenate ${command} --unknown-status=${teldat_cellsradio_test.unknownstatus}
END
${length} Get Length ${teldat_cellsradio_test.warningstatus}
IF ${length} > 0
${command} Catenate ${command} --warning-status=${teldat_cellsradio_test.warningstatus}
END
${length} Get Length ${teldat_cellsradio_test.criticalstatus}
IF ${length} > 0
${command} Catenate ${command} --critical-status=${teldat_cellsradio_test.criticalstatus}
END
${length} Get Length ${teldat_cellsradio_test.warningmodulescellradiodetected}
IF ${length} > 0
${command} Catenate
... ${command}
... --warning-modules-cellradio-detected=${teldat_cellsradio_test.warningmodulescellradiodetected}
END
${length} Get Length ${teldat_cellsradio_test.criticalmodulescellradiodetected}
IF ${length} > 0
${command} Catenate
... ${command}
... --critical-modules-cellradio-detected=${teldat_cellsradio_test.criticalmodulescellradiodetected}
END
${length} Get Length ${teldat_cellsradio_test.warningmodulecellradiorsrp}
IF ${length} > 0
${command} Catenate
... ${command}
... --warning-module-cellradio-rsrp=${teldat_cellsradio_test.warningmodulecellradiorsrp}
END
${length} Get Length ${teldat_cellsradio_test.criticalmodulecellradiorsrp}
IF ${length} > 0
${command} Catenate
... ${command}
... --critical-module-cellradio-rsrp=${teldat_cellsradio_test.criticalmodulecellradiorsrp}
END
${length} Get Length ${teldat_cellsradio_test.warningmodulecellradiorsrq}
IF ${length} > 0
${command} Catenate
... ${command}
... --warning-module-cellradio-rsrq=${teldat_cellsradio_test.warningmodulecellradiorsrq}
END
${length} Get Length ${teldat_cellsradio_test.criticalmodulecellradiorsrq}
IF ${length} > 0
${command} Catenate
... ${command}
... --critical-module-cellradio-rsrq=${teldat_cellsradio_test.criticalmodulecellradiorsrq}
END
${length} Get Length ${teldat_cellsradio_test.warningmodulecellradiorscp}
IF ${length} > 0
${command} Catenate
... ${command}
... --warning-module-cellradio-rscp=${teldat_cellsradio_test.warningmodulecellradiorscp}
END
${length} Get Length ${teldat_cellsradio_test.criticalmodulecellradiorscp}
IF ${length} > 0
${command} Catenate
... ${command}
... --critical-module-cellradio-rscp=${teldat_cellsradio_test.criticalmodulecellradiorscp}
END
${length} Get Length ${teldat_cellsradio_test.warningmodulecellradiocsq}
IF ${length} > 0
${command} Catenate
... ${command}
... --warning-module-cellradio-csq=${teldat_cellsradio_test.warningmodulecellradiocsq}
END
${length} Get Length ${teldat_cellsradio_test.criticalmodulecellradiocsq}
IF ${length} > 0
${command} Catenate
... ${command}
... --critical-module-cellradio-csq=${teldat_cellsradio_test.criticalmodulecellradiocsq}
END
${length} Get Length ${teldat_cellsradio_test.warningmodulecellradiosnr}
IF ${length} > 0
${command} Catenate
... ${command}
... --warning-module-cellradio-snr=${teldat_cellsradio_test.warningmodulecellradiosnr}
END
${length} Get Length ${teldat_cellsradio_test.criticalmodulecellradiosnr}
IF ${length} > 0
${command} Catenate
... ${command}
... --critical-module-cellradio-snr=${teldat_cellsradio_test.criticalmodulecellradiosnr}
END
${output} Run ${command}
Log To Console . no_newline=true
${output} Strip String ${output}
Should Be Equal As Strings
... ${output}
... ${teldat_cellsradio_test.result}
... Wrong result output for:${\n}Command: ${\n}${command}${\n}${\n}Expected output: ${\n}${teldat_cellsradio_test.result}${\n}${\n}Obtained output:${\n}${output}${\n}${\n}${\n}
... values=False
END
Network Teldat SNMP CPU Network Teldat SNMP CPU
[Documentation] Network Teldat SNMP CPU [Documentation] Network Teldat SNMP CPU