This commit is contained in:
garnier-quentin 2020-07-28 10:25:35 +02:00
parent f3b1d574c8
commit ee723b48da
140 changed files with 641 additions and 1006 deletions

View File

@ -28,8 +28,6 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(device)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
$self->{thresholds} = { $self->{thresholds} = {

View File

@ -28,7 +28,6 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(temperature|fan|voltage|misc)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan|voltage|misc)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan|voltage|misc)$';
$self->{cb_hook1} = 'get_version'; # before the loads $self->{cb_hook1} = 'get_version'; # before the loads

View File

@ -29,8 +29,6 @@ use apps::vmware::wsman::mode::components::resources qw($mapping_HealthState $ma
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} =
'^(omc_discretesensor|omc_fan|omc_psu|vmware_storageextent|vmware_controller|vmware_storagevolume|vmware_battery|vmware_sassataport|cim_card|cim_computersystem|cim_numericsensor|cim_memory|cim_processor|cim_recordlog)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(cim_numericsensor)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(cim_numericsensor)$';
$self->{cb_hook1} = 'get_type'; $self->{cb_hook1} = 'get_type';

View File

@ -28,7 +28,6 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(global|physicaldrive|subsystem|component|temperature)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -83,9 +82,7 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {});
{
});
return $self; return $self;
} }
@ -133,4 +130,4 @@ Example: --critical='temperature,.*,40'
=back =back
=cut =cut

View File

@ -28,8 +28,6 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(psu)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
$self->{thresholds} = { $self->{thresholds} = {
@ -55,9 +53,8 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {
{ });
});
return $self; return $self;
} }
@ -100,4 +97,4 @@ Example: --threshold-overload='psu,WARNING,not operational'
=back =back
=cut =cut

View File

@ -28,8 +28,6 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(fan|psu|module)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
$self->{thresholds} = { $self->{thresholds} = {
@ -102,4 +100,4 @@ Example: --threshold-overload='fan,OK,inactive'
=back =back
=cut =cut

View File

@ -28,7 +28,6 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(temperature|fan|psu|sysdrive|battery)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -96,9 +95,7 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {});
{
});
return $self; return $self;
} }

View File

@ -28,7 +28,6 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(temperature|fan|psu)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -70,9 +69,8 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options); my $self = $class->SUPER::new(package => __PACKAGE__, %options);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {
{ });
});
return $self; return $self;
} }

View File

@ -28,7 +28,6 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(alarm|fan|sim|slot|psu|temprature|pdrive|vdrive)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -82,9 +81,8 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options); my $self = $class->SUPER::new(package => __PACKAGE__, %options);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {
{ });
});
return $self; return $self;
} }

View File

@ -28,7 +28,6 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(raid|psu)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';

View File

@ -32,7 +32,6 @@ use centreon::common::cisco::smallbusiness::snmp::mode::components::resources qw
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(?:fan|psu|temperature)$';
$self->{regexp_threshold_numeric_check_section_option} = '^temperature$'; $self->{regexp_threshold_numeric_check_section_option} = '^temperature$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -44,13 +43,13 @@ sub set_system {
['warning', 'WARNING'], ['warning', 'WARNING'],
['critical', 'CRITICAL'], ['critical', 'CRITICAL'],
['shutdown', 'CRITICAL'], ['shutdown', 'CRITICAL'],
['notFunctioning', 'CRITICAL'], ['notFunctioning', 'CRITICAL']
], ],
temperature => [ temperature => [
['ok', 'OK'], ['ok', 'OK'],
['unavailable', 'OK'], ['unavailable', 'OK'],
['nonoperational', 'CRITICAL'], ['nonoperational', 'CRITICAL']
], ]
}; };
$self->{components_path} = 'centreon::common::cisco::smallbusiness::snmp::mode::components'; $self->{components_path} = 'centreon::common::cisco::smallbusiness::snmp::mode::components';
@ -82,8 +81,7 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options); my $self = $class->SUPER::new(package => __PACKAGE__, %options);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {});
});
return $self; return $self;
} }

View File

@ -29,7 +29,6 @@ use centreon::plugins::misc;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(fan|psu|temperature|voltage|module|physical|sensor)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature|voltage|sensor.*)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|voltage|sensor.*)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';

View File

@ -28,7 +28,6 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(fan|psu|temperature)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -70,9 +69,7 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options); my $self = $class->SUPER::new(package => __PACKAGE__, %options);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {});
{
});
return $self; return $self;
} }

View File

@ -28,8 +28,6 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(fan|lcc|psu|battery|memory|cpu|iomodule|cable)$';
$self->{cb_hook2} = 'navisphere_execute'; $self->{cb_hook2} = 'navisphere_execute';
$self->{thresholds} = { $self->{thresholds} = {
@ -89,10 +87,9 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {
{ 'getcrus-options:s' => { name => 'getcrus_options', default => '-all' }
"getcrus-options:s" => { name => 'getcrus_options', default => '-all' }, });
});
return $self; return $self;
} }
@ -129,4 +126,4 @@ If total (with skipped) is 0. (Default: 'critical' returns).
=back =back
=cut =cut

View File

@ -28,7 +28,6 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(psu|fan)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -68,11 +67,10 @@ 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;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {
{ });
});
return $self; return $self;
} }
@ -123,4 +121,4 @@ Set critical threshold for temperatures (syntax: type,instance,threshold)
Example: --critical='temperature,.*,40' Example: --critical='temperature,.*,40'
=back =back
=cut =cut

View File

@ -28,7 +28,6 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^sensors$';
$self->{regexp_threshold_numeric_check_section_option} = '^sensors$'; $self->{regexp_threshold_numeric_check_section_option} = '^sensors$';
$self->{cb_hook1} = 'get_system_information'; $self->{cb_hook1} = 'get_system_information';

View File

@ -28,7 +28,6 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(?:board|fan|psu|temperature)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(?:temperature)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(?:temperature)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';

View File

@ -28,7 +28,6 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(faultled)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(?:temperature)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(?:temperature)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';

View File

@ -28,8 +28,6 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(chassis|drive|changer|psu)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
$self->{thresholds} = { $self->{thresholds} = {
@ -77,9 +75,8 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {
{ });
});
return $self; return $self;
} }
@ -117,4 +114,4 @@ Example: --threshold-overload='chassis,CRITICAL,degraded'
=back =back
=cut =cut

View File

@ -28,8 +28,6 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(?:global|microphone|camera|nic|ptc|board)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
$self->{thresholds} = { $self->{thresholds} = {

View File

@ -32,7 +32,6 @@ use centreon::common::radlan::snmp::mode::components::resources qw(
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(?:fan|psu|temperature)$';
$self->{regexp_threshold_numeric_check_section_option} = '^temperature$'; $self->{regexp_threshold_numeric_check_section_option} = '^temperature$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';

View File

@ -28,7 +28,6 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(?:chassis|fan|temperature|psu|device)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(?:fan|temperature|psu)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(?:fan|temperature|psu)$';
$self->{cb_hook2} = 'execute_custom'; $self->{cb_hook2} = 'execute_custom';

View File

@ -28,8 +28,6 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(entity)$';
$self->{regexp_threshold_numeric_check_section_option} = $self->{regexp_threshold_numeric_check_section_option} =
'^(other|unknown|temperature|voltage|current|tachometer|counter|switch|lock|humidity|smokeDetection|presence|airFlow)$'; '^(other|unknown|temperature|voltage|current|tachometer|counter|switch|lock|humidity|smokeDetection|presence|airFlow)$';
@ -63,9 +61,7 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {});
{
});
return $self; return $self;
} }
@ -113,4 +109,4 @@ Example: --critical='temperature,.*,30'
=back =back
=cut =cut

View File

@ -28,7 +28,6 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(vimm|ca|psu|fan|gfc|lfc)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';

View File

