new(packaging): nokia (formerly alcatel) isam snmp plugin (#5087)

Co-authored-by: Lucie Dubrunfaut <123162035+lucie-dubrunfaut@users.noreply.github.com>
REFS: CTOR-594
This commit is contained in:
omercier 2024-07-05 17:54:37 +02:00 committed by GitHub
parent 831abe58c7
commit 085040fe20
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 87 additions and 55 deletions

View File

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

View File

@ -0,0 +1,14 @@
{
"pkg_name": "centreon-plugin-Network-Nokia-Isam-Snmp",
"pkg_summary": "Centreon Plugin to monitor Nokia (formerly Alcatel) Isam devices",
"plugin_name": "centreon_nokia_isam_snmp.pl",
"files": [
"centreon/plugins/script_snmp.pm",
"centreon/plugins/snmp.pm",
"snmp_standard/mode/interfaces.pm",
"snmp_standard/mode/listinterfaces.pm",
"snmp_standard/mode/resources/",
"snmp_standard/mode/uptime.pm",
"network/nokia/isam/snmp/"
]
}

View File

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

View File

@ -18,11 +18,11 @@
# limitations under the License. # limitations under the License.
# #
package network::alcatel::isam::snmp::mode::components::cardtemperature; package network::nokia::isam::snmp::mode::components::cardtemperature;
use strict; use strict;
use warnings; use warnings;
use network::alcatel::isam::snmp::mode::components::resources qw($mapping_slot); use network::nokia::isam::snmp::mode::components::resources qw($mapping_slot);
my $oid_eqptBoardThermalSensorActualTemperature = '.1.3.6.1.4.1.637.61.1.23.10.1.2'; my $oid_eqptBoardThermalSensorActualTemperature = '.1.3.6.1.4.1.637.61.1.23.10.1.2';

View File

@ -18,7 +18,7 @@
# limitations under the License. # limitations under the License.
# #
package network::alcatel::isam::snmp::mode::components::resources; package network::nokia::isam::snmp::mode::components::resources;
use strict; use strict;
use warnings; use warnings;
@ -34,4 +34,4 @@ $mapping_slot = {
eqptBoardInventorySerialNumber => { oid => '.1.3.6.1.4.1.637.61.1.23.3.1.19' }, eqptBoardInventorySerialNumber => { oid => '.1.3.6.1.4.1.637.61.1.23.3.1.19' },
}; };
1; 1;

View File

@ -18,11 +18,11 @@
# limitations under the License. # limitations under the License.
# #
package network::alcatel::isam::snmp::mode::components::sfp; package network::nokia::isam::snmp::mode::components::sfp;
use strict; use strict;
use warnings; use warnings;
use network::alcatel::isam::snmp::mode::components::resources qw($mapping_slot); use network::nokia::isam::snmp::mode::components::resources qw($mapping_slot);
my %map_los = (1 => 'los', 2 => 'noLos', 3 => 'notAvailable'); my %map_los = (1 => 'los', 2 => 'noLos', 3 => 'notAvailable');

View File

@ -18,7 +18,7 @@
# limitations under the License. # limitations under the License.
# #
package network::alcatel::isam::snmp::mode::cpu; package network::nokia::isam::snmp::mode::cpu;
use base qw(centreon::plugins::templates::counter); use base qw(centreon::plugins::templates::counter);
@ -95,7 +95,7 @@ __END__
=head1 MODE =head1 MODE
Check CPU usages. Monitor the CPU usage.
=over 8 =over 8

View File