@ -28,10 +28,6 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
# To check with a regexp
#$self->{regexp_threshold_overload_check_section_option} = '';
#$self->{cb_threshold_overload_check_section_option} = 'callbackname';
#$self->{regexp_threshold_numeric_check_section_option} = ''; #$self->{regexp_threshold_numeric_check_section_option} = '';
#$self->{cb_threshold_numeric_check_section_option} = 'callbackname'; #$self->{cb_threshold_numeric_check_section_option} = 'callbackname';
@ -92,7 +88,7 @@ sub new {
if ($self->{performance} == 1) { if ($self->{performance} == 1) {
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {
'warning:s@' => { name => 'warning' }, 'warning:s@' => { name => 'warning' },
'critical:s@' => { name => 'critical' }, 'critical:s@' => { name => 'critical' }
}); });
} }
@ -101,14 +97,14 @@ sub new {
if ($self->{filter_exclude} == 1) { if ($self->{filter_exclude} == 1) {
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {
'exclude:s' => { name => 'exclude' }, 'exclude:s' => { name => 'exclude' },
'filter:s@' => { name => 'filter' }, 'filter:s@' => { name => 'filter' }
}); });
} }
$self->{absent} = (defined($options{no_absent}) && $options{no_absent} == 1) ? $self->{absent} = (defined($options{no_absent}) && $options{no_absent} == 1) ?
0 : 1; 0 : 1;
if ($self->{absent} == 1) { if ($self->{absent} == 1) {
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {
'absent-problem:s@' => { name => 'absent_problem' }, 'absent-problem:s@' => { name => 'absent_problem' }
}); });
} }
@ -126,7 +122,7 @@ sub new {
foreach my $component (@{$self->{components_module}}) { foreach my $component (@{$self->{components_module}}) {
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {
'warning-count-' . $component . ':s' => { name => 'warning_count_' . $component }, 'warning-count-' . $component . ':s' => { name => 'warning_count_' . $component },
'critical-count-' . $component . ':s' => { name => 'critical_count_' . $component }, 'critical-count-' . $component . ':s' => { name => 'critical_count_' . $component }
}); });
} }
} }
@ -181,23 +177,12 @@ sub check_options {
} else { } else {
($section, $instance, $status, $filter) = @values; ($section, $instance, $status, $filter) = @values;
} }
if (defined($self->{regexp_threshold_overload_check_section_option}) &&
$section !~ /$self->{regexp_threshold_overload_check_section_option}/) {
$self->{output}->add_option_msg(short_msg => "Wrong threshold-overload section '" . $val . "'.");
$self->{output}->option_exit();
}
$self->call_object_callback(
method_name => $self->{cb_threshold_overload_check_section_option},
section => $section,
option_value => $val
);
if ($self->{output}->is_litteral_status(status => $status) == 0) { if ($self->{output}->is_litteral_status(status => $status) == 0) {
$self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'.");
$self->{output}->option_exit(); $self->{output}->option_exit();
} }
$self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); push @{$self->{overload_th}}, { section => $section, filter => $filter, status => $status, instance => $instance };
push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status, instance => $instance };
} }
if ($self->{performance} == 1) { if ($self->{performance} == 1) {
@ -466,9 +451,9 @@ sub get_severity {
my ($self, %options) = @_; my ($self, %options) = @_;
my $status = 'UNKNOWN'; # default my $status = 'UNKNOWN'; # default
if (defined($self->{overload_th}->{$options{section}})) { foreach (@{$self->{overload_th}}) {
foreach (@{$self->{overload_th}->{$options{section}}}) { if ($options{section} =~ /$_->{section}/i) {
if ($options{value} =~ /$_->{filter}/i && if ($options{value} =~ /$_->{filter}/i &&
(!defined($options{instance}) || $options{instance} =~ /$_->{instance}/)) { (!defined($options{instance}) || $options{instance} =~ /$_->{instance}/)) {
$status = $_->{status}; $status = $_->{status};
return $status; return $status;

View File

@ -108,7 +108,7 @@ sub check_options {
$self->{psql_cmd} = $self->{option_results}->{psql_cmd}; $self->{psql_cmd} = $self->{option_results}->{psql_cmd};
# If we want a command line: password with variable "PGPASSWORD". # If we want a command line: password with variable "PGPASSWORD".
# psql -d template1 -A -R '-====-' -F '#====#' -c "select code from films" # psql -d template1 -A -R "-====-" -F "#====#" -c "select code from films"
if (!defined($self->{host}) || $self->{host} eq '') { if (!defined($self->{host}) || $self->{host} eq '') {
$self->{output}->add_option_msg(short_msg => "Need to specify host argument."); $self->{output}->add_option_msg(short_msg => "Need to specify host argument.");
@ -182,21 +182,13 @@ sub quote {
sub command_execution { sub command_execution {
my ($self, %options) = @_; my ($self, %options) = @_;
my ($lerror, $stdout, $exit_code) = centreon::plugins::misc::backtick( my ($stdout, $exit_code) = centreon::plugins::misc::execute(
command => $self->{psql_cmd}, command => $self->{psql_cmd},
arguments => [@{$self->{args}}, '-c', $options{request}], command_options => join(' ', @{$self->{args}}) . ' -c "' . $options{request} . '"',
timeout => 30, wait_exit => 1,
wait_exit => 1, redirect_stderr => 1,
redirect_stderr => 1 options => { timeout => 30 }
); );
if ($exit_code <= -1000) {
if ($exit_code == -1000) {
$self->{output}->output_add(severity => 'UNKNOWN',
short_msg => $stdout);
}
$self->{output}->display();
$self->{output}->exit();
}
return ($exit_code, $stdout); return ($exit_code, $stdout);
} }

View File

@ -28,8 +28,6 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(entity)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
$self->{thresholds} = { $self->{thresholds} = {
@ -46,8 +44,8 @@ sub set_system {
['fail', 'CRITICAL'], ['fail', 'CRITICAL'],
['ok', 'OK'], ['ok', 'OK'],
['inSync', 'OK'], ['inSync', 'OK'],
['outOfSync', 'CRITICAL'], ['outOfSync', 'CRITICAL']
], ]
}; };
$self->{components_path} = 'hardware::ats::apc::snmp::mode::components'; $self->{components_path} = 'hardware::ats::apc::snmp::mode::components';
@ -56,7 +54,7 @@ sub set_system {
sub snmp_execute { sub snmp_execute {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{snmp} = $options{snmp}; $self->{snmp} = $options{snmp};
$self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request});
} }
@ -65,11 +63,9 @@ sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {});
{
});
return $self; return $self;
} }
@ -106,4 +102,4 @@ Example: --threshold-overload='entity,SourceBStatus,WARNING,fail'
=back =back
=cut =cut

View File

@ -27,9 +27,7 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(simple|multiple)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
$self->{thresholds} = { $self->{thresholds} = {
@ -37,12 +35,12 @@ sub set_system {
['true', 'CRITICAL'], ['true', 'CRITICAL'],
['false', 'OK'], ['false', 'OK'],
['on', 'CRITICAL'], ['on', 'CRITICAL'],
['off', 'OK'], ['off', 'OK']
], ],
multiple => [ multiple => [
['true', 'CRITICAL'], ['true', 'CRITICAL'],
['false', 'OK'], ['false', 'OK']
], ]
}; };
$self->{components_path} = 'hardware::devices::aeg::acm::snmp::mode::components'; $self->{components_path} = 'hardware::devices::aeg::acm::snmp::mode::components';
@ -60,10 +58,9 @@ sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {});
});
return $self; return $self;
} }

View File

@ -27,19 +27,17 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^service|sdcard$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
$self->{thresholds} = { $self->{thresholds} = {
service => [ service => [
['low', 'OK'], ['low', 'OK'],
['high', 'CRITICAL'], ['high', 'CRITICAL']
], ],
sdcard => [ sdcard => [
['normal', 'OK'], ['normal', 'OK'],
['fail', 'CRITICAL'], ['fail', 'CRITICAL']
], ]
}; };
$self->{components_path} = 'hardware::devices::camera::hanwha::snmp::mode::components'; $self->{components_path} = 'hardware::devices::camera::hanwha::snmp::mode::components';
@ -58,9 +56,9 @@ sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1, no_performance => 1, no_absent => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1, no_performance => 1, no_absent => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => {}); $options{options}->add_options(arguments => {});
return $self; return $self;
} }

View File

@ -27,9 +27,7 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} =
'^(?:ad|aic|aoc|camera|st|software|temperature|vic|vis|voc|webex)';
$self->{regexp_threshold_numeric_check_section_option} = '^(?:aiclatency|aocdelay)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(?:aiclatency|aocdelay)$';
$self->{cb_hook2} = 'execute_custom'; $self->{cb_hook2} = 'execute_custom';
@ -38,16 +36,16 @@ sub set_system {
connection_status => [ connection_status => [
['NotConnected', 'OK'], ['NotConnected', 'OK'],
['Connected', 'OK'], ['Connected', 'OK'],
['Unknown', 'UNKNOWN'], ['Unknown', 'UNKNOWN']
], ],
connected => [ connected => [
['True', 'OK'], ['True', 'OK'],
['False', 'WARNING'], ['False', 'WARNING'],
['Unknown', 'UNKNOWN'], ['Unknown', 'UNKNOWN']
], ],
temperature => [ temperature => [
['Normal', 'OK'], ['Normal', 'OK'],
['.*', 'CRITICAL'], ['.*', 'CRITICAL']
], ],
software_status => [ software_status => [
['None', 'OK'], ['None', 'OK'],

View File

@ -28,8 +28,7 @@ use centreon::plugins::misc;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(hwstatus|temperature|memory)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature|memory)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|memory)$';
$self->{cb_hook2} = 'cmd_execute'; $self->{cb_hook2} = 'cmd_execute';
@ -37,8 +36,8 @@ sub set_system {
$self->{thresholds} = { $self->{thresholds} = {
hwstatus => [ hwstatus => [
['BATTERY OK', 'OK'], ['BATTERY OK', 'OK'],
['.*', 'CRITICAL'], ['.*', 'CRITICAL']
], ]
}; };
$self->{components_path} = 'hardware::devices::safenet::hsm::protecttoolkit::mode::components'; $self->{components_path} = 'hardware::devices::safenet::hsm::protecttoolkit::mode::components';
@ -48,12 +47,15 @@ sub set_system {
sub cmd_execute { sub cmd_execute {
my ($self, %options) = @_; my ($self, %options) = @_;
($self->{stdout}) = centreon::plugins::misc::execute(output => $self->{output}, ($self->{stdout}) = centreon::plugins::misc::execute(
options => $self->{option_results}, output => $self->{output},
sudo => $self->{option_results}->{sudo}, options => $self->{option_results},
command => $self->{option_results}->{command}, sudo => $self->{option_results}->{sudo},
command_path => $self->{option_results}->{command_path}, command => $self->{option_results}->{command},
command_options => $self->{option_results}->{command_options}); command_path => $self->{option_results}->{command_path},
command_options => $self->{option_results}->{command_options}
);
$self->{stdout} =~ s/\r//msg; $self->{stdout} =~ s/\r//msg;
my ($model, $firmware, $fm_status, $transport_mode, $security_mode) = ('unknown', 'unknown', 'unknown', 'unknown', 'unknown'); my ($model, $firmware, $fm_status, $transport_mode, $security_mode) = ('unknown', 'unknown', 'unknown', 'unknown', 'unknown');
$model = $1 if ($self->{stdout} =~ /^Model\s+:\s+(.*?)\s*\n/msi); $model = $1 if ($self->{stdout} =~ /^Model\s+:\s+(.*?)\s*\n/msi);
@ -68,30 +70,30 @@ sub cmd_execute {
sub display { sub display {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{output}->output_add(severity => 'OK', $self->{output}->output_add(
short_msg => sprintf("Hardware status is OK") severity => 'OK',
); short_msg => sprintf("Hardware status is OK")
);
} }
sub new { sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {
{ 'hostname:s' => { name => 'hostname' },
"hostname:s" => { name => 'hostname' }, 'remote' => { name => 'remote' },
"remote" => { name => 'remote' }, 'ssh-option:s@' => { name => 'ssh_option' },
"ssh-option:s@" => { name => 'ssh_option' }, 'ssh-path:s' => { name => 'ssh_path' },
"ssh-path:s" => { name => 'ssh_path' }, 'ssh-command:s' => { name => 'ssh_command', default => 'ssh' },
"ssh-command:s" => { name => 'ssh_command', default => 'ssh' }, 'timeout:s' => { name => 'timeout', default => 30 },
"timeout:s" => { name => 'timeout', default => 30 }, 'sudo' => { name => 'sudo' },
"sudo" => { name => 'sudo' }, 'command:s' => { name => 'command', default => 'ctconf' },
"command:s" => { name => 'command', default => 'ctconf' }, 'command-path:s' => { name => 'command_path' },
"command-path:s" => { name => 'command_path' }, 'command-options:s' => { name => 'command_options', default => '-v' }
"command-options:s" => { name => 'command_options', default => '-v' }, });
});
return $self; return $self;
} }

View File

@ -27,8 +27,6 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(video|fan|psu|temperature|audio|storage|casing)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature)$';
@ -37,35 +35,35 @@ sub set_system {
$self->{thresholds} = { $self->{thresholds} = {
video => [ video => [
['signalOk', 'OK'], ['signalOk', 'OK'],
['noSignal', 'CRITICAL'], ['noSignal', 'CRITICAL']
], ],
psu => [ psu => [
['failure', 'CRITICAL'], ['failure', 'CRITICAL']
['ok', 'OK'], ['ok', 'OK'],
], ],
fan => [ fan => [
['failed', 'CRITICAL'], ['failed', 'CRITICAL'],
['ok', 'OK'], ['ok', 'OK']
], ],
temperature => [ temperature => [
['failed', 'CRITICAL'], ['failed', 'CRITICAL'],
['outOfBoundary', 'CRITICAL'], ['outOfBoundary', 'CRITICAL'],
['ok', 'OK'], ['ok', 'OK']
], ],
audio => [ audio => [
['signalOk', 'OK'], ['signalOk', 'OK'],
['noSignal', 'CRITICAL'], ['noSignal', 'CRITICAL']
], ],
storage => [ storage => [
['yes', 'OK'], ['yes', 'OK'],
['no', 'CRITICAL'], ['no', 'CRITICAL']
], ],
casing => [ casing => [
['open', 'OK'], ['open', 'OK'],
['closed', 'WARNING'], ['closed', 'WARNING']
], ]
}; };
$self->{components_path} = 'hardware::devices::video::axis::snmp::mode::components'; $self->{components_path} = 'hardware::devices::video::axis::snmp::mode::components';
$self->{components_module} = ['video', 'psu', 'fan', 'temperature', 'audio', 'storage', 'casing']; $self->{components_module} = ['video', 'psu', 'fan', 'temperature', 'audio', 'storage', 'casing'];
} }
@ -81,10 +79,8 @@ 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;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {});
{
});
return $self; return $self;
} }
@ -127,4 +123,4 @@ Example: --threshold-overload='video,CRITICAL,^(?!(good)$)'
=back =back
=cut =cut

View File

@ -28,8 +28,6 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(psu)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
$self->{thresholds} = { $self->{thresholds} = {
@ -56,8 +54,7 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {});
});
return $self; return $self;
} }

View File

@ -28,8 +28,6 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(psu)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
$self->{thresholds} = { $self->{thresholds} = {
@ -46,7 +44,7 @@ sub set_system {
sub snmp_execute { sub snmp_execute {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{snmp} = $options{snmp}; $self->{snmp} = $options{snmp};
$self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request});
} }
@ -56,8 +54,7 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1, force_new_perfdata => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1, force_new_perfdata => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {});
});
return $self; return $self;
} }

View File

@ -27,8 +27,7 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^humidity|temperature|psu$';
$self->{regexp_threshold_numeric_check_section_option} = '^humidity|temperature$'; $self->{regexp_threshold_numeric_check_section_option} = '^humidity|temperature$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -40,7 +39,7 @@ sub set_system {
['belowLow', 'WARNING'], ['belowLow', 'WARNING'],
['normal', 'OK'], ['normal', 'OK'],
['aboveHigh', 'WARNING'], ['aboveHigh', 'WARNING'],
['aboveMax', 'CRITICAL'], ['aboveMax', 'CRITICAL']
], ],
temperature => [ temperature => [
['notPresent', 'OK'], ['notPresent', 'OK'],
@ -48,13 +47,13 @@ sub set_system {
['belowLow', 'WARNING'], ['belowLow', 'WARNING'],
['normal', 'OK'], ['normal', 'OK'],
['aboveHigh', 'WARNING'], ['aboveHigh', 'WARNING'],
['aboveMax', 'CRITICAL'], ['aboveMax', 'CRITICAL']
], ],
psu => [ psu => [
['ok', 'OK'], ['ok', 'OK'],
['failed', 'CRITICAL'], ['failed', 'CRITICAL'],
['notPresent', 'OK'], ['notPresent', 'OK']
], ]
}; };
$self->{components_path} = 'hardware::pdu::apc::snmp::mode::components'; $self->{components_path} = 'hardware::pdu::apc::snmp::mode::components';
@ -72,9 +71,9 @@ 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;
$options{options}->add_options(arguments => {}); $options{options}->add_options(arguments => {});
return $self; return $self;
} }

View File

@ -29,7 +29,6 @@ use hardware::pdu::schleifenbauer::gateway::snmp::mode::components::resources qw
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(temperature|humidity|contact)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature|humidity|contact)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|humidity|contact)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -44,7 +43,7 @@ sub snmp_execute {
$self->{snmp} = $options{snmp}; $self->{snmp} = $options{snmp};
$self->{results} = $self->{snmp}->get_multiple_table(oids => [ $self->{results} = $self->{snmp}->get_multiple_table(oids => [
{ oid => $oid_deviceName }, { oid => $oid_deviceName },
{ oid => $oid_pdumeasuresEntry }, { oid => $oid_pdumeasuresEntry }
]); ]);
} }
@ -53,8 +52,7 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, force_new_perfdata => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, force_new_perfdata => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {});
});
return $self; return $self;
} }

View File

@ -27,8 +27,7 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(temperature|humidity|switch|serial|water)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature|humidity)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|humidity)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -43,23 +42,23 @@ sub set_system {
['lowCritical', 'CRITICAL'], ['lowCritical', 'CRITICAL'],
['sensorError', 'CRITICAL'], ['sensorError', 'CRITICAL'],
['relayOn', 'OK'], ['relayOn', 'OK'],
['relayOff', 'OK'], ['relayOff', 'OK']
], ],
default2 => [ default2 => [
['noStatus', 'OK'], ['noStatus', 'OK'],
['normal', 'OK'], ['normal', 'OK'],
['critical', 'CRITICAL'], ['critical', 'CRITICAL'],
['sensorError', 'CRITICAL'], ['sensorError', 'CRITICAL']
], ]
}; };
$self->{components_path} = 'hardware::sensors::akcp::snmp::mode::components'; $self->{components_path} = 'hardware::sensors::akcp::snmp::mode::components';
$self->{components_module} = ['temperature', 'humidity', 'switch', 'serial', 'water']; $self->{components_module} = ['temperature', 'humidity', 'switch', 'serial', 'water'];
} }
sub snmp_execute { sub snmp_execute {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{snmp} = $options{snmp}; $self->{snmp} = $options{snmp};
$self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request});
} }
@ -68,11 +67,9 @@ sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {});
{
});
return $self; return $self;
} }

View File

@ -28,8 +28,7 @@ use hardware::sensors::hwgste::snmp::mode::components::resources qw($mapping);
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(temperature|humidity)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature|humidity)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|humidity)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -41,17 +40,17 @@ sub set_system {
['outOfRangeLo', 'WARNING'], ['outOfRangeLo', 'WARNING'],
['outOfRangeHi', 'WARNING'], ['outOfRangeHi', 'WARNING'],
['alarmLo', 'CRITICAL'], ['alarmLo', 'CRITICAL'],
['alarmHi', 'CRITICAL'], ['alarmHi', 'CRITICAL']
], ]
}; };
$self->{components_path} = 'hardware::sensors::hwgste::snmp::mode::components'; $self->{components_path} = 'hardware::sensors::hwgste::snmp::mode::components';
$self->{components_module} = ['temperature', 'humidity']; $self->{components_module} = ['temperature', 'humidity'];
} }
sub snmp_execute { sub snmp_execute {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{snmp} = $options{snmp}; $self->{snmp} = $options{snmp};
$self->{results} = $self->{snmp}->get_multiple_table( $self->{results} = $self->{snmp}->get_multiple_table(
oids => [{ oid => $mapping->{branch_sensors}->{hwgste} }, { oid => $mapping->{branch_sensors}->{hwgste2} }] oids => [{ oid => $mapping->{branch_sensors}->{hwgste} }, { oid => $mapping->{branch_sensors}->{hwgste2} }]
@ -67,10 +66,9 @@ sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {});
});
return $self; return $self;
} }

View File

@ -27,8 +27,7 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(temperature|humidity|input)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature|humidity)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|humidity)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -42,12 +41,12 @@ sub set_system {
['below-low-critical', 'CRITICAL'], ['below-low-critical', 'CRITICAL'],
['above-high-warning', 'WARNING'], ['above-high-warning', 'WARNING'],
['above-high-critical', 'CRITICAL'], ['above-high-critical', 'CRITICAL'],
['sensorError', 'CRITICAL'], ['sensorError', 'CRITICAL']
], ],
input => [ input => [
['normal', 'OK'], ['normal', 'OK'],
['triggered', 'CRITICAL'], ['triggered', 'CRITICAL']
], ]
}; };
$self->{components_path} = 'hardware::sensors::jacarta::snmp::mode::components'; $self->{components_path} = 'hardware::sensors::jacarta::snmp::mode::components';
@ -70,10 +69,9 @@ sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {});
});
return $self; return $self;
} }

View File

@ -28,7 +28,6 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(temperature|humidity|dewpoint|airflow|doorswitch|camera|otherstate)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature|humidity|dewpoint|airflow)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|humidity|dewpoint|airflow)$';
$self->{cb_hook1} = 'get_version'; $self->{cb_hook1} = 'get_version';
@ -41,8 +40,8 @@ sub set_system {
['warning', 'WARNING'], ['warning', 'WARNING'],
['error', 'CRITICAL'], ['error', 'CRITICAL'],
['critical', 'CRITICAL'], ['critical', 'CRITICAL'],
['failure', 'CRITICAL'], ['failure', 'CRITICAL']
], ]
}; };
$self->{components_path} = 'hardware::sensors::netbotz::snmp::mode::components'; $self->{components_path} = 'hardware::sensors::netbotz::snmp::mode::components';
@ -84,8 +83,7 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {});
});
return $self; return $self;
} }

View File

@ -27,8 +27,7 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^sp|temperature|humidity|switch$';
$self->{regexp_threshold_numeric_check_section_option} = '^humidity|temperature$'; $self->{regexp_threshold_numeric_check_section_option} = '^humidity|temperature$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -39,7 +38,7 @@ sub set_system {
['normal', 'OK'], ['normal', 'OK'],
['warning', 'WARNING'], ['warning', 'WARNING'],
['critical', 'CRITICAL'], ['critical', 'CRITICAL'],
['sensorError', 'CRITICAL'], ['sensorError', 'CRITICAL']
], ],
switch => [ switch => [
['noStatus', 'UNKNOWN'], ['noStatus', 'UNKNOWN'],
@ -48,10 +47,10 @@ sub set_system {
['lowCritical', 'CRITICAL'], ['lowCritical', 'CRITICAL'],
['sensorError', 'CRITICAL'], ['sensorError', 'CRITICAL'],
['relayOn', 'OK'], ['relayOn', 'OK'],
['relayOff', 'OK'], ['relayOff', 'OK']
], ]
}; };
$self->{components_path} = 'hardware::sensors::sensorip::snmp::mode::components'; $self->{components_path} = 'hardware::sensors::sensorip::snmp::mode::components';
$self->{components_module} = ['sp', 'temperature', 'humidity', 'switch']; $self->{components_module} = ['sp', 'temperature', 'humidity', 'switch'];
} }
@ -67,9 +66,9 @@ 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;
$options{options}->add_options(arguments => {}); $options{options}->add_options(arguments => {});
return $self; return $self;
} }

View File

@ -27,8 +27,7 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^sensors$';
$self->{regexp_threshold_numeric_check_section_option} = '^sensors$'; $self->{regexp_threshold_numeric_check_section_option} = '^sensors$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -36,10 +35,10 @@ sub set_system {
$self->{thresholds} = { $self->{thresholds} = {
output => [ output => [
['open', 'CRITICAL'], ['open', 'CRITICAL'],
['close', 'OK'], ['close', 'OK']
], ]
}; };
$self->{components_path} = 'hardware::sensors::serverscheck::sensorgateway::snmp::mode::components'; $self->{components_path} = 'hardware::sensors::serverscheck::sensorgateway::snmp::mode::components';
$self->{components_module} = ['sensors']; $self->{components_module} = ['sensors'];
} }
@ -55,9 +54,9 @@ 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;
$options{options}->add_options(arguments => {}); $options{options}->add_options(arguments => {});
return $self; return $self;
} }

View File

@ -29,8 +29,6 @@ use hardware::server::cisco::ucs::mode::components::resources qw($thresholds);
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(fan|psu|chassis|iocard|blade|fex|cpu|memory|localdisk)\.(presence|operability|overall_status)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
$self->{thresholds} = $thresholds; $self->{thresholds} = $thresholds;
@ -51,8 +49,7 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {});
});
return $self; return $self;
} }

View File

@ -28,8 +28,7 @@ use centreon::plugins::misc;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(health|chassis|temperature|psu)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature|psu\.(voltage|power|current)|chassis\.(power|current))$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|psu\.(voltage|power|current)|chassis\.(power|current))$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -41,8 +40,8 @@ sub set_system {
['ok', 'OK'], ['ok', 'OK'],
['nonCritical', 'WARNING'], ['nonCritical', 'WARNING'],
['critical', 'CRITICAL'], ['critical', 'CRITICAL'],
['nonRecoverable', 'CRITICAL'], ['nonRecoverable', 'CRITICAL']
], ]
}; };
$self->{components_path} = 'hardware::server::dell::cmc::snmp::mode::components'; $self->{components_path} = 'hardware::server::dell::cmc::snmp::mode::components';
@ -78,9 +77,9 @@ 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;
$options{options}->add_options(arguments => {}); $options{options}->add_options(arguments => {});
return $self; return $self;
} }

View File