@ -18,7 +18,7 @@
# limitations under the License. # limitations under the License.
# #
package network::alcatel::isam::snmp::mode::hardware; package network::nokia::isam::snmp::mode::hardware;
use base qw(centreon::plugins::templates::hardware); use base qw(centreon::plugins::templates::hardware);
@ -40,7 +40,7 @@ sub set_system {
] ]
}; };
$self->{components_path} = 'network::alcatel::isam::snmp::mode::components'; $self->{components_path} = 'network::nokia::isam::snmp::mode::components';
$self->{components_module} = ['cardtemperature', 'sfp']; $self->{components_module} = ['cardtemperature', 'sfp'];
} }
@ -76,7 +76,7 @@ Check Hardware.
=item B<--component> =item B<--component>
Which component to check (default: '.*'). Define which component to check (default: '.*').
Can be: 'cardtemperature', 'sfp'. Can be: 'cardtemperature', 'sfp'.
=item B<--filter> =item B<--filter>
@ -88,7 +88,6 @@ You can also exclude items from specific instances: --filter=cardtemperature,108
Define the expected status if no components are found (default: critical). Define the expected status if no components are found (default: critical).
=item B<--threshold-overload> =item B<--threshold-overload>
Use this option to override the status returned by the plugin when the status label matches a regular expression (syntax: section,[instance,]status,regexp). Use this option to override the status returned by the plugin when the status label matches a regular expression (syntax: section,[instance,]status,regexp).
@ -96,13 +95,19 @@ Example: --threshold-overload='sfp,OK,^los$'
=item B<--warning> =item B<--warning>
Set warning threshold for 'sfp.temperature', 'cardtemperature' (syntax: type,regexp,threshold) Define the warning thresholds for an instance of a certain type of sensor.
Example: --warning='sfp.temperature,1.1,30' Syntax: <type>,<regexp>,<threshold>.
Supported types of sensors: 'sfp.temperature', 'cardtemperature'.
Instances are identified by the last two parts of the OID, separated by a period (example: 1.1) and are filtered as a regular expression.
Example: --warning='sfp.temperature,1\.1,30'
=item B<--critical> =item B<--critical>
Set critical threshold for 'sfp.temperature', 'cardtemperature' (syntax: type,regexp,threshold) Define the critical thresholds for an instance of a certain type of sensor.
Example: --warning='sfp.temperature,1.1,40' Syntax: <type>,<regexp>,<threshold>.
Supported types of sensors: 'sfp.temperature', 'cardtemperature'.
Instances are identified by the last two parts of the OID, separated by a period (example: 1.1) and are filtered as a regular expression.
Example: --critical='sfp.temperature,1\.1,40'
=back =back

View File

@ -18,7 +18,7 @@
# limitations under the License. # limitations under the License.
# #
package network::alcatel::isam::snmp::mode::hubsapusage; package network::nokia::isam::snmp::mode::hubsapusage;
use base qw(centreon::plugins::templates::counter); use base qw(centreon::plugins::templates::counter);
@ -334,7 +334,7 @@ sub manage_selection {
$self->{output}->option_exit(); $self->{output}->option_exit();
} }
my $has_cache_file = $self->{statefile_cache}->read(statefile => 'cache_alcatel_isam_' . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() . '_' . $self->{mode}); my $has_cache_file = $self->{statefile_cache}->read(statefile => 'cache_nokia_isam_' . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() . '_' . $self->{mode});
my $timestamp_cache = $self->{statefile_cache}->get(name => 'last_timestamp'); my $timestamp_cache = $self->{statefile_cache}->get(name => 'last_timestamp');
if ($has_cache_file == 0 || !defined($timestamp_cache) || if ($has_cache_file == 0 || !defined($timestamp_cache) ||
((time() - $timestamp_cache) > (($self->{option_results}->{reload_cache_time}) * 60))) { ((time() - $timestamp_cache) > (($self->{option_results}->{reload_cache_time}) * 60))) {
@ -404,7 +404,7 @@ sub manage_selection {
$self->{output}->option_exit(); $self->{output}->option_exit();
} }
$self->{cache_name} = 'alcatel_isam_' . $self->{mode} . '_' . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() . '_' . $self->{cache_name} = 'nokia_isam_' . $self->{mode} . '_' . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() . '_' .
(defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all')) . '_' . (defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all')) . '_' .
(defined($self->{option_results}->{filter_name}) ? md5_hex($self->{option_results}->{filter_name}) : md5_hex('all')); (defined($self->{option_results}->{filter_name}) ? md5_hex($self->{option_results}->{filter_name}) : md5_hex('all'));
} }
@ -415,62 +415,61 @@ __END__
=head1 MODE =head1 MODE
Check SAP QoS usage. Check Service Access Points (SAP) QoS usage.
=over 8 =over 8
=item B<--display-name> =item B<--display-name>
Display name (default: '%{SvcDescription}.%{IfName}.%{SapEncapName}'). Define the name to display (default: '%{SvcDescription}.%{IfName}.%{SapEncapName}').
Can also be: %{SapDescription}, %{SapPortId} Other available macros: %{SapDescription}, %{SapPortId}
=item B<--filter-name> =item B<--filter-name>
Filter by SAP name (can be a regexp). Filter by Service Access Point (SAP) name (can be a regexp).
=item B<--speed-in> =item B<--speed-in>
Set interface speed for incoming traffic (in Mb). Define the actual maximum incoming traffic speed you can have on the interfaces in megabits per second.
=item B<--speed-out> =item B<--speed-out>
Set interface speed for outgoing traffic (in Mb). Define the actual maximum outgoing traffic speed you can have on the interfaces in megabits per second.
=item B<--speed-total-in> =item B<--speed-total-in>
Set interface speed for total incoming traffic (in Mb). Define the actual maximum total incoming traffic speed you can have on the interfaces in megabits per second.
=item B<--speed-total-out> =item B<--speed-total-out>
Set interface speed for total outgoing traffic (in Mb). Define the actual maximum total outgoing traffic speed you can have on the interfaces in megabits per second.
=item B<--units-traffic> =item B<--units-traffic>
Units of thresholds for the traffic (default: '%') ('%', 'b/s'). Define the unit to use to apply to thresholds (default: '%') ('%', 'b/s').
=item B<--warning-status> =item B<--warning-status>
Set warning threshold for ib status. Define the conditions to match for the status to be WARNING.
You can use the following variables: %{admin}, %{status}, %{display} You can use the following variables: %{admin}, %{status}, %{display}
=item B<--critical-status> =item B<--critical-status>
Set critical threshold for ib status (default: '%{admin} =~ /up/i and %{status} !~ /up/i'). Define the conditions to match for the status to be CRITICAL.
Default: '%{admin} =~ /up/i and %{status} !~ /up/i'.
You can use the following variables: %{admin}, %{status}, %{display} You can use the following variables: %{admin}, %{status}, %{display}
=item B<--warning-*> =item B<--warning-*>
Warning threshold. Warning thresholds for: 'total-in-traffic', 'total-out-traffic', 'in-traffic', 'out-traffic'.
Can be: 'total-in-traffic', 'total-out-traffic', 'in-traffic', 'out-traffic'.
=item B<--critical-*> =item B<--critical-*>
Critical threshold. Critical thresholds for: 'total-in-traffic', 'total-out-traffic', 'in-traffic', 'out-traffic'.
Can be: 'total-in-traffic', 'total-out-traffic', 'in-traffic', 'out-traffic'.
=item B<--reload-cache-time> =item B<--reload-cache-time>
Time in seconds before reloading cache file (default: 300). Time in seconds before reloading the cache file (default: 300).
=back =back