@ -27,9 +27,9 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature|voltage|amperage|coolingdevice)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|voltage|amperage|coolingdevice)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
$self->{thresholds} = { $self->{thresholds} = {
@ -37,7 +37,7 @@ sub set_system {
['unknown', 'UNKNOWN'], ['unknown', 'UNKNOWN'],
['enabled', 'OK'], ['enabled', 'OK'],
['notReady', 'WARNING'], ['notReady', 'WARNING'],
['enabledAndNotReady', 'WARNING'], ['enabledAndNotReady', 'WARNING']
], ],
'default.status' => [ 'default.status' => [
['other', 'UNKNOWN'], ['other', 'UNKNOWN'],
@ -45,7 +45,7 @@ sub set_system {
['ok', 'OK'], ['ok', 'OK'],
['nonCritical', 'WARNING'], ['nonCritical', 'WARNING'],
['critical', 'CRITICAL'], ['critical', 'CRITICAL'],
['nonRecoverable', 'CRITICAL'], ['nonRecoverable', 'CRITICAL']
], ],
'probe.status' => [ 'probe.status' => [
['other', 'UNKNOWN'], ['other', 'UNKNOWN'],
@ -57,7 +57,7 @@ sub set_system {
['nonCriticalLower', 'WARNING'], ['nonCriticalLower', 'WARNING'],
['criticalLower', 'CRITICAL'], ['criticalLower', 'CRITICAL'],
['nonRecoverableLower', 'CRITICAL'], ['nonRecoverableLower', 'CRITICAL'],
['failed', 'CRITICAL'], ['failed', 'CRITICAL']
], ],
'pdisk.state' => [ 'pdisk.state' => [
['unknown', 'UNKNOWN'], ['unknown', 'UNKNOWN'],
@ -69,31 +69,26 @@ sub set_system {
['failed', 'CRITICAL'], ['failed', 'CRITICAL'],
['non-raid', 'OK'], ['non-raid', 'OK'],
['removed', 'OK'], ['removed', 'OK'],
['readonly', 'WARNING'], ['readonly', 'WARNING']
], ],
'pdisk.smartalert' => [ 'pdisk.smartalert' => [
['off', 'OK'], ['off', 'OK'],
['on', 'WARNING'], ['on', 'WARNING']
], ],
'vdisk.state' => [ 'vdisk.state' => [
['unknown', 'UNKNOWN'], ['unknown', 'UNKNOWN'],
['online', 'OK'], ['online', 'OK'],
['failed', 'CRITICAL'], ['failed', 'CRITICAL'],
['degraded', 'WARNING'], ['degraded', 'WARNING']
], ]
}; };
$self->{components_path} = 'hardware::server::dell::idrac::snmp::mode::components'; $self->{components_path} = 'hardware::server::dell::idrac::snmp::mode::components';
$self->{components_module} = ['psu', 'punit', 'temperature', 'voltage', 'amperage', $self->{components_module} = [
'psu', 'punit', 'temperature', 'voltage', 'amperage',
'systembattery', 'coolingunit', 'coolingdevice', 'processor', 'memory', 'pci', 'network', 'systembattery', 'coolingunit', 'coolingdevice', 'processor', 'memory', 'pci', 'network',
'slot', 'fru', 'storagectrl', 'storagebattery', 'pdisk', 'vdisk']; 'slot', 'fru', 'storagectrl', 'storagebattery', 'pdisk', 'vdisk'
];
$self->{regexp_threshold_overload_check_section_option} =
'^(' .
'(psu|punit|temperature|voltage|amperage|systembattery|coolingunit|coolingdevice|processor|memory|pci|network|slot|fru|storagectrl|storagebattery|pdisk)\.status' .
'|(punit|temperature|voltage|amperage|systembattery|coolingunit|coolingdevice|processor|memory|pci|pdisk|vdisk)\.state' .
'|(pdisk)\.smartalert' .
')$';
} }
sub snmp_execute { sub snmp_execute {
@ -107,11 +102,9 @@ 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;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {});
{
});
return $self; return $self;
} }

View File

@ -28,9 +28,7 @@ use centreon::plugins::misc;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} =
'^(globalstatus|fan|psu|temperature|cpu|cachebattery|memory|physicaldisk|logicaldrive|esmlog|battery|controller|connector)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan|psu\.power)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan|psu\.power)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -47,8 +45,8 @@ sub set_system {
], ],
physicaldisk_smartalert => [ physicaldisk_smartalert => [
['yes', 'WARNING'], ['yes', 'WARNING'],
['no', 'OK'], ['no', 'OK']
], ]
}; };
$self->{components_path} = 'hardware::server::dell::openmanage::snmp::mode::components'; $self->{components_path} = 'hardware::server::dell::openmanage::snmp::mode::components';
@ -79,9 +77,9 @@ 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;
$options{options}->add_options(arguments => {}); $options{options}->add_options(arguments => {});
return $self; return $self;
} }

View File

@ -27,8 +27,7 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(temperature|fan|psu|voltage|cpu|memory)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan|voltage|power)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan|voltage|power)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -46,7 +45,7 @@ sub set_system {
['hot-spare', 'OK'], ['hot-spare', 'OK'],
['mirror', 'OK'], ['mirror', 'OK'],
['raid', 'OK'], ['raid', 'OK'],
['hidden', 'OK'], ['hidden', 'OK']
], ],
cpu => [ cpu => [
['unknown', 'UNKNOWN'], ['unknown', 'UNKNOWN'],
@ -56,7 +55,7 @@ sub set_system {
['error', 'CRITICAL'], ['error', 'CRITICAL'],
['prefailure-warning', 'WARNING'], ['prefailure-warning', 'WARNING'],
['fail', 'CRITICAL'], # can be failed also ['fail', 'CRITICAL'], # can be failed also
['missing-termination', 'WARNING'], ['missing-termination', 'WARNING']
], ],
voltage => [ voltage => [
['unknown', 'UNKNOWN'], ['unknown', 'UNKNOWN'],
@ -66,7 +65,7 @@ sub set_system {
['too-high', 'WARNING'], ['too-high', 'WARNING'],
['out-of-range', 'CRITICAL'], ['out-of-range', 'CRITICAL'],
['battery-prefailure', 'CRITICAL'], ['battery-prefailure', 'CRITICAL'],
['warning', 'WARNING'], ['warning', 'WARNING']
], ],
fan => [ fan => [
['unknown', 'UNKNOWN'], ['unknown', 'UNKNOWN'],
@ -92,7 +91,7 @@ sub set_system {
['not-available', 'OK'], ['not-available', 'OK'],
['temperature-warning', 'WARNING'], # can be also temperature-warning-toohot ['temperature-warning', 'WARNING'], # can be also temperature-warning-toohot
['temperature-critical-toohot', 'CRITICAL'], ['temperature-critical-toohot', 'CRITICAL'],
['temperature-normal', 'OK'], ['temperature-normal', 'OK']
], ],
psu => [ psu => [
['unknown', 'UNKNOWN'], ['unknown', 'UNKNOWN'],
@ -110,8 +109,8 @@ sub set_system {
['non-redundant-ac-fail', 'WARNING'], ['non-redundant-ac-fail', 'WARNING'],
['degraded', 'WARNING'], ['degraded', 'WARNING'],
['critical', 'CRITICAL'], ['critical', 'CRITICAL']
], ]
}; };
$self->{components_path} = 'hardware::server::fujitsu::snmp::mode::components'; $self->{components_path} = 'hardware::server::fujitsu::snmp::mode::components';
@ -120,7 +119,7 @@ sub set_system {
sub snmp_execute { sub snmp_execute {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{snmp} = $options{snmp}; $self->{snmp} = $options{snmp};
$self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request});
} }
@ -129,11 +128,9 @@ 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;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {});
{
});
return $self; return $self;
} }

View File

@ -28,9 +28,6 @@ use centreon::plugins::misc;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} =
'^(enclosure|manager|fan|blade|network|psu|temperature|fuse)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -39,8 +36,8 @@ sub set_system {
['other', 'CRITICAL'], ['other', 'CRITICAL'],
['ok', 'OK'], ['ok', 'OK'],
['degraded', 'WARNING'], ['degraded', 'WARNING'],
['failed', 'CRITICAL'], ['failed', 'CRITICAL']
], ]
}; };
$self->{components_exec_load} = 0; $self->{components_exec_load} = 0;
@ -61,9 +58,9 @@ sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => {}); $options{options}->add_options(arguments => {});
return $self; return $self;
} }

View File

@ -27,9 +27,7 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} =
'^(temperature|fan|vrm|psu|cpu|memory|nic|battery|ctrl|driveencl|pdrive|ldrive|bios)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan)$';
$self->{cb_hook2} = 'api_execute'; $self->{cb_hook2} = 'api_execute';
@ -43,19 +41,21 @@ sub set_system {
['NOT APPLICABLE', 'OK'], ['NOT APPLICABLE', 'OK'],
['n/a', 'OK'], ['n/a', 'OK'],
['Unknown', 'UNKNOWN'], ['Unknown', 'UNKNOWN'],
['.*', 'CRITICAL'], ['.*', 'CRITICAL']
], ],
nic => [ nic => [
['Ok', 'OK'], ['Ok', 'OK'],
['Unknown', 'OK'], ['Unknown', 'OK'],
['Disabled', 'OK'], ['Disabled', 'OK'],
['.*', 'CRITICAL'], ['.*', 'CRITICAL']
], ]
}; };
$self->{components_path} = 'hardware::server::hp::ilo::xmlapi::mode::components'; $self->{components_path} = 'hardware::server::hp::ilo::xmlapi::mode::components';
$self->{components_module} = ['fan', 'temperature', 'vrm', 'psu', 'cpu', 'memory', 'nic', 'battery', 'ctrl', $self->{components_module} = [
'driveencl', 'pdrive', 'ldrive', 'bios']; 'fan', 'temperature', 'vrm', 'psu', 'cpu', 'memory', 'nic', 'battery', 'ctrl',
'driveencl', 'pdrive', 'ldrive', 'bios'
];
} }
sub api_execute { sub api_execute {
@ -68,10 +68,8 @@ 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;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {});
{
});
return $self; return $self;
} }

View File

@ -27,8 +27,6 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(?:server|enclosure\.(.*))$';
$self->{cb_hook2} = 'execute_custom'; $self->{cb_hook2} = 'execute_custom';
@ -38,8 +36,8 @@ sub set_system {
['disabled', 'OK'], ['disabled', 'OK'],
['critical', 'CRITICAL'], ['critical', 'CRITICAL'],
['warning', 'WARNING'], ['warning', 'WARNING'],
['unknown', 'UNKNOWN'], ['unknown', 'UNKNOWN']
], ]
}; };
$self->{components_path} = 'hardware::server::hp::oneview::restapi::mode::components'; $self->{components_path} = 'hardware::server::hp::oneview::restapi::mode::components';
@ -50,7 +48,7 @@ sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1, force_new_perfdata => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1, force_new_perfdata => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => {}); $options{options}->add_options(arguments => {});
$self->{requests} = []; $self->{requests} = [];

View File

@ -28,9 +28,7 @@ use centreon::plugins::misc;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} =
'^(ilo|cpu|idectl|ideldrive|idepdrive|pc|psu|sasctl|sasldrive|saspdrive|scsictl|scsildrive|scsipdrive|fcahostctl|fcaexternalctl|fcaexternalacc|fcaldrive|fcapdrive|dactl|daacc|daldrive|dapdrive|fan|pnic|lnic|temperature)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature)$';
$self->{cb_hook1} = 'get_system_information'; $self->{cb_hook1} = 'get_system_information';
@ -42,14 +40,14 @@ sub set_system {
['ok', 'OK'], ['ok', 'OK'],
['degraded', 'WARNING'], ['degraded', 'WARNING'],
['failed', 'CRITICAL'], ['failed', 'CRITICAL'],
['disabled', 'OK'], ['disabled', 'OK']
], ],
ideldrive => [ ideldrive => [
['other', 'UNKNOWN'], ['other', 'UNKNOWN'],
['ok', 'OK'], ['ok', 'OK'],
['rebuilding', 'WARNING'], ['rebuilding', 'WARNING'],
['degraded', 'WARNING'], ['degraded', 'WARNING'],
['failed', 'CRITICAL'], ['failed', 'CRITICAL']
], ],
sasldrive => [ sasldrive => [
['other', 'UNKNOWN'], ['other', 'UNKNOWN'],
@ -57,7 +55,7 @@ sub set_system {
['degraded', 'WARNING'], ['degraded', 'WARNING'],
['rebuilding', 'WARNING'], ['rebuilding', 'WARNING'],
['failed', 'CRITICAL'], ['failed', 'CRITICAL'],
['offline', 'CRITICAL'], ['offline', 'CRITICAL']
], ],
scsildrive => [ scsildrive => [
['other', 'UNKNOWN'], ['other', 'UNKNOWN'],
@ -70,7 +68,7 @@ sub set_system {
['rebuilding', 'WARNING'], ['rebuilding', 'WARNING'],
['wrongDrive', 'CRITICAL'], ['wrongDrive', 'CRITICAL'],
['badConnect', 'CRITICAL'], ['badConnect', 'CRITICAL'],
['disabled', 'OK'], ['disabled', 'OK']
], ],
fcaexternalaccbattery => [ fcaexternalaccbattery => [
['other', 'UNKNOWN'], ['other', 'UNKNOWN'],
@ -78,7 +76,7 @@ sub set_system {
['degraded', 'WARNING'], ['degraded', 'WARNING'],
['failed', 'CRITICAL'], ['failed', 'CRITICAL'],
['recharging', 'WARNING'], ['recharging', 'WARNING'],
['not present', 'OK'], ['not present', 'OK']
], ],
fcaldrive => [ fcaldrive => [
['other', 'UNKNOWN'], ['other', 'UNKNOWN'],
@ -95,7 +93,7 @@ sub set_system {
['notAvailable', 'WARNING'], ['notAvailable', 'WARNING'],
['hardError', 'CRITICAL'], ['hardError', 'CRITICAL'],
['queuedForExpansion', 'WARNING'], ['queuedForExpansion', 'WARNING'],
['shutdown', 'WARNING'], ['shutdown', 'WARNING']
], ],
daaccbattery => [ daaccbattery => [
['other', 'UNKNOWN'], ['other', 'UNKNOWN'],
@ -103,7 +101,7 @@ sub set_system {
['degraded', 'WARNING'], ['degraded', 'WARNING'],
['failed', 'CRITICAL'], ['failed', 'CRITICAL'],
['recharging', 'WARNING'], ['recharging', 'WARNING'],
['not present', 'OK'], ['not present', 'OK']
], ],
daldrive => [ daldrive => [
['other', 'UNKNOWN'], ['other', 'UNKNOWN'],
@ -120,39 +118,41 @@ sub set_system {
['notAvailable', 'WARNING'], ['notAvailable', 'WARNING'],
['hardError', 'CRITICAL'], ['hardError', 'CRITICAL'],
['queuedForExpansion', 'WARNING'], ['queuedForExpansion', 'WARNING'],
['shutdown', 'WARNING'], ['shutdown', 'WARNING']
], ],
lnic => [ lnic => [
['other', 'OK'], ['other', 'OK'],
['ok', 'OK'], ['ok', 'OK'],
['degraded', 'WARNING'], ['degraded', 'WARNING'],
['failed', 'CRITICAL'], ['failed', 'CRITICAL']
], ],
temperature => [ temperature => [
['other', 'OK'], ['other', 'OK'],
['ok', 'OK'], ['ok', 'OK'],
['degraded', 'WARNING'], ['degraded', 'WARNING'],
['failed', 'CRITICAL'], ['failed', 'CRITICAL']
], ],
# ilo, pnic, fan, dapdrive, daacc, dactl, fcapdrive, fcaexternalacc, fcaexternalctl, fcahostctl, scsipdrive, scsictl, saspdrive, sasctl, psu, pc, idepdrive, idectl # ilo, pnic, fan, dapdrive, daacc, dactl, fcapdrive, fcaexternalacc, fcaexternalctl, fcahostctl, scsipdrive, scsictl, saspdrive, sasctl, psu, pc, idepdrive, idectl
default => [ default => [
['other', 'UNKNOWN'], ['other', 'UNKNOWN'],
['ok', 'OK'], ['ok', 'OK'],
['degraded', 'WARNING'], ['degraded', 'WARNING'],
['failed', 'CRITICAL'], ['failed', 'CRITICAL']
], ]
}; };
$self->{components_path} = 'hardware::server::hp::proliant::snmp::mode::components'; $self->{components_path} = 'hardware::server::hp::proliant::snmp::mode::components';
$self->{components_module} = ['cpu', 'idectl', 'ideldrive', 'idepdrive', 'pc', 'psu', $self->{components_module} = [
'cpu', 'idectl', 'ideldrive', 'idepdrive', 'pc', 'psu',
'sasctl', 'sasldrive', 'saspdrive', 'scsictl', 'scsildrive', 'scsipdrive', 'sasctl', 'sasldrive', 'saspdrive', 'scsictl', 'scsildrive', 'scsipdrive',
'fcahostctl', 'fcaexternalctl', 'fcaexternalacc', 'fcaldrive', 'fcapdrive', 'fcahostctl', 'fcaexternalctl', 'fcaexternalacc', 'fcaldrive', 'fcapdrive',
'dactl', 'daacc', 'daldrive', 'dapdrive', 'fan', 'pnic', 'lnic', 'temperature', 'ilo']; 'dactl', 'daacc', 'daldrive', 'dapdrive', 'fan', 'pnic', 'lnic', 'temperature', 'ilo'
];
} }
sub snmp_execute { sub snmp_execute {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{snmp} = $options{snmp}; $self->{snmp} = $options{snmp};
$self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request});
} }
@ -161,11 +161,9 @@ 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;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {});
{
});
return $self; return $self;
} }
@ -248,4 +246,4 @@ Example: --critical='temperature,.*,40'
=back =back
=cut =cut

View File

@ -27,19 +27,18 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_numeric_check_section_option} = '^(cpu|temperature)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(cpu|temperature)$';
$self->{regexp_threshold_overload_check_section_option} = '^(cpu|disk|memory|mezz|raidcontroller)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
$self->{thresholds} = { $self->{thresholds} = {
'default' => [ 'default' => [
['normal', 'OK'], ['normal', 'OK'],
['minor', 'WARNING'], ['minor', 'WARNING'],
['major', 'CRITICAL'], ['major', 'CRITICAL'],
['critical', 'CRITICAL'], ['critical', 'CRITICAL']
], ]
}; };
$self->{components_path} = 'hardware::server::huawei::hmm::snmp::mode::components'; $self->{components_path} = 'hardware::server::huawei::hmm::snmp::mode::components';
@ -57,12 +56,11 @@ 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;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {
{ 'blade-id:s' => { name => 'blade_id' }
"blade-id:s" => { name => 'blade_id' }, });
});
return $self; return $self;
} }

View File

@ -27,9 +27,7 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(blade|fan|psu|switch)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
$self->{thresholds} = { $self->{thresholds} = {
@ -37,8 +35,8 @@ sub set_system {
['normal', 'OK'], ['normal', 'OK'],
['minor', 'WARNING'], ['minor', 'WARNING'],
['major', 'CRITICAL'], ['major', 'CRITICAL'],
['critical', 'CRITICAL'], ['critical', 'CRITICAL']
], ]
}; };
$self->{components_path} = 'hardware::server::huawei::hmm::snmp::mode::components'; $self->{components_path} = 'hardware::server::huawei::hmm::snmp::mode::components';
@ -56,11 +54,9 @@ 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;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {});
{
});
return $self; return $self;
} }

View File

@ -27,9 +27,8 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_numeric_check_section_option} = '^(harddisk|fan|psu|temperature)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(harddisk|fan|psu|temperature)$';
$self->{regexp_threshold_overload_check_section_option} = '^(component|cpu|harddisk|fan|logicaldrive|memory|pcie|psu|raidcontroller)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -40,14 +39,14 @@ sub set_system {
['major', 'CRITICAL'], ['major', 'CRITICAL'],
['critical', 'CRITICAL'], ['critical', 'CRITICAL'],
['absence', 'UNKNOWN'], ['absence', 'UNKNOWN'],
['unknown', 'UNKNOWN'], ['unknown', 'UNKNOWN']
], ],
'logicaldrive' => [ 'logicaldrive' => [
['offline', 'OK'], ['offline', 'OK'],
['partial degraded', 'WARNING'], ['partial degraded', 'WARNING'],
['degraded', 'CRITICAL'], ['degraded', 'CRITICAL'],
['optimal', 'OK'], ['optimal', 'OK'],
['unknown', 'UNKNOWN'], ['unknown', 'UNKNOWN']
], ],
'raidcontroller' => [ 'raidcontroller' => [
['memory correctable error', 'WARNING'], ['memory correctable error', 'WARNING'],
@ -55,13 +54,15 @@ sub set_system {
['memory ECC error reached limit', 'CRITICAL'], ['memory ECC error reached limit', 'CRITICAL'],
['NVRAM uncorrectable error', 'CRITICAL'], ['NVRAM uncorrectable error', 'CRITICAL'],
['ok', 'OK'], ['ok', 'OK'],
['unknown', 'UNKNOWN'], ['unknown', 'UNKNOWN']
], ]
}; };
$self->{components_path} = 'hardware::server::huawei::ibmc::snmp::mode::components'; $self->{components_path} = 'hardware::server::huawei::ibmc::snmp::mode::components';
$self->{components_module} = ['component', 'cpu', 'harddisk', 'fan', 'logicaldrive', $self->{components_module} = [
'memory', 'pcie', 'psu', 'raidcontroller', 'temperature']; 'component', 'cpu', 'harddisk', 'fan', 'logicaldrive',
'memory', 'pcie', 'psu', 'raidcontroller', 'temperature'
];
} }
sub snmp_execute { sub snmp_execute {
@ -75,11 +76,9 @@ 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;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {});
{
});
return $self; return $self;
} }

View File

@ -27,10 +27,9 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(global|temperature|voltage|fan)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature|voltage|fan)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|voltage|fan)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
$self->{thresholds} = { $self->{thresholds} = {
@ -38,12 +37,12 @@ sub set_system {
['non recoverable', 'CRITICAL'], ['non recoverable', 'CRITICAL'],
['non critical', 'WARNING'], ['non critical', 'WARNING'],
['critical', 'CRITICAL'], ['critical', 'CRITICAL'],
['nominal', 'OK'], ['nominal', 'OK']
], ],
fan => [ fan => [
['offline', 'WARNING'], ['offline', 'WARNING'],
['.*', 'OK'], ['.*', 'OK']
], ]
}; };
$self->{components_path} = 'hardware::server::ibm::mgmt_cards::imm::snmp::mode::components'; $self->{components_path} = 'hardware::server::ibm::mgmt_cards::imm::snmp::mode::components';
@ -52,7 +51,7 @@ sub set_system {
sub snmp_execute { sub snmp_execute {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{snmp} = $options{snmp}; $self->{snmp} = $options{snmp};
$self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request});
} }
@ -61,11 +60,9 @@ 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;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {});
{
});
return $self; return $self;
} }