View File

@ -18,7 +18,7 @@
# limitations under the License. # limitations under the License.
# #
package network::alcatel::isam::snmp::mode::listhubsap; package network::nokia::isam::snmp::mode::listhubsap;
use base qw(centreon::plugins::mode); use base qw(centreon::plugins::mode);
@ -137,7 +137,7 @@ __END__
=head1 MODE =head1 MODE
List SAP. List Service Access Points (SAP) for service discovery.
=over 8 =over 8

View File

@ -18,7 +18,7 @@
# limitations under the License. # limitations under the License.
# #
package network::alcatel::isam::snmp::mode::memory; package network::nokia::isam::snmp::mode::memory;
use base qw(centreon::plugins::templates::counter); use base qw(centreon::plugins::templates::counter);
@ -159,7 +159,7 @@ sub manage_selection {
my $name = $result->{eqptBoardInventorySerialNumber} . '_' . $result->{eqptSlotActualType}; my $name = $result->{eqptBoardInventorySerialNumber} . '_' . $result->{eqptSlotActualType};
if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' &&
$name !~ /$self->{option_results}->{filter_name}/) { $name !~ /$self->{option_results}->{filter_name}/) {
$self->{output}->output_add(long_msg => "skipping '" . $name . "': no matching filter.", debug => 1); $self->{output}->output_add(long_msg => "skipping '" . $name . "': not matching filter.", debug => 1);
next; next;
} }
$self->{memory}->{$name} = { display => $name, total => $result->{totalMemSize} * 1024 * 1024, used => $result->{memAbsoluteUsage} * 1024 * 1024 }; $self->{memory}->{$name} = { display => $name, total => $result->{totalMemSize} * 1024 * 1024, used => $result->{memAbsoluteUsage} * 1024 * 1024 };
@ -170,7 +170,7 @@ sub manage_selection {
my $name = 'SD Card'; my $name = 'SD Card';
if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' &&
$name !~ /$self->{option_results}->{filter_name}/) { $name !~ /$self->{option_results}->{filter_name}/) {
$self->{output}->output_add(long_msg => "skipping '" . $name . "': no matching filter.", debug => 1); $self->{output}->output_add(long_msg => "skipping '" . $name . "': not matching filter.", debug => 1);
} else { } else {
$self->{memory}->{$name} = { display => $name, total => $snmp_result->{$oid_asamSwmTotalSpaceOnFileDisk}, $self->{memory}->{$name} = { display => $name, total => $snmp_result->{$oid_asamSwmTotalSpaceOnFileDisk},
used => $snmp_result->{$oid_asamSwmTotalSpaceOnFileDisk} - $snmp_result->{$oid_asamSwmFreeSpaceOnFileDisk} }; used => $snmp_result->{$oid_asamSwmTotalSpaceOnFileDisk} - $snmp_result->{$oid_asamSwmFreeSpaceOnFileDisk} };
@ -189,17 +189,14 @@ __END__
=head1 MODE =head1 MODE
Check memory usages. Monitor memory usage.
=over 8 =over 8
=item B<--filter-name> =item B<--filter-name>
Filter memory name (can be a regexp). Define which memory component to monitor based on their name.
This option will be treated as a regular expression.
=item B<--filter-project>
Filter project name (can be a regexp).
=item B<--warning-usage> =item B<--warning-usage>
@ -211,11 +208,11 @@ Critical threshold.
=item B<--units> =item B<--units>
Units of thresholds (default: '%') ('%', 'B'). Define the unit to use to apply to thresholds (default: '%') ('%', 'B').
=item B<--free> =item B<--free>
Thresholds are on free space left. Apply the thresholds on free space left instead of on used space.
=back =back

View File

@ -18,7 +18,7 @@
# limitations under the License. # limitations under the License.
# #
package network::alcatel::isam::snmp::plugin; package network::nokia::isam::snmp::plugin;
use strict; use strict;
use warnings; use warnings;
@ -31,13 +31,14 @@ sub new {
$self->{version} = '1.0'; $self->{version} = '1.0';
%{$self->{modes}} = ( %{$self->{modes}} = (
'cpu' => 'network::alcatel::isam::snmp::mode::cpu', 'cpu' => 'network::nokia::isam::snmp::mode::cpu',
'hardware' => 'network::alcatel::isam::snmp::mode::hardware', 'hardware' => 'network::nokia::isam::snmp::mode::hardware',
'hub-sap-usage' => 'network::nokia::isam::snmp::mode::hubsapusage',
'interfaces' => 'snmp_standard::mode::interfaces', 'interfaces' => 'snmp_standard::mode::interfaces',
'list-hub-sap' => 'network::alcatel::isam::snmp::mode::listhubsap', 'list-hub-sap' => 'network::nokia::isam::snmp::mode::listhubsap',
'list-interfaces' => 'snmp_standard::mode::listinterfaces', 'list-interfaces' => 'snmp_standard::mode::listinterfaces',
'memory' => 'network::alcatel::isam::snmp::mode::memory', 'memory' => 'network::nokia::isam::snmp::mode::memory',
'hub-sap-usage' => 'network::alcatel::isam::snmp::mode::hubsapusage', 'uptime' => 'snmp_standard::mode::uptime',
); );
return $self; return $self;
@ -49,6 +50,6 @@ __END__
=head1 PLUGIN DESCRIPTION =head1 PLUGIN DESCRIPTION
Check Alcatel DSL ISAM Family (also ASAM) in SNMP. Monitor Nokia (formerly Alcatel) DSL ISAM devices (also ASAM) using SNMP.
=cut =cut

View File

@ -43,12 +43,15 @@
-NoLogo -NoLogo
2c 2c
ADSL ADSL
ASAM
Alcatel
Avigilon Avigilon
Centreon Centreon
Datacore Datacore
Fortigate Fortigate
Fortinet Fortinet
HashiCorp HashiCorp
ISAM
IpAddr IpAddr
Iwsva Iwsva
Loggly Loggly
@ -62,6 +65,7 @@ Nagios
Netscaler Netscaler
OID OID
PKCS1 PKCS1
QoS
RRDCached RRDCached
SNMP SNMP
SSH SSH
@ -76,6 +80,7 @@ VPN
WSMAN WSMAN
XPath XPath
api.meraki.com api.meraki.com
cardtemperature
connections-dhcp connections-dhcp
connections-dns connections-dns
deltaps deltaps
@ -104,6 +109,7 @@ powershell.exe
proto proto
psu psu
queue-messages-inflighted queue-messages-inflighted
sfp.temperature
space-usage-prct space-usage-prct
teampass teampass
timeframe timeframe