View File

@ -27,8 +27,7 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(temperature|voltage|fan|psu|disk|raidvolume)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature|voltage|fan)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|voltage|fan)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -36,14 +35,14 @@ sub set_system {
$self->{thresholds} = { $self->{thresholds} = {
default => [ default => [
['Normal', 'OK'], ['Normal', 'OK'],
['.*', 'CRITICAL'], ['.*', 'CRITICAL']
], ],
raidvolume => [ raidvolume => [
['Optimal', 'OK'], ['Optimal', 'OK'],
['.*', 'CRITICAL'], ['.*', 'CRITICAL']
], ]
}; };
$self->{components_path} = 'hardware::server::lenovo::xcc::snmp::mode::components'; $self->{components_path} = 'hardware::server::lenovo::xcc::snmp::mode::components';
$self->{components_module} = ['temperature', 'voltage', 'fan', 'psu', 'disk', 'raidvolume']; $self->{components_module} = ['temperature', 'voltage', 'fan', 'psu', 'disk', 'raidvolume'];
} }
@ -59,11 +58,9 @@ 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;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {});
{
});
return $self; return $self;
} }

View File

@ -28,9 +28,6 @@ use centreon::plugins::misc;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} =
'^temperature|si|disk|fan|voltage|psu|sensors$';
$self->{cb_hook2} = 'execute_command'; $self->{cb_hook2} = 'execute_command';
@ -39,34 +36,34 @@ sub set_system {
$self->{thresholds} = { $self->{thresholds} = {
temperature => [ temperature => [
['^(?!(OK)$)', 'CRITICAL'], ['^(?!(OK)$)', 'CRITICAL'],
['^OK$', 'OK'], ['^OK$', 'OK']
], ],
si => [ si => [
['^(?!(OFF)$)', 'CRITICAL'], ['^(?!(OFF)$)', 'CRITICAL'],
['^OFF$', 'OK'], ['^OFF$', 'OK']
], ],
disk => [ disk => [
['^(?!(OK|NOT PRESENT)$)', 'CRITICAL'], ['^(?!(OK|NOT PRESENT)$)', 'CRITICAL'],
['^OK|NOT PRESENT$', 'OK'], ['^OK|NOT PRESENT$', 'OK']
], ],
fan => [ fan => [
['^(?!(OK|NOT PRESENT)$)', 'CRITICAL'], ['^(?!(OK|NOT PRESENT)$)', 'CRITICAL'],
['^OK|NOT PRESENT$', 'OK'], ['^OK|NOT PRESENT$', 'OK']
], ],
voltage => [ voltage => [
['^(?!(OK)$)', 'CRITICAL'], ['^(?!(OK)$)', 'CRITICAL'],
['^OK$', 'OK'], ['^OK$', 'OK']
], ],
psu => [ psu => [
['^(?!(OK|NOT PRESENT)$)', 'CRITICAL'], ['^(?!(OK|NOT PRESENT)$)', 'CRITICAL'],
['^OK|NOT PRESENT$', 'OK'], ['^OK|NOT PRESENT$', 'OK']
], ],
sensors => [ sensors => [
['^(?!(OK)$)', 'CRITICAL'], ['^(?!(OK)$)', 'CRITICAL'],
['^OK$', 'OK'], ['^OK$', 'OK']
], ]
}; };
$self->{components_path} = 'hardware::server::sun::mgmt_cards::components::showenvironment'; $self->{components_path} = 'hardware::server::sun::mgmt_cards::components::showenvironment';
$self->{components_module} = ['temperature', 'si', 'disk', 'fan', 'voltage', 'psu', 'sensors']; $self->{components_module} = ['temperature', 'si', 'disk', 'fan', 'voltage', 'psu', 'sensors'];
} }
@ -75,7 +72,7 @@ sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1, no_absent => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1, no_absent => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {
'hostname:s' => { name => 'hostname' }, 'hostname:s' => { name => 'hostname' },
'port:s' => { name => 'port', default => 23 }, 'port:s' => { name => 'port', default => 23 },
@ -83,7 +80,7 @@ sub new {
'password:s' => { name => 'password' }, 'password:s' => { name => 'password' },
'timeout:s' => { name => 'timeout', default => 30 }, 'timeout:s' => { name => 'timeout', default => 30 },
'command-plink:s' => { name => 'command_plink', default => 'plink' }, 'command-plink:s' => { name => 'command_plink', default => 'plink' },
'ssh' => { name => 'ssh' }, 'ssh' => { name => 'ssh' }
}); });
return $self; return $self;

View File

@ -27,8 +27,7 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(sensor\..*|memory|disk|cpu)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(sensor\..*)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(sensor\..*)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -37,12 +36,12 @@ sub set_system {
sensor => [ sensor => [
['ok', 'OK'], ['ok', 'OK'],
['warning', 'WARNING'], ['warning', 'WARNING'],
['critical', 'CRITICAL'], ['critical', 'CRITICAL']
], ],
default => [ default => [
['ok', 'OK'], ['ok', 'OK'],
['critical', 'CRITICAL'], ['critical', 'CRITICAL']
], ]
}; };
$self->{components_path} = 'hardware::server::supermicro::superdoctor::snmp::mode::components'; $self->{components_path} = 'hardware::server::supermicro::superdoctor::snmp::mode::components';
@ -54,15 +53,14 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_load_components => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_load_components => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {});
});
return $self; return $self;
} }
sub snmp_execute { sub snmp_execute {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{snmp} = $options{snmp}; $self->{snmp} = $options{snmp};
$self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request});
} }

View File

@ -27,16 +27,14 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(alarm)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
$self->{thresholds} = { $self->{thresholds} = {
alarm => [ alarm => [
['enabled', 'CRITICAL'], ['enabled', 'CRITICAL'],
['disabled', 'OK'], ['disabled', 'OK']
], ]
}; };
$self->{components_path} = 'hardware::telephony::avaya::mediagateway::snmp::mode::components'; $self->{components_path} = 'hardware::telephony::avaya::mediagateway::snmp::mode::components';
@ -54,10 +52,9 @@ sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1, force_new_perfdata => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1, force_new_perfdata => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {});
});
return $self; return $self;
} }

View File

@ -27,18 +27,16 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(alarm)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
$self->{thresholds} = { $self->{thresholds} = {
alarm => [ alarm => [
['on', 'CRITICAL'], ['on', 'CRITICAL'],
['off', 'OK'], ['off', 'OK']
], ]
}; };
$self->{components_path} = 'hardware::ups::alpha::snmp::mode::components'; $self->{components_path} = 'hardware::ups::alpha::snmp::mode::components';
$self->{components_module} = ['alarm']; $self->{components_module} = ['alarm'];
} }
@ -47,7 +45,7 @@ sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1, no_load_components => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1, no_load_components => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => {}); $options{options}->add_options(arguments => {});
return $self; return $self;

View File

@ -28,7 +28,6 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(sensor)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature|humidity)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|humidity)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -41,8 +40,8 @@ sub set_system {
['sensorStatusNotApplicable', 'OK'], ['sensorStatusNotApplicable', 'OK'],
['disconnected', 'OK'], ['disconnected', 'OK'],
['connected', 'OK'], ['connected', 'OK']
], ]
}; };
$self->{components_path} = 'hardware::ups::apc::snmp::mode::components'; $self->{components_path} = 'hardware::ups::apc::snmp::mode::components';
@ -54,8 +53,7 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_load_components => 1, force_new_perfdata => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_load_components => 1, force_new_perfdata => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {});
});
return $self; return $self;
} }

View File

@ -28,8 +28,6 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^psu|fan$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
$self->{thresholds} = { $self->{thresholds} = {
@ -37,8 +35,8 @@ sub set_system {
['active', 'OK'], ['active', 'OK'],
['deactive', 'CRITICAL'], ['deactive', 'CRITICAL'],
['not-install', 'OK'], ['not-install', 'OK'],
['unsupport', 'WARNING'], ['unsupport', 'WARNING']
], ]
}; };
$self->{components_path} = 'network::3com::snmp::mode::components'; $self->{components_path} = 'network::3com::snmp::mode::components';
@ -56,9 +54,9 @@ sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => {}); $options{options}->add_options(arguments => {});
return $self; return $self;
} }

View File

@ -27,8 +27,7 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(temperature|fan|psu)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -37,7 +36,7 @@ sub set_system {
psu => [ psu => [
['off', 'CRITICAL'], ['off', 'CRITICAL'],
['on', 'OK'], ['on', 'OK'],
['unknown', 'UNKNOWN'], ['unknown', 'UNKNOWN']
], ],
fan => [ fan => [
['failed', 'CRITICAL'], ['failed', 'CRITICAL'],
@ -46,8 +45,8 @@ sub set_system {
['okMedMed', 'OK'], ['okMedMed', 'OK'],
['okMedHigh', 'OK'], ['okMedHigh', 'OK'],
['notReady', 'WARNING'], ['notReady', 'WARNING'],
['unknown', 'UNKNOWN'], ['unknown', 'UNKNOWN']
], ]
}; };
$self->{components_path} = 'network::a10::ax::snmp::mode::components'; $self->{components_path} = 'network::a10::ax::snmp::mode::components';
@ -58,9 +57,8 @@ sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_load_components => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_load_components => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {});
});
return $self; return $self;
} }

View File

@ -27,8 +27,7 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(voltage|temperature|fan|psu)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(voltage|temperature|fan)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(voltage|temperature|fan)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -42,8 +41,8 @@ sub set_system {
['shutdown', 'CRITICAL'], ['shutdown', 'CRITICAL'],
['notPresent', 'OK'], ['notPresent', 'OK'],
['notFunctioning', 'CRITICAL'], ['notFunctioning', 'CRITICAL'],
['unknown', 'UNKNOWN'], ['unknown', 'UNKNOWN']
], ]
}; };
$self->{components_path} = 'network::acmepacket::snmp::mode::components'; $self->{components_path} = 'network::acmepacket::snmp::mode::components';
@ -61,11 +60,9 @@ 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;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {});
{
});
return $self; return $self;
} }

View File

@ -29,15 +29,12 @@ use network::adva::fsp150::snmp::mode::components::resources qw($oids);
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} =
'^(?:shefl|card)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
$self->{thresholds} = { $self->{thresholds} = {
operational => [ operational => [
['normal', 'OK'], ['normal', 'OK'],
['outage', 'CRITICAL'], ['outage', 'CRITICAL']
], ],
secondary => [ secondary => [
['fault', 'CRITICAL'], ['fault', 'CRITICAL'],
@ -66,8 +63,7 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1, force_new_perfdata => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1, force_new_perfdata => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {});
});
return $self; return $self;
} }

View File

@ -27,8 +27,7 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(cardtemperature|sfp)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(cardtemperature|sfp\.(temperature|voltage|current|txpower|rxpower))$'; $self->{regexp_threshold_numeric_check_section_option} = '^(cardtemperature|sfp\.(temperature|voltage|current|txpower|rxpower))$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -37,8 +36,8 @@ sub set_system {
sfp => [ sfp => [
['noLos', 'OK'], ['noLos', 'OK'],
['notAvailable', 'OK'], ['notAvailable', 'OK'],
['los', 'WARNING'], ['los', 'WARNING']
], ]
}; };
$self->{components_path} = 'network::alcatel::isam::snmp::mode::components'; $self->{components_path} = 'network::alcatel::isam::snmp::mode::components';
@ -59,11 +58,9 @@ sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {});
{
});
return $self; return $self;
} }

View File

@ -25,10 +25,7 @@ use network::alcatel::omniswitch::snmp::mode::components::resources qw(%oids);
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} =
'^(?:backplane|chassis|container|fan|module|other|port|psu|sensor|stack|unknown)\.(?:oper|admin|status)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
$self->{thresholds} = { $self->{thresholds} = {
@ -90,10 +87,9 @@ 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;
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {});
});
return $self; return $self;
} }

View File

@ -27,8 +27,7 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(?:fan|voltage|temperature|psu)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(?:fan|voltage|temperature)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(?:fan|voltage|temperature)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -37,16 +36,16 @@ sub set_system {
psu => [ psu => [
['good', 'OK'], ['good', 'OK'],
['failed', 'CRITICAL'], ['failed', 'CRITICAL'],
['notPowered', 'WARNING'], ['notPowered', 'WARNING']
], ],
fan => [ fan => [
['good', 'OK'], ['good', 'OK'],
['failed', 'CRITICAL'], ['failed', 'CRITICAL']
], ],
default => [ default => [
['inRange', 'OK'], ['inRange', 'OK'],
['outOfRange', 'CRITICAL'], ['outOfRange', 'CRITICAL']
], ]
}; };
$self->{components_path} = 'network::allied::snmp::mode::components'; $self->{components_path} = 'network::allied::snmp::mode::components';
@ -65,8 +64,7 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, force_new_perfdata => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, force_new_perfdata => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {});
});
return $self; return $self;
} }

View File

@ -29,8 +29,7 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(temperature|alarm)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -39,12 +38,12 @@ sub set_system {
temperature => [ temperature => [
['normal', 'OK'], ['normal', 'OK'],
['warning', 'WARNING'], ['warning', 'WARNING'],
['critical', 'CRITICAL'], ['critical', 'CRITICAL']
], ],
alarm => [ alarm => [
['normal', 'OK'], ['normal', 'OK'],
['warning', 'WARNING'], ['warning', 'WARNING']
], ]
}; };
$self->{components_path} = 'network::atto::fibrebridge::snmp::mode::components'; $self->{components_path} = 'network::atto::fibrebridge::snmp::mode::components';
@ -62,10 +61,9 @@ sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, force_new_perfdata => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, force_new_perfdata => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {});
});
return $self; return $self;
} }

View File

@ -28,8 +28,6 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(module|fantray|psu)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
$self->{thresholds} = { $self->{thresholds} = {
@ -39,7 +37,7 @@ sub set_system {
['warning', 'WARNING'], ['warning', 'WARNING'],
['minor', 'WARNING'], ['minor', 'WARNING'],
['major', 'CRITICAL'], ['major', 'CRITICAL'],
['critical', 'CRITICAL'], ['critical', 'CRITICAL']
], ],
module => [ module => [
['moduleNotExist', 'OK'], ['moduleNotExist', 'OK'],
@ -48,8 +46,8 @@ sub set_system {
['moduleBackToServiceStart', 'WARNING'], ['moduleBackToServiceStart', 'WARNING'],
['moduleMismatch', 'WARNING'], ['moduleMismatch', 'WARNING'],
['moduleFaulty', 'CRITICAL'], ['moduleFaulty', 'CRITICAL'],
['notApplicable', 'OK'], ['notApplicable', 'OK']
], ]
}; };
$self->{components_path} = 'network::audiocodes::snmp::mode::components'; $self->{components_path} = 'network::audiocodes::snmp::mode::components';
@ -67,11 +65,9 @@ sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {});
{
});
return $self; return $self;
} }
@ -113,4 +109,4 @@ Example: --threshold-overload='psu,CRITICAL,^(?!(cleared)$)'
=back =back
=cut =cut

View File

@ -27,9 +27,8 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_numeric_check_section_option} = '^(fan|temperature|voltage)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(fan|temperature|voltage)$';
$self->{regexp_threshold_overload_check_section_option} = '^(psu)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -37,8 +36,8 @@ sub set_system {
'psu' => [ 'psu' => [
['ok', 'OK'], ['ok', 'OK'],
['critical', 'CRITICAL'], ['critical', 'CRITICAL'],
['unknown', 'UNKNOWN'], ['unknown', 'UNKNOWN']
], ]
}; };
$self->{components_path} = 'network::barracuda::cloudgen::snmp::mode::components'; $self->{components_path} = 'network::barracuda::cloudgen::snmp::mode::components';
@ -56,10 +55,9 @@ 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;
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {});
});
return $self; return $self;
} }

View File

@ -27,8 +27,7 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(sensor|disk|sensor_opstatus)$';
$self->{regexp_threshold_numeric_check_section_option} = '^sensor$'; $self->{regexp_threshold_numeric_check_section_option} = '^sensor$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -38,7 +37,7 @@ sub set_system {
['ok', 'OK'], ['ok', 'OK'],
['unavailable', 'UNKNOWN'], ['unavailable', 'UNKNOWN'],
['nonoperational', 'UNKNOWN'], ['nonoperational', 'UNKNOWN'],
['unknown', 'UNKNOWN'], ['unknown', 'UNKNOWN']
], ],
sensor => [ sensor => [
['ok', 'OK'], ['ok', 'OK'],
@ -55,7 +54,7 @@ sub set_system {
['temperatureHighSevere', 'CRITICAL'], ['temperatureHighSevere', 'CRITICAL'],
['fanSlowWarning', 'WARNING'], ['fanSlowWarning', 'WARNING'],
['fanSlowCritical', 'CRITICAL'], ['fanSlowCritical', 'CRITICAL'],
['fanStopped', 'CRITICAL'], ['fanStopped', 'CRITICAL']
], ],
disk => [ disk => [
['present', 'OK'], ['present', 'OK'],
@ -67,8 +66,8 @@ sub set_system {
['empty', 'WARNING'], ['empty', 'WARNING'],
['ioerror', 'CRITICAL'], ['ioerror', 'CRITICAL'],
['unusable', 'CRITICAL'], ['unusable', 'CRITICAL'],
['unknown', 'UNKNOWN'], ['unknown', 'UNKNOWN']
], ]
}; };
$self->{components_path} = 'network::bluecoat::snmp::mode::components'; $self->{components_path} = 'network::bluecoat::snmp::mode::components';
@ -86,11 +85,9 @@ 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;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {});
{
});
return $self; return $self;
} }

View File

@ -27,8 +27,7 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(switch|sensor)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -40,15 +39,15 @@ sub set_system {
['below-min', 'WARNING'], ['below-min', 'WARNING'],
['nominal', 'OK'], ['nominal', 'OK'],
['above-max', 'CRITICAL'], ['above-max', 'CRITICAL'],
['absent', 'OK'], ['absent', 'OK']
], ],
switch => [ switch => [
['online', 'OK'], ['online', 'OK'],
['offline', 'WARNING'], ['offline', 'WARNING'],
['testing', 'WARNING'], ['testing', 'WARNING'],
['faulty', 'CRITICAL'], ['faulty', 'CRITICAL'],
['absent', 'OK'], ['absent', 'OK']
], ]
}; };
$self->{components_path} = 'network::brocade::snmp::mode::components'; $self->{components_path} = 'network::brocade::snmp::mode::components';
@ -59,16 +58,15 @@ sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_load_components => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_load_components => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {});
});
return $self; return $self;
} }
sub snmp_execute { sub snmp_execute {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{snmp} = $options{snmp}; $self->{snmp} = $options{snmp};
$self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request});
} }

View File

@ -27,9 +27,7 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(temperature|voltage|fan|psu|raiddisk)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
$self->{thresholds} = { $self->{thresholds} = {
@ -89,10 +87,8 @@ sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1, no_absent => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1, no_absent => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {});
{
});
return $self; return $self;
} }

View File

@ -27,8 +27,7 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(psu)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fanspeed|voltage)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fanspeed|voltage)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -38,8 +37,8 @@ sub set_system {
['normal', 'OK'], ['normal', 'OK'],
['not present', 'OK'], ['not present', 'OK'],
['failed', 'CRITICAL'], ['failed', 'CRITICAL'],
['not supported', 'UNKNOWN'], ['not supported', 'UNKNOWN']
], ]
}; };
$self->{components_path} = 'network::citrix::netscaler::snmp::mode::components'; $self->{components_path} = 'network::citrix::netscaler::snmp::mode::components';
@ -69,11 +68,9 @@ 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;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {});
{
});
return $self; return $self;
} }

View File

@ -25,15 +25,13 @@ use base qw(centreon::plugins::templates::hardware);
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(hardware|software)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
$self->{thresholds} = { $self->{thresholds} = {
default => [ default => [
['OK', 'OK'], ['OK', 'OK'],
['ERROR', 'CRITICAL'], ['ERROR', 'CRITICAL']
], ]
}; };
$self->{components_path} = 'network::citrix::sdx::snmp::mode::components'; $self->{components_path} = 'network::citrix::sdx::snmp::mode::components';
@ -44,10 +42,8 @@ sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1, no_load_components => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1, no_load_components => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {});
{
});
return $self; return $self;
} }

View File

@ -28,8 +28,6 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(service)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
$self->{thresholds} = { $self->{thresholds} = {
@ -40,8 +38,8 @@ sub set_system {
['running', 'OK'], ['running', 'OK'],
['exiting', 'CRITICAL'], ['exiting', 'CRITICAL'],
['dead', 'CRITICAL'], ['dead', 'CRITICAL'],
['unregistered', 'OK'], ['unregistered', 'OK']
], ]
}; };
$self->{components_path} = 'network::cyberoam::snmp::mode::components'; $self->{components_path} = 'network::cyberoam::snmp::mode::components';
@ -60,8 +58,7 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {});
});
return $self; return $self;
} }

View File

@ -27,9 +27,7 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} =
'^(?:card|temperature|fan|fantray|psu)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(?:temperature)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(?:temperature)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -73,8 +71,7 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, force_new_perfdata => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, force_new_perfdata => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {});
});
return $self; return $self;
} }

View File

@ -28,8 +28,6 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(fan|psu)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
$self->{thresholds} = { $self->{thresholds} = {
@ -39,7 +37,7 @@ sub set_system {
['critical', 'CRITICAL'], ['critical', 'CRITICAL'],
['notFunctioning', 'CRITICAL'], ['notFunctioning', 'CRITICAL'],
['notPresent', 'OK'], ['notPresent', 'OK'],
['normal', 'OK'], ['normal', 'OK']
], ],
fan => [ fan => [
['shutdown', 'WARNING'], ['shutdown', 'WARNING'],
@ -47,8 +45,8 @@ sub set_system {
['critical', 'CRITICAL'], ['critical', 'CRITICAL'],
['notFunctioning', 'CRITICAL'], ['notFunctioning', 'CRITICAL'],
['notPresent', 'OK'], ['notPresent', 'OK'],
['normal', 'OK'], ['normal', 'OK']
], ]
}; };
$self->{components_path} = 'network::dlink::dgs3100::snmp::mode::components'; $self->{components_path} = 'network::dlink::dgs3100::snmp::mode::components';
@ -66,10 +64,8 @@ sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {});
{
});
return $self; return $self;
} }
@ -112,4 +108,4 @@ Example: --threshold-overload='psu,CRITICAL,^(?!(normal)$)'
=back =back
=cut =cut

View File

@ -27,8 +27,7 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(fan|psu)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(fan|temperature)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(fan|temperature)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -41,7 +40,7 @@ sub set_system {
['lowVoltage', 'WARNING'], ['lowVoltage', 'WARNING'],
['overCurrent', 'CRITICAL'], ['overCurrent', 'CRITICAL'],
['fail', 'CRITICAL'], ['fail', 'CRITICAL'],
['disconnect', 'WARNING'], ['disconnect', 'WARNING']
], ],
fan => [ fan => [
['working', 'OK'], ['working', 'OK'],
@ -50,8 +49,8 @@ sub set_system {
['speed-0', 'WARNING'], ['speed-0', 'WARNING'],
['speed-low', 'WARNING'], ['speed-low', 'WARNING'],
['speed-middle', 'OK'], ['speed-middle', 'OK'],
['speed-high', 'WARNING'], ['speed-high', 'WARNING']
], ]
}; };
$self->{components_path} = 'network::dlink::standard::snmp::mode::components'; $self->{components_path} = 'network::dlink::standard::snmp::mode::components';
@ -69,10 +68,8 @@ sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {});
{
});
return $self; return $self;
} }
@ -120,4 +117,4 @@ Example: --critical='temperature,.*,40'
=back =back
=cut =cut

View File

@ -24,9 +24,7 @@ use base qw(centreon::plugins::templates::hardware);
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(psu|frameline)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
$self->{thresholds} = { $self->{thresholds} = {
@ -50,10 +48,8 @@ sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1, no_load_components => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1, no_load_components => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {});
{
});
return $self; return $self;
} }

View File

@ -27,8 +27,7 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(fan|psu|slot|poe)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan|poe|psu\.power|psu\.fan)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan|poe|psu\.power|psu\.fan)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -91,8 +90,7 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options); my $self = $class->SUPER::new(package => __PACKAGE__, %options);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {});
});
return $self; return $self;
} }

View File

@ -27,8 +27,7 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(temperature|fan|psu)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -37,13 +36,13 @@ sub set_system {
fan => [ fan => [
['bad', 'CRITICAL'], ['bad', 'CRITICAL'],
['good', 'OK'], ['good', 'OK'],
['notPresent', 'OK'], ['notPresent', 'OK']
], ],
psu => [ psu => [
['bad', 'CRITICAL'], ['bad', 'CRITICAL'],
['good', 'OK'], ['good', 'OK'],
['notPresent', 'OK'], ['notPresent', 'OK']
], ]
}; };
$self->{components_path} = 'network::f5::bigip::snmp::mode::components'; $self->{components_path} = 'network::f5::bigip::snmp::mode::components';
@ -61,10 +60,8 @@ 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;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {});
{
});
return $self; return $self;
} }

View File

@ -27,8 +27,7 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(fan|psu|led)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -68,9 +67,8 @@ 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;
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {});
});
return $self; return $self;
} }

View File

@ -28,8 +28,6 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(sensor|fan|psu)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
$self->{thresholds} = { $self->{thresholds} = {
@ -77,10 +75,9 @@ sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {
{ });
});
return $self; return $self;
} }

View File

@ -27,9 +27,7 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(domain|enclosure|module|port|moduleport|physicalserver|enet|fc|profile)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
$self->{thresholds} = { $self->{thresholds} = {
@ -69,10 +67,9 @@ sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1, no_absent => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1, no_absent => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {
{ });
});
return $self; return $self;
} }
@ -110,4 +107,4 @@ Example: --threshold-overload='module,CRITICAL,^(?!(normal)$)'
=back =back
=cut =cut

View File

@ -29,7 +29,6 @@ use centreon::plugins::statefile;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(fan|temperature)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(fan|temperature)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(fan|temperature)$';
$self->{cb_hook1} = 'init_cache'; $self->{cb_hook1} = 'init_cache';
@ -38,8 +37,8 @@ sub set_system {
$self->{thresholds} = { $self->{thresholds} = {
fan => [ fan => [
['abnormal', 'CRITICAL'], ['abnormal', 'CRITICAL'],
['normal', 'OK'], ['normal', 'OK']
], ]
}; };
$self->{components_path} = 'network::huawei::snmp::mode::components'; $self->{components_path} = 'network::huawei::snmp::mode::components';
@ -64,10 +63,10 @@ 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 => {
'reload-cache-time:s' => { name => 'reload_cache_time', default => 180 }, 'reload-cache-time:s' => { name => 'reload_cache_time', default => 180 },
'short-name' => { name => 'short_name' }, 'short-name' => { name => 'short_name' }
}); });
$self->{statefile_cache} = centreon::plugins::statefile->new(%options); $self->{statefile_cache} = centreon::plugins::statefile->new(%options);

View File

@ -27,9 +27,7 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(service)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
$self->{thresholds} = { $self->{thresholds} = {
@ -38,8 +36,8 @@ sub set_system {
['working', 'OK'], ['working', 'OK'],
['inactive', 'OK'], ['inactive', 'OK'],
['warning', 'WARNING'], ['warning', 'WARNING'],
['failed', 'CRITICAL'], ['failed', 'CRITICAL']
], ]
}; };
$self->{components_path} = 'network::infoblox::snmp::mode::components'; $self->{components_path} = 'network::infoblox::snmp::mode::components';
@ -50,7 +48,7 @@ sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_load_components => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_load_components => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => {}); $options{options}->add_options(arguments => {});
return $self; return $self;

View File

@ -28,8 +28,7 @@ use centreon::plugins::statefile;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(fru|operating|alarm)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(operating-temperature|operating-cpu|operating-buffer|operating-heap)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(operating-temperature|operating-cpu|operating-buffer|operating-heap)$';
$self->{cb_hook1} = 'init_cache'; $self->{cb_hook1} = 'init_cache';
@ -81,9 +80,9 @@ 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;
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {
'reload-cache-time:s' => { name => 'reload_cache_time', default => 180 }, 'reload-cache-time:s' => { name => 'reload_cache_time', default => 180 }
}); });
$self->{statefile_cache} = centreon::plugins::statefile->new(%options); $self->{statefile_cache} = centreon::plugins::statefile->new(%options);

View File

@ -27,8 +27,7 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(psu|module|fan)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -63,10 +62,8 @@ sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {});
{
});
return $self; return $self;
} }

View File

@ -28,7 +28,6 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(?:faultled)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(?:temperature)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(?:temperature)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -54,9 +53,8 @@ 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;
} }

View File

@ -27,8 +27,6 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(cpu|fan|psu)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -65,10 +63,8 @@ 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;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {});
{
});
return $self; return $self;
} }
@ -111,4 +107,4 @@ Example: --threshold-overload='fan,CRITICAL,^(?!(notActive)$)'
=back =back
=cut =cut

View File

@ -27,8 +27,7 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(temperature|fan|psu)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -69,11 +68,9 @@ 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;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {});
{
});
return $self; return $self;
} }

View File

@ -27,12 +27,11 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(entity)$';
$self->{regexp_threshold_numeric_check_section_option} = '^temperature$'; $self->{regexp_threshold_numeric_check_section_option} = '^temperature$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
$self->{thresholds} = { $self->{thresholds} = {
default => [ default => [
['unknown', 'UNKNOWN'], ['unknown', 'UNKNOWN'],
@ -48,8 +47,8 @@ sub set_system {
['downgrade', 'OK'], ['downgrade', 'OK'],
['resetPending', 'OK'], ['resetPending', 'OK'],
['softReset', 'OK'], ['softReset', 'OK'],
['preExtension', 'OK'], ['preExtension', 'OK']
], ]
}; };
$self->{components_path} = 'network::nokia::timos::snmp::mode::components'; $self->{components_path} = 'network::nokia::timos::snmp::mode::components';
@ -67,11 +66,9 @@ sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_load_components => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_load_components => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {});
{
});
return $self; return $self;
} }

View File

@ -27,8 +27,7 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(fan|psu|card|entity)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan.temperature)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan.temperature)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -83,11 +82,9 @@ sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {});
{
});
return $self; return $self;
} }
@ -134,4 +131,4 @@ Example: --critical='temperature,.*,40'
=back =back
=cut =cut

View File

@ -28,8 +28,6 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} =
'^(?:psu|temperature|voltage)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(?:temperature|voltage)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(?:temperature|voltage)$';
$self->{cb_hook2} = 'ssh_execute'; $self->{cb_hook2} = 'ssh_execute';
@ -61,8 +59,7 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, force_new_perfdata => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, force_new_perfdata => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => { $options{options}->add_options(arguments => {});
});
return $self; return $self;
} }

View File

@ -27,8 +27,7 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(temperature|psu)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -58,9 +57,9 @@ 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;
} }

View File

@ -27,17 +27,15 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(fan|psu|board)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
$self->{thresholds} = { $self->{thresholds} = {
default => [ default => [
['disabled', 'OK'], ['disabled', 'OK'],
['ok', 'OK'], ['ok', 'OK'],
['failed', 'CRITICAL'], ['failed', 'CRITICAL']
], ]
}; };
$self->{components_path} = 'network::polycom::rmx::snmp::mode::components'; $self->{components_path} = 'network::polycom::rmx::snmp::mode::components';
@ -48,7 +46,7 @@ my %map_status = (1 => 'disabled', 2 => 'ok', 3 => 'failed');
my $mapping = { my $mapping = {
hardwareFanStatus => { oid => '.1.3.6.1.4.1.13885.110.1.3.2.1', map => \%map_status }, hardwareFanStatus => { oid => '.1.3.6.1.4.1.13885.110.1.3.2.1', map => \%map_status },
hardwarePowerSupplyStatus => { oid => '.1.3.6.1.4.1.13885.110.1.3.3.1', map => \%map_status }, hardwarePowerSupplyStatus => { oid => '.1.3.6.1.4.1.13885.110.1.3.3.1', map => \%map_status },
hardwareIntegratedBoardStatus => { oid => '.1.3.6.1.4.1.13885.110.1.3.4.1', map => \%map_status }, hardwareIntegratedBoardStatus => { oid => '.1.3.6.1.4.1.13885.110.1.3.4.1', map => \%map_status }
}; };
sub snmp_execute { sub snmp_execute {
@ -64,11 +62,9 @@ sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {});
{
});
return $self; return $self;
} }
@ -104,4 +100,4 @@ Example: --threshold-overload='psu,CRITICAL,disabled'
=back =back
=cut =cut

View File

@ -25,8 +25,6 @@ use base qw(centreon::plugins::templates::hardware);
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(cpu|temperature|psu|fan)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
$self->{thresholds} = { $self->{thresholds} = {
@ -60,10 +58,8 @@ sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1, no_load_components => 1); my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1, no_load_components => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {});
{
});
return $self; return $self;
} }
@ -276,4 +272,4 @@ sub check {
} }
1; 1;

View File

@ -28,7 +28,6 @@ use warnings;
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_overload_check_section_option} = '^(temperature|fan|voltage)$';
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan.speed|voltage)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan.speed|voltage)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
@ -36,8 +35,8 @@ sub set_system {
$self->{thresholds} = { $self->{thresholds} = {
fan => [ fan => [
['abnormal', 'CRITICAL'], ['abnormal', 'CRITICAL'],
['normal', 'OK'], ['normal', 'OK']
], ]
}; };
$self->{components_path} = 'network::raisecom::snmp::mode::components'; $self->{components_path} = 'network::raisecom::snmp::mode::components';
@ -56,9 +55,7 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options); my $self = $class->SUPER::new(package => __PACKAGE__, %options);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => $options{options}->add_options(arguments => {});
{
});
return $self; return $self;
} }

Some files were not shown because too many files have changed in this diff Show More