From ee723b48da7e9f112ea460b5b3453e58dde8eb81 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 28 Jul 2020 10:25:35 +0200 Subject: [PATCH] Fix #2102 --- apps/inin/mediaserver/snmp/mode/component.pm | 2 - apps/lmsensors/snmp/mode/sensors.pm | 1 - apps/vmware/wsman/mode/hardware.pm | 2 - .../common/adic/tape/snmp/mode/hardware.pm | 7 +-- .../common/airespace/snmp/mode/hardware.pm | 9 +-- centreon/common/aruba/snmp/mode/hardware.pm | 4 +- centreon/common/bluearc/snmp/mode/hardware.pm | 5 +- .../broadcom/fastpath/snmp/mode/hardware.pm | 6 +- .../broadcom/megaraid/snmp/mode/hardware.pm | 6 +- .../cisco/ironport/snmp/mode/hardware.pm | 1 - .../smallbusiness/snmp/mode/environment.pm | 10 ++-- .../cisco/standard/snmp/mode/environment.pm | 1 - .../dell/fastpath/snmp/mode/environment.pm | 5 +- centreon/common/emc/navisphere/mode/sp.pm | 11 ++-- centreon/common/force10/snmp/mode/hardware.pm | 12 ++-- .../fortinet/fortigate/snmp/mode/hardware.pm | 1 - centreon/common/foundry/snmp/mode/hardware.pm | 1 - .../common/ibm/nos/snmp/mode/environment.pm | 1 - .../ibm/tapelibrary/snmp/mode/hardware.pm | 9 +-- .../polycom/endpoint/snmp/mode/hardware.pm | 2 - .../common/radlan/snmp/mode/environment.pm | 1 - .../common/redfish/restapi/mode/hardware.pm | 1 - centreon/common/sun/snmp/mode/hardware.pm | 8 +-- centreon/common/violin/snmp/mode/hardware.pm | 1 - centreon/plugins/templates/hardware.pm | 31 +++------- database/postgres/psqlcmd.pm | 24 +++----- hardware/ats/apc/snmp/mode/devicestatus.pm | 18 +++--- .../devices/aeg/acm/snmp/mode/alarmsstatus.pm | 17 +++--- .../camera/hanwha/snmp/mode/hardware.pm | 12 ++-- .../cisco/ces/restapi/mode/components.pm | 10 ++-- .../hsm/protecttoolkit/mode/hardware.pm | 58 ++++++++++--------- .../video/axis/snmp/mode/environment.pm | 28 ++++----- .../avocent/acs/6000/snmp/mode/hardware.pm | 5 +- .../avocent/acs/8000/snmp/mode/hardware.pm | 7 +-- hardware/pdu/apc/snmp/mode/hardware.pm | 15 +++-- .../gateway/snmp/mode/sensors.pm | 6 +- hardware/sensors/akcp/snmp/mode/sensors.pm | 21 +++---- hardware/sensors/hwgste/snmp/mode/sensors.pm | 18 +++--- hardware/sensors/jacarta/snmp/mode/sensors.pm | 16 +++-- hardware/sensors/netbotz/snmp/mode/sensors.pm | 8 +-- .../sensors/sensorip/snmp/mode/sensors.pm | 15 +++-- .../sensorgateway/snmp/mode/sensors.pm | 13 ++--- hardware/server/cisco/ucs/mode/equipment.pm | 5 +- .../server/dell/cmc/snmp/mode/hardware.pm | 11 ++-- .../server/dell/idrac/snmp/mode/hardware.pm | 39 +++++-------- .../dell/openmanage/snmp/mode/hardware.pm | 12 ++-- hardware/server/fujitsu/snmp/mode/hardware.pm | 25 ++++---- .../hp/bladechassis/snmp/mode/hardware.pm | 11 ++-- .../server/hp/ilo/xmlapi/mode/hardware.pm | 22 ++++--- .../hp/oneview/restapi/mode/hardware.pm | 8 +-- .../server/hp/proliant/snmp/mode/hardware.pm | 46 +++++++-------- hardware/server/huawei/hmm/snmp/mode/blade.pm | 22 ++++--- .../server/huawei/hmm/snmp/mode/chassis.pm | 16 ++--- .../server/huawei/ibmc/snmp/mode/hardware.pm | 25 ++++---- .../mgmt_cards/imm/snmp/mode/environment.pm | 21 +++---- .../server/lenovo/xcc/snmp/mode/hardware.pm | 19 +++--- .../sun/mgmt_cards/mode/showenvironment.pm | 25 ++++---- .../superdoctor/snmp/mode/hardware.pm | 14 ++--- .../avaya/mediagateway/snmp/mode/hardware.pm | 15 ++--- hardware/ups/alpha/snmp/mode/alarms.pm | 12 ++-- hardware/ups/apc/snmp/mode/sensors.pm | 8 +-- network/3com/snmp/mode/hardware.pm | 10 ++-- network/a10/ax/snmp/mode/hardware.pm | 14 ++--- network/acmepacket/snmp/mode/hardware.pm | 15 ++--- network/adva/fsp150/snmp/mode/hardware.pm | 8 +-- network/alcatel/isam/snmp/mode/hardware.pm | 15 ++--- .../alcatel/omniswitch/snmp/mode/hardware.pm | 12 ++-- network/allied/snmp/mode/hardware.pm | 14 ++--- .../atto/fibrebridge/snmp/mode/hardware.pm | 16 +++-- network/audiocodes/snmp/mode/hardware.pm | 18 +++--- .../barracuda/cloudgen/snmp/mode/hardware.pm | 14 ++--- network/bluecoat/snmp/mode/hardware.pm | 19 +++--- network/brocade/snmp/mode/hardware.pm | 16 +++-- network/checkpoint/snmp/mode/hardware.pm | 10 +--- network/citrix/netscaler/snmp/mode/health.pm | 15 ++--- network/citrix/sdx/snmp/mode/hardware.pm | 12 ++-- network/cyberoam/snmp/mode/services.pm | 9 +-- network/dell/os10/snmp/mode/hardware.pm | 7 +-- network/dlink/dgs3100/snmp/mode/hardware.pm | 16 ++--- network/dlink/standard/snmp/mode/hardware.pm | 17 +++--- network/evertz/FC7800/snmp/mode/hardware.pm | 10 +--- network/extreme/snmp/mode/hardware.pm | 6 +- network/f5/bigip/snmp/mode/hardware.pm | 15 ++--- .../hirschmann/standard/snmp/mode/hardware.pm | 8 +-- network/hp/procurve/snmp/mode/environment.pm | 9 +-- network/hp/vc/snmp/mode/hardware.pm | 13 ++--- network/huawei/snmp/mode/hardware.pm | 11 ++-- network/infoblox/snmp/mode/services.pm | 10 ++-- network/juniper/common/junos/mode/hardware.pm | 7 +-- .../common/screenos/snmp/mode/hardware.pm | 9 +-- .../flexsystem/snmp/mode/environment.pm | 6 +- .../mrv/optiswitch/snmp/mode/environment.pm | 10 +--- network/netgear/mseries/snmp/mode/hardware.pm | 11 ++-- network/nokia/timos/snmp/mode/hardware.pm | 19 +++--- network/nortel/standard/snmp/mode/hardware.pm | 13 ++--- network/paloalto/ssh/mode/environment.pm | 5 +- network/perle/ids/snmp/mode/hardware.pm | 7 +-- network/polycom/rmx/snmp/mode/hardware.pm | 20 +++---- network/radware/alteon/snmp/mode/hardware.pm | 10 +--- network/raisecom/snmp/mode/hardware.pm | 9 +-- network/redback/snmp/mode/hardware.pm | 20 +++---- network/ruggedcom/mode/hardware.pm | 6 +- network/sophos/es/snmp/mode/health.pm | 17 +++--- os/solaris/local/mode/lomv120.pm | 10 ++-- snmp_standard/mode/entity.pm | 5 +- snmp_standard/mode/hardwaredevice.pm | 8 +-- snmp_standard/mode/hardwarefibrealliance.pm | 2 - .../buffalo/terastation/snmp/mode/hardware.pm | 11 ++-- storage/dell/compellent/snmp/mode/hardware.pm | 20 +++---- storage/dell/equallogic/snmp/mode/hardware.pm | 13 ++--- storage/dell/fluidfs/snmp/mode/hardware.pm | 11 ++-- storage/dell/me4/restapi/mode/hardware.pm | 7 +-- storage/emc/DataDomain/mode/hardware.pm | 12 ++-- storage/emc/celerra/local/mode/getreason.pm | 23 ++++---- storage/emc/isilon/snmp/mode/hardware.pm | 5 +- .../emc/unisphere/restapi/mode/hardware.pm | 7 +-- .../hitachi/standard/snmp/mode/hardware.pm | 16 ++--- storage/hp/3par/ssh/mode/hardware.pm | 7 +-- storage/hp/eva/cli/mode/hardware.pm | 10 +--- storage/hp/lefthand/snmp/mode/hardware.pm | 11 ++-- storage/hp/msl/snmp/mode/hardware.pm | 6 +- storage/hp/p2000/xmlapi/mode/health.pm | 4 +- storage/hp/storeonce/ssh/mode/hardware.pm | 9 +-- storage/ibm/fs900/snmp/mode/hardware.pm | 9 +-- storage/ibm/storwize/ssh/mode/hardware.pm | 7 +-- storage/ibm/ts2900/snmp/mode/hardware.pm | 8 +-- storage/lenovo/iomega/snmp/mode/hardware.pm | 6 +- storage/netapp/ontap/restapi/mode/hardware.pm | 6 +- .../santricity/restapi/mode/hardware.pm | 8 +-- .../netgear/readynas/snmp/mode/hardware.pm | 11 ++-- storage/nimble/restapi/mode/hardware.pm | 3 +- storage/oracle/zs/restapi/mode/hardware.pm | 6 +- storage/oracle/zs/snmp/mode/hardware.pm | 14 ++--- storage/overland/neo/snmp/mode/hardware.pm | 14 ++--- storage/purestorage/restapi/mode/hardware.pm | 13 ++--- storage/qnap/snmp/mode/hardware.pm | 12 ++-- storage/qsan/nas/snmp/mode/hardware.pm | 14 ++--- storage/quantum/scalar/snmp/mode/hardware.pm | 7 +-- storage/storagetek/sl/snmp/mode/hardware.pm | 13 ++--- storage/synology/snmp/mode/hardware.pm | 6 +- 140 files changed, 641 insertions(+), 1006 deletions(-) diff --git a/apps/inin/mediaserver/snmp/mode/component.pm b/apps/inin/mediaserver/snmp/mode/component.pm index 4051b4929..9fb48f8ec 100644 --- a/apps/inin/mediaserver/snmp/mode/component.pm +++ b/apps/inin/mediaserver/snmp/mode/component.pm @@ -28,8 +28,6 @@ use warnings; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(device)$'; - $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { diff --git a/apps/lmsensors/snmp/mode/sensors.pm b/apps/lmsensors/snmp/mode/sensors.pm index 76e33ef98..d0a5bdcba 100644 --- a/apps/lmsensors/snmp/mode/sensors.pm +++ b/apps/lmsensors/snmp/mode/sensors.pm @@ -28,7 +28,6 @@ use warnings; sub set_system { 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->{cb_hook1} = 'get_version'; # before the loads diff --git a/apps/vmware/wsman/mode/hardware.pm b/apps/vmware/wsman/mode/hardware.pm index 41b773dd5..c87cfe587 100644 --- a/apps/vmware/wsman/mode/hardware.pm +++ b/apps/vmware/wsman/mode/hardware.pm @@ -29,8 +29,6 @@ use apps::vmware::wsman::mode::components::resources qw($mapping_HealthState $ma sub set_system { 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->{cb_hook1} = 'get_type'; diff --git a/centreon/common/adic/tape/snmp/mode/hardware.pm b/centreon/common/adic/tape/snmp/mode/hardware.pm index 9952475c8..b31793beb 100644 --- a/centreon/common/adic/tape/snmp/mode/hardware.pm +++ b/centreon/common/adic/tape/snmp/mode/hardware.pm @@ -28,7 +28,6 @@ use warnings; sub set_system { 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->{cb_hook2} = 'snmp_execute'; @@ -83,9 +82,7 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); bless $self, $class; - $options{options}->add_options(arguments => - { - }); + $options{options}->add_options(arguments => {}); return $self; } @@ -133,4 +130,4 @@ Example: --critical='temperature,.*,40' =back -=cut \ No newline at end of file +=cut diff --git a/centreon/common/airespace/snmp/mode/hardware.pm b/centreon/common/airespace/snmp/mode/hardware.pm index 5964d3aed..df563fc6b 100644 --- a/centreon/common/airespace/snmp/mode/hardware.pm +++ b/centreon/common/airespace/snmp/mode/hardware.pm @@ -28,8 +28,6 @@ use warnings; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(psu)$'; - $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { @@ -55,9 +53,8 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1); bless $self, $class; - $options{options}->add_options(arguments => - { - }); + $options{options}->add_options(arguments => { + }); return $self; } @@ -100,4 +97,4 @@ Example: --threshold-overload='psu,WARNING,not operational' =back -=cut \ No newline at end of file +=cut diff --git a/centreon/common/aruba/snmp/mode/hardware.pm b/centreon/common/aruba/snmp/mode/hardware.pm index 120e73bfb..d863fc6ef 100644 --- a/centreon/common/aruba/snmp/mode/hardware.pm +++ b/centreon/common/aruba/snmp/mode/hardware.pm @@ -28,8 +28,6 @@ use warnings; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(fan|psu|module)$'; - $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { @@ -102,4 +100,4 @@ Example: --threshold-overload='fan,OK,inactive' =back =cut - \ No newline at end of file + diff --git a/centreon/common/bluearc/snmp/mode/hardware.pm b/centreon/common/bluearc/snmp/mode/hardware.pm index 6faa67899..980b07538 100644 --- a/centreon/common/bluearc/snmp/mode/hardware.pm +++ b/centreon/common/bluearc/snmp/mode/hardware.pm @@ -28,7 +28,6 @@ use warnings; sub set_system { 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->{cb_hook2} = 'snmp_execute'; @@ -96,9 +95,7 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); bless $self, $class; - $options{options}->add_options(arguments => - { - }); + $options{options}->add_options(arguments => {}); return $self; } diff --git a/centreon/common/broadcom/fastpath/snmp/mode/hardware.pm b/centreon/common/broadcom/fastpath/snmp/mode/hardware.pm index 3976d4556..43747db3f 100644 --- a/centreon/common/broadcom/fastpath/snmp/mode/hardware.pm +++ b/centreon/common/broadcom/fastpath/snmp/mode/hardware.pm @@ -28,7 +28,6 @@ use warnings; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(temperature|fan|psu)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan)$'; $self->{cb_hook2} = 'snmp_execute'; @@ -70,9 +69,8 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => - { - }); + $options{options}->add_options(arguments => { + }); return $self; } diff --git a/centreon/common/broadcom/megaraid/snmp/mode/hardware.pm b/centreon/common/broadcom/megaraid/snmp/mode/hardware.pm index 069cd050e..f768e27da 100644 --- a/centreon/common/broadcom/megaraid/snmp/mode/hardware.pm +++ b/centreon/common/broadcom/megaraid/snmp/mode/hardware.pm @@ -28,7 +28,6 @@ use warnings; sub set_system { 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->{cb_hook2} = 'snmp_execute'; @@ -82,9 +81,8 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => - { - }); + $options{options}->add_options(arguments => { + }); return $self; } diff --git a/centreon/common/cisco/ironport/snmp/mode/hardware.pm b/centreon/common/cisco/ironport/snmp/mode/hardware.pm index 7eae40000..4d0a21800 100644 --- a/centreon/common/cisco/ironport/snmp/mode/hardware.pm +++ b/centreon/common/cisco/ironport/snmp/mode/hardware.pm @@ -28,7 +28,6 @@ use warnings; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(raid|psu)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan)$'; $self->{cb_hook2} = 'snmp_execute'; diff --git a/centreon/common/cisco/smallbusiness/snmp/mode/environment.pm b/centreon/common/cisco/smallbusiness/snmp/mode/environment.pm index bb7d6170e..e02757487 100644 --- a/centreon/common/cisco/smallbusiness/snmp/mode/environment.pm +++ b/centreon/common/cisco/smallbusiness/snmp/mode/environment.pm @@ -32,7 +32,6 @@ use centreon::common::cisco::smallbusiness::snmp::mode::components::resources qw sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(?:fan|psu|temperature)$'; $self->{regexp_threshold_numeric_check_section_option} = '^temperature$'; $self->{cb_hook2} = 'snmp_execute'; @@ -44,13 +43,13 @@ sub set_system { ['warning', 'WARNING'], ['critical', 'CRITICAL'], ['shutdown', 'CRITICAL'], - ['notFunctioning', 'CRITICAL'], + ['notFunctioning', 'CRITICAL'] ], temperature => [ ['ok', 'OK'], ['unavailable', 'OK'], - ['nonoperational', 'CRITICAL'], - ], + ['nonoperational', 'CRITICAL'] + ] }; $self->{components_path} = 'centreon::common::cisco::smallbusiness::snmp::mode::components'; @@ -82,8 +81,7 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => { - }); + $options{options}->add_options(arguments => {}); return $self; } diff --git a/centreon/common/cisco/standard/snmp/mode/environment.pm b/centreon/common/cisco/standard/snmp/mode/environment.pm index 04aa0c4b2..dcd683b5b 100644 --- a/centreon/common/cisco/standard/snmp/mode/environment.pm +++ b/centreon/common/cisco/standard/snmp/mode/environment.pm @@ -29,7 +29,6 @@ use centreon::plugins::misc; sub set_system { 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->{cb_hook2} = 'snmp_execute'; diff --git a/centreon/common/dell/fastpath/snmp/mode/environment.pm b/centreon/common/dell/fastpath/snmp/mode/environment.pm index 0506bc471..cbfeddd4f 100644 --- a/centreon/common/dell/fastpath/snmp/mode/environment.pm +++ b/centreon/common/dell/fastpath/snmp/mode/environment.pm @@ -28,7 +28,6 @@ use warnings; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(fan|psu|temperature)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan)$'; $self->{cb_hook2} = 'snmp_execute'; @@ -70,9 +69,7 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => - { - }); + $options{options}->add_options(arguments => {}); return $self; } diff --git a/centreon/common/emc/navisphere/mode/sp.pm b/centreon/common/emc/navisphere/mode/sp.pm index 04cc2c37d..c1a014d3d 100644 --- a/centreon/common/emc/navisphere/mode/sp.pm +++ b/centreon/common/emc/navisphere/mode/sp.pm @@ -28,8 +28,6 @@ use warnings; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(fan|lcc|psu|battery|memory|cpu|iomodule|cable)$'; - $self->{cb_hook2} = 'navisphere_execute'; $self->{thresholds} = { @@ -89,10 +87,9 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1); bless $self, $class; - $options{options}->add_options(arguments => - { - "getcrus-options:s" => { name => 'getcrus_options', default => '-all' }, - }); + $options{options}->add_options(arguments => { + 'getcrus-options:s' => { name => 'getcrus_options', default => '-all' } + }); return $self; } @@ -129,4 +126,4 @@ If total (with skipped) is 0. (Default: 'critical' returns). =back -=cut \ No newline at end of file +=cut diff --git a/centreon/common/force10/snmp/mode/hardware.pm b/centreon/common/force10/snmp/mode/hardware.pm index f175ec80d..8f0651e35 100644 --- a/centreon/common/force10/snmp/mode/hardware.pm +++ b/centreon/common/force10/snmp/mode/hardware.pm @@ -28,7 +28,6 @@ use warnings; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(psu|fan)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature)$'; $self->{cb_hook2} = 'snmp_execute'; @@ -68,11 +67,10 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); - + + $options{options}->add_options(arguments => { + }); + return $self; } @@ -123,4 +121,4 @@ Set critical threshold for temperatures (syntax: type,instance,threshold) Example: --critical='temperature,.*,40' =back -=cut \ No newline at end of file +=cut diff --git a/centreon/common/fortinet/fortigate/snmp/mode/hardware.pm b/centreon/common/fortinet/fortigate/snmp/mode/hardware.pm index 08d940a99..4db633ab1 100644 --- a/centreon/common/fortinet/fortigate/snmp/mode/hardware.pm +++ b/centreon/common/fortinet/fortigate/snmp/mode/hardware.pm @@ -28,7 +28,6 @@ use warnings; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^sensors$'; $self->{regexp_threshold_numeric_check_section_option} = '^sensors$'; $self->{cb_hook1} = 'get_system_information'; diff --git a/centreon/common/foundry/snmp/mode/hardware.pm b/centreon/common/foundry/snmp/mode/hardware.pm index f63ceb0af..33b2e6eec 100644 --- a/centreon/common/foundry/snmp/mode/hardware.pm +++ b/centreon/common/foundry/snmp/mode/hardware.pm @@ -28,7 +28,6 @@ use warnings; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(?:board|fan|psu|temperature)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(?:temperature)$'; $self->{cb_hook2} = 'snmp_execute'; diff --git a/centreon/common/ibm/nos/snmp/mode/environment.pm b/centreon/common/ibm/nos/snmp/mode/environment.pm index c61f15ad4..501a19d85 100644 --- a/centreon/common/ibm/nos/snmp/mode/environment.pm +++ b/centreon/common/ibm/nos/snmp/mode/environment.pm @@ -28,7 +28,6 @@ use warnings; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(faultled)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(?:temperature)$'; $self->{cb_hook2} = 'snmp_execute'; diff --git a/centreon/common/ibm/tapelibrary/snmp/mode/hardware.pm b/centreon/common/ibm/tapelibrary/snmp/mode/hardware.pm index a7aefb2df..ae6c47089 100644 --- a/centreon/common/ibm/tapelibrary/snmp/mode/hardware.pm +++ b/centreon/common/ibm/tapelibrary/snmp/mode/hardware.pm @@ -28,8 +28,6 @@ use warnings; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(chassis|drive|changer|psu)$'; - $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { @@ -77,9 +75,8 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1); bless $self, $class; - $options{options}->add_options(arguments => - { - }); + $options{options}->add_options(arguments => { + }); return $self; } @@ -117,4 +114,4 @@ Example: --threshold-overload='chassis,CRITICAL,degraded' =back -=cut \ No newline at end of file +=cut diff --git a/centreon/common/polycom/endpoint/snmp/mode/hardware.pm b/centreon/common/polycom/endpoint/snmp/mode/hardware.pm index 53d71f315..9f5829394 100644 --- a/centreon/common/polycom/endpoint/snmp/mode/hardware.pm +++ b/centreon/common/polycom/endpoint/snmp/mode/hardware.pm @@ -28,8 +28,6 @@ use warnings; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(?:global|microphone|camera|nic|ptc|board)$'; - $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { diff --git a/centreon/common/radlan/snmp/mode/environment.pm b/centreon/common/radlan/snmp/mode/environment.pm index 7e518b74d..6926be7a0 100644 --- a/centreon/common/radlan/snmp/mode/environment.pm +++ b/centreon/common/radlan/snmp/mode/environment.pm @@ -32,7 +32,6 @@ use centreon::common::radlan::snmp::mode::components::resources qw( sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(?:fan|psu|temperature)$'; $self->{regexp_threshold_numeric_check_section_option} = '^temperature$'; $self->{cb_hook2} = 'snmp_execute'; diff --git a/centreon/common/redfish/restapi/mode/hardware.pm b/centreon/common/redfish/restapi/mode/hardware.pm index 95b2109e2..759b5756a 100644 --- a/centreon/common/redfish/restapi/mode/hardware.pm +++ b/centreon/common/redfish/restapi/mode/hardware.pm @@ -28,7 +28,6 @@ use warnings; sub set_system { 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->{cb_hook2} = 'execute_custom'; diff --git a/centreon/common/sun/snmp/mode/hardware.pm b/centreon/common/sun/snmp/mode/hardware.pm index 799664874..ecc54f986 100644 --- a/centreon/common/sun/snmp/mode/hardware.pm +++ b/centreon/common/sun/snmp/mode/hardware.pm @@ -28,8 +28,6 @@ use warnings; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(entity)$'; - $self->{regexp_threshold_numeric_check_section_option} = '^(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); bless $self, $class; - $options{options}->add_options(arguments => - { - }); + $options{options}->add_options(arguments => {}); return $self; } @@ -113,4 +109,4 @@ Example: --critical='temperature,.*,30' =back -=cut \ No newline at end of file +=cut diff --git a/centreon/common/violin/snmp/mode/hardware.pm b/centreon/common/violin/snmp/mode/hardware.pm index 1396d39ed..3f210bade 100644 --- a/centreon/common/violin/snmp/mode/hardware.pm +++ b/centreon/common/violin/snmp/mode/hardware.pm @@ -28,7 +28,6 @@ use warnings; sub set_system { 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->{cb_hook2} = 'snmp_execute'; diff --git a/centreon/plugins/templates/hardware.pm b/centreon/plugins/templates/hardware.pm index 1b7bbbed2..be99935fb 100644 --- a/centreon/plugins/templates/hardware.pm +++ b/centreon/plugins/templates/hardware.pm @@ -28,10 +28,6 @@ use warnings; sub set_system { 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->{cb_threshold_numeric_check_section_option} = 'callbackname'; @@ -92,7 +88,7 @@ sub new { if ($self->{performance} == 1) { $options{options}->add_options(arguments => { 'warning:s@' => { name => 'warning' }, - 'critical:s@' => { name => 'critical' }, + 'critical:s@' => { name => 'critical' } }); } @@ -101,14 +97,14 @@ sub new { if ($self->{filter_exclude} == 1) { $options{options}->add_options(arguments => { 'exclude:s' => { name => 'exclude' }, - 'filter:s@' => { name => 'filter' }, + 'filter:s@' => { name => 'filter' } }); } $self->{absent} = (defined($options{no_absent}) && $options{no_absent} == 1) ? 0 : 1; if ($self->{absent} == 1) { $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}}) { $options{options}->add_options(arguments => { '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 { ($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) { $self->{output}->add_option_msg(short_msg => "Wrong threshold-overload status '" . $val . "'."); $self->{output}->option_exit(); } - $self->{overload_th}->{$section} = [] if (!defined($self->{overload_th}->{$section})); - push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status, instance => $instance }; + push @{$self->{overload_th}}, { section => $section, filter => $filter, status => $status, instance => $instance }; } if ($self->{performance} == 1) { @@ -466,9 +451,9 @@ sub get_severity { my ($self, %options) = @_; my $status = 'UNKNOWN'; # default - if (defined($self->{overload_th}->{$options{section}})) { - foreach (@{$self->{overload_th}->{$options{section}}}) { - if ($options{value} =~ /$_->{filter}/i && + foreach (@{$self->{overload_th}}) { + if ($options{section} =~ /$_->{section}/i) { + if ($options{value} =~ /$_->{filter}/i && (!defined($options{instance}) || $options{instance} =~ /$_->{instance}/)) { $status = $_->{status}; return $status; diff --git a/database/postgres/psqlcmd.pm b/database/postgres/psqlcmd.pm index 21d960008..194d1a275 100644 --- a/database/postgres/psqlcmd.pm +++ b/database/postgres/psqlcmd.pm @@ -108,7 +108,7 @@ sub check_options { $self->{psql_cmd} = $self->{option_results}->{psql_cmd}; # 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 '') { $self->{output}->add_option_msg(short_msg => "Need to specify host argument."); @@ -182,21 +182,13 @@ sub quote { sub command_execution { my ($self, %options) = @_; - my ($lerror, $stdout, $exit_code) = centreon::plugins::misc::backtick( - command => $self->{psql_cmd}, - arguments => [@{$self->{args}}, '-c', $options{request}], - timeout => 30, - wait_exit => 1, - redirect_stderr => 1 - ); - if ($exit_code <= -1000) { - if ($exit_code == -1000) { - $self->{output}->output_add(severity => 'UNKNOWN', - short_msg => $stdout); - } - $self->{output}->display(); - $self->{output}->exit(); - } + my ($stdout, $exit_code) = centreon::plugins::misc::execute( + command => $self->{psql_cmd}, + command_options => join(' ', @{$self->{args}}) . ' -c "' . $options{request} . '"', + wait_exit => 1, + redirect_stderr => 1, + options => { timeout => 30 } + ); return ($exit_code, $stdout); } diff --git a/hardware/ats/apc/snmp/mode/devicestatus.pm b/hardware/ats/apc/snmp/mode/devicestatus.pm index 2e812427c..b0caec0cf 100644 --- a/hardware/ats/apc/snmp/mode/devicestatus.pm +++ b/hardware/ats/apc/snmp/mode/devicestatus.pm @@ -28,8 +28,6 @@ use warnings; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(entity)$'; - $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { @@ -46,8 +44,8 @@ sub set_system { ['fail', 'CRITICAL'], ['ok', 'OK'], ['inSync', 'OK'], - ['outOfSync', 'CRITICAL'], - ], + ['outOfSync', 'CRITICAL'] + ] }; $self->{components_path} = 'hardware::ats::apc::snmp::mode::components'; @@ -56,7 +54,7 @@ sub set_system { sub snmp_execute { my ($self, %options) = @_; - + $self->{snmp} = $options{snmp}; $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); } @@ -65,11 +63,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); - + + $options{options}->add_options(arguments => {}); + return $self; } @@ -106,4 +102,4 @@ Example: --threshold-overload='entity,SourceBStatus,WARNING,fail' =back -=cut \ No newline at end of file +=cut diff --git a/hardware/devices/aeg/acm/snmp/mode/alarmsstatus.pm b/hardware/devices/aeg/acm/snmp/mode/alarmsstatus.pm index a33b0ef78..82188dece 100644 --- a/hardware/devices/aeg/acm/snmp/mode/alarmsstatus.pm +++ b/hardware/devices/aeg/acm/snmp/mode/alarmsstatus.pm @@ -27,9 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(simple|multiple)$'; - + $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { @@ -37,12 +35,12 @@ sub set_system { ['true', 'CRITICAL'], ['false', 'OK'], ['on', 'CRITICAL'], - ['off', 'OK'], + ['off', 'OK'] ], multiple => [ ['true', 'CRITICAL'], - ['false', 'OK'], - ], + ['false', 'OK'] + ] }; $self->{components_path} = 'hardware::devices::aeg::acm::snmp::mode::components'; @@ -60,10 +58,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1); bless $self, $class; - - $options{options}->add_options(arguments => { - }); - + + $options{options}->add_options(arguments => {}); + return $self; } diff --git a/hardware/devices/camera/hanwha/snmp/mode/hardware.pm b/hardware/devices/camera/hanwha/snmp/mode/hardware.pm index 51465221b..69a670d6c 100644 --- a/hardware/devices/camera/hanwha/snmp/mode/hardware.pm +++ b/hardware/devices/camera/hanwha/snmp/mode/hardware.pm @@ -27,19 +27,17 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^service|sdcard$'; $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { service => [ ['low', 'OK'], - ['high', 'CRITICAL'], + ['high', 'CRITICAL'] ], sdcard => [ ['normal', 'OK'], - ['fail', 'CRITICAL'], - ], + ['fail', 'CRITICAL'] + ] }; $self->{components_path} = 'hardware::devices::camera::hanwha::snmp::mode::components'; @@ -58,9 +56,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1, no_performance => 1, no_absent => 1); bless $self, $class; - + $options{options}->add_options(arguments => {}); - + return $self; } diff --git a/hardware/devices/cisco/ces/restapi/mode/components.pm b/hardware/devices/cisco/ces/restapi/mode/components.pm index c65f69f4b..5315c5551 100644 --- a/hardware/devices/cisco/ces/restapi/mode/components.pm +++ b/hardware/devices/cisco/ces/restapi/mode/components.pm @@ -27,9 +27,7 @@ use warnings; sub set_system { 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->{cb_hook2} = 'execute_custom'; @@ -38,16 +36,16 @@ sub set_system { connection_status => [ ['NotConnected', 'OK'], ['Connected', 'OK'], - ['Unknown', 'UNKNOWN'], + ['Unknown', 'UNKNOWN'] ], connected => [ ['True', 'OK'], ['False', 'WARNING'], - ['Unknown', 'UNKNOWN'], + ['Unknown', 'UNKNOWN'] ], temperature => [ ['Normal', 'OK'], - ['.*', 'CRITICAL'], + ['.*', 'CRITICAL'] ], software_status => [ ['None', 'OK'], diff --git a/hardware/devices/safenet/hsm/protecttoolkit/mode/hardware.pm b/hardware/devices/safenet/hsm/protecttoolkit/mode/hardware.pm index 9e814f819..2e6b96510 100644 --- a/hardware/devices/safenet/hsm/protecttoolkit/mode/hardware.pm +++ b/hardware/devices/safenet/hsm/protecttoolkit/mode/hardware.pm @@ -28,8 +28,7 @@ use centreon::plugins::misc; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(hwstatus|temperature|memory)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|memory)$'; $self->{cb_hook2} = 'cmd_execute'; @@ -37,8 +36,8 @@ sub set_system { $self->{thresholds} = { hwstatus => [ ['BATTERY OK', 'OK'], - ['.*', 'CRITICAL'], - ], + ['.*', 'CRITICAL'] + ] }; $self->{components_path} = 'hardware::devices::safenet::hsm::protecttoolkit::mode::components'; @@ -48,12 +47,15 @@ sub set_system { sub cmd_execute { my ($self, %options) = @_; - ($self->{stdout}) = centreon::plugins::misc::execute(output => $self->{output}, - options => $self->{option_results}, - sudo => $self->{option_results}->{sudo}, - command => $self->{option_results}->{command}, - command_path => $self->{option_results}->{command_path}, - command_options => $self->{option_results}->{command_options}); + ($self->{stdout}) = centreon::plugins::misc::execute( + output => $self->{output}, + options => $self->{option_results}, + sudo => $self->{option_results}->{sudo}, + command => $self->{option_results}->{command}, + command_path => $self->{option_results}->{command_path}, + command_options => $self->{option_results}->{command_options} + ); + $self->{stdout} =~ s/\r//msg; 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); @@ -68,30 +70,30 @@ sub cmd_execute { sub display { my ($self, %options) = @_; - - $self->{output}->output_add(severity => 'OK', - short_msg => sprintf("Hardware status is OK") - ); + + $self->{output}->output_add( + severity => 'OK', + short_msg => sprintf("Hardware status is OK") + ); } sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); bless $self, $class; - - $options{options}->add_options(arguments => - { - "hostname:s" => { name => 'hostname' }, - "remote" => { name => 'remote' }, - "ssh-option:s@" => { name => 'ssh_option' }, - "ssh-path:s" => { name => 'ssh_path' }, - "ssh-command:s" => { name => 'ssh_command', default => 'ssh' }, - "timeout:s" => { name => 'timeout', default => 30 }, - "sudo" => { name => 'sudo' }, - "command:s" => { name => 'command', default => 'ctconf' }, - "command-path:s" => { name => 'command_path' }, - "command-options:s" => { name => 'command_options', default => '-v' }, - }); + + $options{options}->add_options(arguments => { + 'hostname:s' => { name => 'hostname' }, + 'remote' => { name => 'remote' }, + 'ssh-option:s@' => { name => 'ssh_option' }, + 'ssh-path:s' => { name => 'ssh_path' }, + 'ssh-command:s' => { name => 'ssh_command', default => 'ssh' }, + 'timeout:s' => { name => 'timeout', default => 30 }, + 'sudo' => { name => 'sudo' }, + 'command:s' => { name => 'command', default => 'ctconf' }, + 'command-path:s' => { name => 'command_path' }, + 'command-options:s' => { name => 'command_options', default => '-v' } + }); return $self; } diff --git a/hardware/devices/video/axis/snmp/mode/environment.pm b/hardware/devices/video/axis/snmp/mode/environment.pm index 4beb48aa0..d4c9afe4f 100644 --- a/hardware/devices/video/axis/snmp/mode/environment.pm +++ b/hardware/devices/video/axis/snmp/mode/environment.pm @@ -27,8 +27,6 @@ use warnings; sub set_system { 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)$'; @@ -37,35 +35,35 @@ sub set_system { $self->{thresholds} = { video => [ ['signalOk', 'OK'], - ['noSignal', 'CRITICAL'], + ['noSignal', 'CRITICAL'] ], psu => [ - ['failure', 'CRITICAL'], + ['failure', 'CRITICAL'] ['ok', 'OK'], ], fan => [ ['failed', 'CRITICAL'], - ['ok', 'OK'], + ['ok', 'OK'] ], temperature => [ ['failed', 'CRITICAL'], ['outOfBoundary', 'CRITICAL'], - ['ok', 'OK'], + ['ok', 'OK'] ], audio => [ ['signalOk', 'OK'], - ['noSignal', 'CRITICAL'], + ['noSignal', 'CRITICAL'] ], storage => [ ['yes', 'OK'], - ['no', 'CRITICAL'], + ['no', 'CRITICAL'] ], casing => [ ['open', 'OK'], - ['closed', 'WARNING'], - ], + ['closed', 'WARNING'] + ] }; - + $self->{components_path} = 'hardware::devices::video::axis::snmp::mode::components'; $self->{components_module} = ['video', 'psu', 'fan', 'temperature', 'audio', 'storage', 'casing']; } @@ -81,10 +79,8 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); + + $options{options}->add_options(arguments => {}); return $self; } @@ -127,4 +123,4 @@ Example: --threshold-overload='video,CRITICAL,^(?!(good)$)' =back -=cut \ No newline at end of file +=cut diff --git a/hardware/kvm/avocent/acs/6000/snmp/mode/hardware.pm b/hardware/kvm/avocent/acs/6000/snmp/mode/hardware.pm index d8f24ca3a..e90c1b190 100644 --- a/hardware/kvm/avocent/acs/6000/snmp/mode/hardware.pm +++ b/hardware/kvm/avocent/acs/6000/snmp/mode/hardware.pm @@ -28,8 +28,6 @@ use warnings; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(psu)$'; - $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { @@ -56,8 +54,7 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1); bless $self, $class; - $options{options}->add_options(arguments => { - }); + $options{options}->add_options(arguments => {}); return $self; } diff --git a/hardware/kvm/avocent/acs/8000/snmp/mode/hardware.pm b/hardware/kvm/avocent/acs/8000/snmp/mode/hardware.pm index 4efd2cde9..4366f0043 100644 --- a/hardware/kvm/avocent/acs/8000/snmp/mode/hardware.pm +++ b/hardware/kvm/avocent/acs/8000/snmp/mode/hardware.pm @@ -28,8 +28,6 @@ use warnings; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(psu)$'; - $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { @@ -46,7 +44,7 @@ sub set_system { sub snmp_execute { my ($self, %options) = @_; - + $self->{snmp} = $options{snmp}; $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); bless $self, $class; - $options{options}->add_options(arguments => { - }); + $options{options}->add_options(arguments => {}); return $self; } diff --git a/hardware/pdu/apc/snmp/mode/hardware.pm b/hardware/pdu/apc/snmp/mode/hardware.pm index dda35d697..dc506bca2 100644 --- a/hardware/pdu/apc/snmp/mode/hardware.pm +++ b/hardware/pdu/apc/snmp/mode/hardware.pm @@ -27,8 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^humidity|temperature|psu$'; + $self->{regexp_threshold_numeric_check_section_option} = '^humidity|temperature$'; $self->{cb_hook2} = 'snmp_execute'; @@ -40,7 +39,7 @@ sub set_system { ['belowLow', 'WARNING'], ['normal', 'OK'], ['aboveHigh', 'WARNING'], - ['aboveMax', 'CRITICAL'], + ['aboveMax', 'CRITICAL'] ], temperature => [ ['notPresent', 'OK'], @@ -48,13 +47,13 @@ sub set_system { ['belowLow', 'WARNING'], ['normal', 'OK'], ['aboveHigh', 'WARNING'], - ['aboveMax', 'CRITICAL'], + ['aboveMax', 'CRITICAL'] ], psu => [ ['ok', 'OK'], ['failed', 'CRITICAL'], - ['notPresent', 'OK'], - ], + ['notPresent', 'OK'] + ] }; $self->{components_path} = 'hardware::pdu::apc::snmp::mode::components'; @@ -72,9 +71,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - + $options{options}->add_options(arguments => {}); - + return $self; } diff --git a/hardware/pdu/schleifenbauer/gateway/snmp/mode/sensors.pm b/hardware/pdu/schleifenbauer/gateway/snmp/mode/sensors.pm index 6ae531938..4bbcc0797 100644 --- a/hardware/pdu/schleifenbauer/gateway/snmp/mode/sensors.pm +++ b/hardware/pdu/schleifenbauer/gateway/snmp/mode/sensors.pm @@ -29,7 +29,6 @@ use hardware::pdu::schleifenbauer::gateway::snmp::mode::components::resources qw sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(temperature|humidity|contact)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|humidity|contact)$'; $self->{cb_hook2} = 'snmp_execute'; @@ -44,7 +43,7 @@ sub snmp_execute { $self->{snmp} = $options{snmp}; $self->{results} = $self->{snmp}->get_multiple_table(oids => [ { 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); bless $self, $class; - $options{options}->add_options(arguments => { - }); + $options{options}->add_options(arguments => {}); return $self; } diff --git a/hardware/sensors/akcp/snmp/mode/sensors.pm b/hardware/sensors/akcp/snmp/mode/sensors.pm index b13e4660f..bbcc779d0 100644 --- a/hardware/sensors/akcp/snmp/mode/sensors.pm +++ b/hardware/sensors/akcp/snmp/mode/sensors.pm @@ -27,8 +27,7 @@ use warnings; sub set_system { 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->{cb_hook2} = 'snmp_execute'; @@ -43,23 +42,23 @@ sub set_system { ['lowCritical', 'CRITICAL'], ['sensorError', 'CRITICAL'], ['relayOn', 'OK'], - ['relayOff', 'OK'], + ['relayOff', 'OK'] ], default2 => [ ['noStatus', 'OK'], ['normal', 'OK'], ['critical', 'CRITICAL'], - ['sensorError', 'CRITICAL'], - ], + ['sensorError', 'CRITICAL'] + ] }; - + $self->{components_path} = 'hardware::sensors::akcp::snmp::mode::components'; $self->{components_module} = ['temperature', 'humidity', 'switch', 'serial', 'water']; } sub snmp_execute { my ($self, %options) = @_; - + $self->{snmp} = $options{snmp}; $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); } @@ -68,11 +67,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); - + + $options{options}->add_options(arguments => {}); + return $self; } diff --git a/hardware/sensors/hwgste/snmp/mode/sensors.pm b/hardware/sensors/hwgste/snmp/mode/sensors.pm index d6e17a817..2e271e160 100644 --- a/hardware/sensors/hwgste/snmp/mode/sensors.pm +++ b/hardware/sensors/hwgste/snmp/mode/sensors.pm @@ -28,8 +28,7 @@ use hardware::sensors::hwgste::snmp::mode::components::resources qw($mapping); sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(temperature|humidity)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|humidity)$'; $self->{cb_hook2} = 'snmp_execute'; @@ -41,17 +40,17 @@ sub set_system { ['outOfRangeLo', 'WARNING'], ['outOfRangeHi', 'WARNING'], ['alarmLo', 'CRITICAL'], - ['alarmHi', 'CRITICAL'], - ], + ['alarmHi', 'CRITICAL'] + ] }; - + $self->{components_path} = 'hardware::sensors::hwgste::snmp::mode::components'; $self->{components_module} = ['temperature', 'humidity']; } sub snmp_execute { my ($self, %options) = @_; - + $self->{snmp} = $options{snmp}; $self->{results} = $self->{snmp}->get_multiple_table( oids => [{ oid => $mapping->{branch_sensors}->{hwgste} }, { oid => $mapping->{branch_sensors}->{hwgste2} }] @@ -67,10 +66,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); bless $self, $class; - - $options{options}->add_options(arguments => { - }); - + + $options{options}->add_options(arguments => {}); + return $self; } diff --git a/hardware/sensors/jacarta/snmp/mode/sensors.pm b/hardware/sensors/jacarta/snmp/mode/sensors.pm index 3d6251b0d..3b8855742 100644 --- a/hardware/sensors/jacarta/snmp/mode/sensors.pm +++ b/hardware/sensors/jacarta/snmp/mode/sensors.pm @@ -27,8 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(temperature|humidity|input)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|humidity)$'; $self->{cb_hook2} = 'snmp_execute'; @@ -42,12 +41,12 @@ sub set_system { ['below-low-critical', 'CRITICAL'], ['above-high-warning', 'WARNING'], ['above-high-critical', 'CRITICAL'], - ['sensorError', 'CRITICAL'], + ['sensorError', 'CRITICAL'] ], input => [ ['normal', 'OK'], - ['triggered', 'CRITICAL'], - ], + ['triggered', 'CRITICAL'] + ] }; $self->{components_path} = 'hardware::sensors::jacarta::snmp::mode::components'; @@ -70,10 +69,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); bless $self, $class; - - $options{options}->add_options(arguments => { - }); - + + $options{options}->add_options(arguments => {}); + return $self; } diff --git a/hardware/sensors/netbotz/snmp/mode/sensors.pm b/hardware/sensors/netbotz/snmp/mode/sensors.pm index 57cbf7b3a..65a896b2d 100644 --- a/hardware/sensors/netbotz/snmp/mode/sensors.pm +++ b/hardware/sensors/netbotz/snmp/mode/sensors.pm @@ -28,7 +28,6 @@ use warnings; sub set_system { 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->{cb_hook1} = 'get_version'; @@ -41,8 +40,8 @@ sub set_system { ['warning', 'WARNING'], ['error', 'CRITICAL'], ['critical', 'CRITICAL'], - ['failure', 'CRITICAL'], - ], + ['failure', 'CRITICAL'] + ] }; $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); bless $self, $class; - $options{options}->add_options(arguments => { - }); + $options{options}->add_options(arguments => {}); return $self; } diff --git a/hardware/sensors/sensorip/snmp/mode/sensors.pm b/hardware/sensors/sensorip/snmp/mode/sensors.pm index 2aac0963f..e24adcf1b 100644 --- a/hardware/sensors/sensorip/snmp/mode/sensors.pm +++ b/hardware/sensors/sensorip/snmp/mode/sensors.pm @@ -27,8 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^sp|temperature|humidity|switch$'; + $self->{regexp_threshold_numeric_check_section_option} = '^humidity|temperature$'; $self->{cb_hook2} = 'snmp_execute'; @@ -39,7 +38,7 @@ sub set_system { ['normal', 'OK'], ['warning', 'WARNING'], ['critical', 'CRITICAL'], - ['sensorError', 'CRITICAL'], + ['sensorError', 'CRITICAL'] ], switch => [ ['noStatus', 'UNKNOWN'], @@ -48,10 +47,10 @@ sub set_system { ['lowCritical', 'CRITICAL'], ['sensorError', 'CRITICAL'], ['relayOn', 'OK'], - ['relayOff', 'OK'], - ], + ['relayOff', 'OK'] + ] }; - + $self->{components_path} = 'hardware::sensors::sensorip::snmp::mode::components'; $self->{components_module} = ['sp', 'temperature', 'humidity', 'switch']; } @@ -67,9 +66,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - + $options{options}->add_options(arguments => {}); - + return $self; } diff --git a/hardware/sensors/serverscheck/sensorgateway/snmp/mode/sensors.pm b/hardware/sensors/serverscheck/sensorgateway/snmp/mode/sensors.pm index d525a361d..f64a17d63 100644 --- a/hardware/sensors/serverscheck/sensorgateway/snmp/mode/sensors.pm +++ b/hardware/sensors/serverscheck/sensorgateway/snmp/mode/sensors.pm @@ -27,8 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^sensors$'; + $self->{regexp_threshold_numeric_check_section_option} = '^sensors$'; $self->{cb_hook2} = 'snmp_execute'; @@ -36,10 +35,10 @@ sub set_system { $self->{thresholds} = { output => [ ['open', 'CRITICAL'], - ['close', 'OK'], - ], + ['close', 'OK'] + ] }; - + $self->{components_path} = 'hardware::sensors::serverscheck::sensorgateway::snmp::mode::components'; $self->{components_module} = ['sensors']; } @@ -55,9 +54,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - + $options{options}->add_options(arguments => {}); - + return $self; } diff --git a/hardware/server/cisco/ucs/mode/equipment.pm b/hardware/server/cisco/ucs/mode/equipment.pm index 9ee1ee1b1..7ef42c086 100644 --- a/hardware/server/cisco/ucs/mode/equipment.pm +++ b/hardware/server/cisco/ucs/mode/equipment.pm @@ -29,8 +29,6 @@ use hardware::server::cisco::ucs::mode::components::resources qw($thresholds); sub set_system { 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->{thresholds} = $thresholds; @@ -51,8 +49,7 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1); bless $self, $class; - $options{options}->add_options(arguments => { - }); + $options{options}->add_options(arguments => {}); return $self; } diff --git a/hardware/server/dell/cmc/snmp/mode/hardware.pm b/hardware/server/dell/cmc/snmp/mode/hardware.pm index 07f0723b0..ecdd4350a 100644 --- a/hardware/server/dell/cmc/snmp/mode/hardware.pm +++ b/hardware/server/dell/cmc/snmp/mode/hardware.pm @@ -28,8 +28,7 @@ use centreon::plugins::misc; sub set_system { 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->{cb_hook2} = 'snmp_execute'; @@ -41,8 +40,8 @@ sub set_system { ['ok', 'OK'], ['nonCritical', 'WARNING'], ['critical', 'CRITICAL'], - ['nonRecoverable', 'CRITICAL'], - ], + ['nonRecoverable', 'CRITICAL'] + ] }; $self->{components_path} = 'hardware::server::dell::cmc::snmp::mode::components'; @@ -78,9 +77,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - + $options{options}->add_options(arguments => {}); - + return $self; } diff --git a/hardware/server/dell/idrac/snmp/mode/hardware.pm b/hardware/server/dell/idrac/snmp/mode/hardware.pm index 24bb0c926..5ac968e59 100644 --- a/hardware/server/dell/idrac/snmp/mode/hardware.pm +++ b/hardware/server/dell/idrac/snmp/mode/hardware.pm @@ -27,9 +27,9 @@ use warnings; sub set_system { my ($self, %options) = @_; - + $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|voltage|amperage|coolingdevice)$'; - + $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { @@ -37,7 +37,7 @@ sub set_system { ['unknown', 'UNKNOWN'], ['enabled', 'OK'], ['notReady', 'WARNING'], - ['enabledAndNotReady', 'WARNING'], + ['enabledAndNotReady', 'WARNING'] ], 'default.status' => [ ['other', 'UNKNOWN'], @@ -45,7 +45,7 @@ sub set_system { ['ok', 'OK'], ['nonCritical', 'WARNING'], ['critical', 'CRITICAL'], - ['nonRecoverable', 'CRITICAL'], + ['nonRecoverable', 'CRITICAL'] ], 'probe.status' => [ ['other', 'UNKNOWN'], @@ -57,7 +57,7 @@ sub set_system { ['nonCriticalLower', 'WARNING'], ['criticalLower', 'CRITICAL'], ['nonRecoverableLower', 'CRITICAL'], - ['failed', 'CRITICAL'], + ['failed', 'CRITICAL'] ], 'pdisk.state' => [ ['unknown', 'UNKNOWN'], @@ -69,31 +69,26 @@ sub set_system { ['failed', 'CRITICAL'], ['non-raid', 'OK'], ['removed', 'OK'], - ['readonly', 'WARNING'], + ['readonly', 'WARNING'] ], 'pdisk.smartalert' => [ ['off', 'OK'], - ['on', 'WARNING'], + ['on', 'WARNING'] ], 'vdisk.state' => [ ['unknown', 'UNKNOWN'], ['online', 'OK'], ['failed', 'CRITICAL'], - ['degraded', 'WARNING'], - ], + ['degraded', 'WARNING'] + ] }; $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', - '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' . - ')$'; + 'slot', 'fru', 'storagectrl', 'storagebattery', 'pdisk', 'vdisk' + ]; } sub snmp_execute { @@ -107,11 +102,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); - + + $options{options}->add_options(arguments => {}); + return $self; } diff --git a/hardware/server/dell/openmanage/snmp/mode/hardware.pm b/hardware/server/dell/openmanage/snmp/mode/hardware.pm index d4d474fde..b188e1110 100644 --- a/hardware/server/dell/openmanage/snmp/mode/hardware.pm +++ b/hardware/server/dell/openmanage/snmp/mode/hardware.pm @@ -28,9 +28,7 @@ use centreon::plugins::misc; sub set_system { 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->{cb_hook2} = 'snmp_execute'; @@ -47,8 +45,8 @@ sub set_system { ], physicaldisk_smartalert => [ ['yes', 'WARNING'], - ['no', 'OK'], - ], + ['no', 'OK'] + ] }; $self->{components_path} = 'hardware::server::dell::openmanage::snmp::mode::components'; @@ -79,9 +77,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - + $options{options}->add_options(arguments => {}); - + return $self; } diff --git a/hardware/server/fujitsu/snmp/mode/hardware.pm b/hardware/server/fujitsu/snmp/mode/hardware.pm index 72851c770..e7bc7169d 100644 --- a/hardware/server/fujitsu/snmp/mode/hardware.pm +++ b/hardware/server/fujitsu/snmp/mode/hardware.pm @@ -27,8 +27,7 @@ use warnings; sub set_system { 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->{cb_hook2} = 'snmp_execute'; @@ -46,7 +45,7 @@ sub set_system { ['hot-spare', 'OK'], ['mirror', 'OK'], ['raid', 'OK'], - ['hidden', 'OK'], + ['hidden', 'OK'] ], cpu => [ ['unknown', 'UNKNOWN'], @@ -56,7 +55,7 @@ sub set_system { ['error', 'CRITICAL'], ['prefailure-warning', 'WARNING'], ['fail', 'CRITICAL'], # can be failed also - ['missing-termination', 'WARNING'], + ['missing-termination', 'WARNING'] ], voltage => [ ['unknown', 'UNKNOWN'], @@ -66,7 +65,7 @@ sub set_system { ['too-high', 'WARNING'], ['out-of-range', 'CRITICAL'], ['battery-prefailure', 'CRITICAL'], - ['warning', 'WARNING'], + ['warning', 'WARNING'] ], fan => [ ['unknown', 'UNKNOWN'], @@ -92,7 +91,7 @@ sub set_system { ['not-available', 'OK'], ['temperature-warning', 'WARNING'], # can be also temperature-warning-toohot ['temperature-critical-toohot', 'CRITICAL'], - ['temperature-normal', 'OK'], + ['temperature-normal', 'OK'] ], psu => [ ['unknown', 'UNKNOWN'], @@ -110,8 +109,8 @@ sub set_system { ['non-redundant-ac-fail', 'WARNING'], ['degraded', 'WARNING'], - ['critical', 'CRITICAL'], - ], + ['critical', 'CRITICAL'] + ] }; $self->{components_path} = 'hardware::server::fujitsu::snmp::mode::components'; @@ -120,7 +119,7 @@ sub set_system { sub snmp_execute { my ($self, %options) = @_; - + $self->{snmp} = $options{snmp}; $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); } @@ -129,11 +128,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); - + + $options{options}->add_options(arguments => {}); + return $self; } diff --git a/hardware/server/hp/bladechassis/snmp/mode/hardware.pm b/hardware/server/hp/bladechassis/snmp/mode/hardware.pm index 8c30cc1ce..7ad0cc0ce 100644 --- a/hardware/server/hp/bladechassis/snmp/mode/hardware.pm +++ b/hardware/server/hp/bladechassis/snmp/mode/hardware.pm @@ -28,9 +28,6 @@ use centreon::plugins::misc; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = - '^(enclosure|manager|fan|blade|network|psu|temperature|fuse)$'; $self->{cb_hook2} = 'snmp_execute'; @@ -39,8 +36,8 @@ sub set_system { ['other', 'CRITICAL'], ['ok', 'OK'], ['degraded', 'WARNING'], - ['failed', 'CRITICAL'], - ], + ['failed', 'CRITICAL'] + ] }; $self->{components_exec_load} = 0; @@ -61,9 +58,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1); bless $self, $class; - + $options{options}->add_options(arguments => {}); - + return $self; } diff --git a/hardware/server/hp/ilo/xmlapi/mode/hardware.pm b/hardware/server/hp/ilo/xmlapi/mode/hardware.pm index ca97a9598..16cfc51be 100644 --- a/hardware/server/hp/ilo/xmlapi/mode/hardware.pm +++ b/hardware/server/hp/ilo/xmlapi/mode/hardware.pm @@ -27,9 +27,7 @@ use warnings; sub set_system { 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->{cb_hook2} = 'api_execute'; @@ -43,19 +41,21 @@ sub set_system { ['NOT APPLICABLE', 'OK'], ['n/a', 'OK'], ['Unknown', 'UNKNOWN'], - ['.*', 'CRITICAL'], + ['.*', 'CRITICAL'] ], nic => [ ['Ok', 'OK'], ['Unknown', 'OK'], ['Disabled', 'OK'], - ['.*', 'CRITICAL'], - ], + ['.*', 'CRITICAL'] + ] }; $self->{components_path} = 'hardware::server::hp::ilo::xmlapi::mode::components'; - $self->{components_module} = ['fan', 'temperature', 'vrm', 'psu', 'cpu', 'memory', 'nic', 'battery', 'ctrl', - 'driveencl', 'pdrive', 'ldrive', 'bios']; + $self->{components_module} = [ + 'fan', 'temperature', 'vrm', 'psu', 'cpu', 'memory', 'nic', 'battery', 'ctrl', + 'driveencl', 'pdrive', 'ldrive', 'bios' + ]; } sub api_execute { @@ -68,10 +68,8 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); + + $options{options}->add_options(arguments => {}); return $self; } diff --git a/hardware/server/hp/oneview/restapi/mode/hardware.pm b/hardware/server/hp/oneview/restapi/mode/hardware.pm index be000677e..e4b118e06 100644 --- a/hardware/server/hp/oneview/restapi/mode/hardware.pm +++ b/hardware/server/hp/oneview/restapi/mode/hardware.pm @@ -27,8 +27,6 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(?:server|enclosure\.(.*))$'; $self->{cb_hook2} = 'execute_custom'; @@ -38,8 +36,8 @@ sub set_system { ['disabled', 'OK'], ['critical', 'CRITICAL'], ['warning', 'WARNING'], - ['unknown', 'UNKNOWN'], - ], + ['unknown', 'UNKNOWN'] + ] }; $self->{components_path} = 'hardware::server::hp::oneview::restapi::mode::components'; @@ -50,7 +48,7 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1, force_new_perfdata => 1); bless $self, $class; - + $options{options}->add_options(arguments => {}); $self->{requests} = []; diff --git a/hardware/server/hp/proliant/snmp/mode/hardware.pm b/hardware/server/hp/proliant/snmp/mode/hardware.pm index 2313229d2..842485541 100644 --- a/hardware/server/hp/proliant/snmp/mode/hardware.pm +++ b/hardware/server/hp/proliant/snmp/mode/hardware.pm @@ -28,9 +28,7 @@ use centreon::plugins::misc; sub set_system { 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->{cb_hook1} = 'get_system_information'; @@ -42,14 +40,14 @@ sub set_system { ['ok', 'OK'], ['degraded', 'WARNING'], ['failed', 'CRITICAL'], - ['disabled', 'OK'], + ['disabled', 'OK'] ], ideldrive => [ ['other', 'UNKNOWN'], ['ok', 'OK'], ['rebuilding', 'WARNING'], ['degraded', 'WARNING'], - ['failed', 'CRITICAL'], + ['failed', 'CRITICAL'] ], sasldrive => [ ['other', 'UNKNOWN'], @@ -57,7 +55,7 @@ sub set_system { ['degraded', 'WARNING'], ['rebuilding', 'WARNING'], ['failed', 'CRITICAL'], - ['offline', 'CRITICAL'], + ['offline', 'CRITICAL'] ], scsildrive => [ ['other', 'UNKNOWN'], @@ -70,7 +68,7 @@ sub set_system { ['rebuilding', 'WARNING'], ['wrongDrive', 'CRITICAL'], ['badConnect', 'CRITICAL'], - ['disabled', 'OK'], + ['disabled', 'OK'] ], fcaexternalaccbattery => [ ['other', 'UNKNOWN'], @@ -78,7 +76,7 @@ sub set_system { ['degraded', 'WARNING'], ['failed', 'CRITICAL'], ['recharging', 'WARNING'], - ['not present', 'OK'], + ['not present', 'OK'] ], fcaldrive => [ ['other', 'UNKNOWN'], @@ -95,7 +93,7 @@ sub set_system { ['notAvailable', 'WARNING'], ['hardError', 'CRITICAL'], ['queuedForExpansion', 'WARNING'], - ['shutdown', 'WARNING'], + ['shutdown', 'WARNING'] ], daaccbattery => [ ['other', 'UNKNOWN'], @@ -103,7 +101,7 @@ sub set_system { ['degraded', 'WARNING'], ['failed', 'CRITICAL'], ['recharging', 'WARNING'], - ['not present', 'OK'], + ['not present', 'OK'] ], daldrive => [ ['other', 'UNKNOWN'], @@ -120,39 +118,41 @@ sub set_system { ['notAvailable', 'WARNING'], ['hardError', 'CRITICAL'], ['queuedForExpansion', 'WARNING'], - ['shutdown', 'WARNING'], + ['shutdown', 'WARNING'] ], lnic => [ ['other', 'OK'], ['ok', 'OK'], ['degraded', 'WARNING'], - ['failed', 'CRITICAL'], + ['failed', 'CRITICAL'] ], temperature => [ ['other', 'OK'], ['ok', 'OK'], ['degraded', 'WARNING'], - ['failed', 'CRITICAL'], + ['failed', 'CRITICAL'] ], # ilo, pnic, fan, dapdrive, daacc, dactl, fcapdrive, fcaexternalacc, fcaexternalctl, fcahostctl, scsipdrive, scsictl, saspdrive, sasctl, psu, pc, idepdrive, idectl default => [ ['other', 'UNKNOWN'], ['ok', 'OK'], ['degraded', 'WARNING'], - ['failed', 'CRITICAL'], - ], + ['failed', 'CRITICAL'] + ] }; $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', '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 { my ($self, %options) = @_; - + $self->{snmp} = $options{snmp}; $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); } @@ -161,11 +161,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); - + + $options{options}->add_options(arguments => {}); + return $self; } @@ -248,4 +246,4 @@ Example: --critical='temperature,.*,40' =back -=cut \ No newline at end of file +=cut diff --git a/hardware/server/huawei/hmm/snmp/mode/blade.pm b/hardware/server/huawei/hmm/snmp/mode/blade.pm index 47512f39b..1ebfd7b4e 100644 --- a/hardware/server/huawei/hmm/snmp/mode/blade.pm +++ b/hardware/server/huawei/hmm/snmp/mode/blade.pm @@ -27,19 +27,18 @@ use warnings; sub set_system { my ($self, %options) = @_; - + $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->{thresholds} = { 'default' => [ ['normal', 'OK'], ['minor', 'WARNING'], ['major', 'CRITICAL'], - ['critical', 'CRITICAL'], - ], + ['critical', 'CRITICAL'] + ] }; $self->{components_path} = 'hardware::server::huawei::hmm::snmp::mode::components'; @@ -57,12 +56,11 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - - $options{options}->add_options(arguments => - { - "blade-id:s" => { name => 'blade_id' }, - }); - + + $options{options}->add_options(arguments => { + 'blade-id:s' => { name => 'blade_id' } + }); + return $self; } diff --git a/hardware/server/huawei/hmm/snmp/mode/chassis.pm b/hardware/server/huawei/hmm/snmp/mode/chassis.pm index d8726acdd..9e49914db 100644 --- a/hardware/server/huawei/hmm/snmp/mode/chassis.pm +++ b/hardware/server/huawei/hmm/snmp/mode/chassis.pm @@ -27,9 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(blade|fan|psu|switch)$'; - + $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { @@ -37,8 +35,8 @@ sub set_system { ['normal', 'OK'], ['minor', 'WARNING'], ['major', 'CRITICAL'], - ['critical', 'CRITICAL'], - ], + ['critical', 'CRITICAL'] + ] }; $self->{components_path} = 'hardware::server::huawei::hmm::snmp::mode::components'; @@ -56,11 +54,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); - + + $options{options}->add_options(arguments => {}); + return $self; } diff --git a/hardware/server/huawei/ibmc/snmp/mode/hardware.pm b/hardware/server/huawei/ibmc/snmp/mode/hardware.pm index 9f89ede69..92612a8b4 100644 --- a/hardware/server/huawei/ibmc/snmp/mode/hardware.pm +++ b/hardware/server/huawei/ibmc/snmp/mode/hardware.pm @@ -27,9 +27,8 @@ use warnings; sub set_system { my ($self, %options) = @_; - + $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'; @@ -40,14 +39,14 @@ sub set_system { ['major', 'CRITICAL'], ['critical', 'CRITICAL'], ['absence', 'UNKNOWN'], - ['unknown', 'UNKNOWN'], + ['unknown', 'UNKNOWN'] ], 'logicaldrive' => [ ['offline', 'OK'], ['partial degraded', 'WARNING'], ['degraded', 'CRITICAL'], ['optimal', 'OK'], - ['unknown', 'UNKNOWN'], + ['unknown', 'UNKNOWN'] ], 'raidcontroller' => [ ['memory correctable error', 'WARNING'], @@ -55,13 +54,15 @@ sub set_system { ['memory ECC error reached limit', 'CRITICAL'], ['NVRAM uncorrectable error', 'CRITICAL'], ['ok', 'OK'], - ['unknown', 'UNKNOWN'], - ], + ['unknown', 'UNKNOWN'] + ] }; $self->{components_path} = 'hardware::server::huawei::ibmc::snmp::mode::components'; - $self->{components_module} = ['component', 'cpu', 'harddisk', 'fan', 'logicaldrive', - 'memory', 'pcie', 'psu', 'raidcontroller', 'temperature']; + $self->{components_module} = [ + 'component', 'cpu', 'harddisk', 'fan', 'logicaldrive', + 'memory', 'pcie', 'psu', 'raidcontroller', 'temperature' + ]; } sub snmp_execute { @@ -75,11 +76,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); - + + $options{options}->add_options(arguments => {}); + return $self; } diff --git a/hardware/server/ibm/mgmt_cards/imm/snmp/mode/environment.pm b/hardware/server/ibm/mgmt_cards/imm/snmp/mode/environment.pm index 1de9ce836..cef6b8e66 100644 --- a/hardware/server/ibm/mgmt_cards/imm/snmp/mode/environment.pm +++ b/hardware/server/ibm/mgmt_cards/imm/snmp/mode/environment.pm @@ -27,10 +27,9 @@ use warnings; sub set_system { 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->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { @@ -38,12 +37,12 @@ sub set_system { ['non recoverable', 'CRITICAL'], ['non critical', 'WARNING'], ['critical', 'CRITICAL'], - ['nominal', 'OK'], + ['nominal', 'OK'] ], fan => [ ['offline', 'WARNING'], - ['.*', 'OK'], - ], + ['.*', 'OK'] + ] }; $self->{components_path} = 'hardware::server::ibm::mgmt_cards::imm::snmp::mode::components'; @@ -52,7 +51,7 @@ sub set_system { sub snmp_execute { my ($self, %options) = @_; - + $self->{snmp} = $options{snmp}; $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); } @@ -61,11 +60,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); - + + $options{options}->add_options(arguments => {}); + return $self; } diff --git a/hardware/server/lenovo/xcc/snmp/mode/hardware.pm b/hardware/server/lenovo/xcc/snmp/mode/hardware.pm index 2873e318f..faf65eee9 100644 --- a/hardware/server/lenovo/xcc/snmp/mode/hardware.pm +++ b/hardware/server/lenovo/xcc/snmp/mode/hardware.pm @@ -27,8 +27,7 @@ use warnings; sub set_system { 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->{cb_hook2} = 'snmp_execute'; @@ -36,14 +35,14 @@ sub set_system { $self->{thresholds} = { default => [ ['Normal', 'OK'], - ['.*', 'CRITICAL'], + ['.*', 'CRITICAL'] ], raidvolume => [ ['Optimal', 'OK'], - ['.*', 'CRITICAL'], - ], + ['.*', 'CRITICAL'] + ] }; - + $self->{components_path} = 'hardware::server::lenovo::xcc::snmp::mode::components'; $self->{components_module} = ['temperature', 'voltage', 'fan', 'psu', 'disk', 'raidvolume']; } @@ -59,11 +58,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); - + + $options{options}->add_options(arguments => {}); + return $self; } diff --git a/hardware/server/sun/mgmt_cards/mode/showenvironment.pm b/hardware/server/sun/mgmt_cards/mode/showenvironment.pm index 541827607..bb630fdca 100644 --- a/hardware/server/sun/mgmt_cards/mode/showenvironment.pm +++ b/hardware/server/sun/mgmt_cards/mode/showenvironment.pm @@ -28,9 +28,6 @@ use centreon::plugins::misc; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = - '^temperature|si|disk|fan|voltage|psu|sensors$'; $self->{cb_hook2} = 'execute_command'; @@ -39,34 +36,34 @@ sub set_system { $self->{thresholds} = { temperature => [ ['^(?!(OK)$)', 'CRITICAL'], - ['^OK$', 'OK'], + ['^OK$', 'OK'] ], si => [ ['^(?!(OFF)$)', 'CRITICAL'], - ['^OFF$', 'OK'], + ['^OFF$', 'OK'] ], disk => [ ['^(?!(OK|NOT PRESENT)$)', 'CRITICAL'], - ['^OK|NOT PRESENT$', 'OK'], + ['^OK|NOT PRESENT$', 'OK'] ], fan => [ ['^(?!(OK|NOT PRESENT)$)', 'CRITICAL'], - ['^OK|NOT PRESENT$', 'OK'], + ['^OK|NOT PRESENT$', 'OK'] ], voltage => [ ['^(?!(OK)$)', 'CRITICAL'], - ['^OK$', 'OK'], + ['^OK$', 'OK'] ], psu => [ ['^(?!(OK|NOT PRESENT)$)', 'CRITICAL'], - ['^OK|NOT PRESENT$', 'OK'], + ['^OK|NOT PRESENT$', 'OK'] ], sensors => [ ['^(?!(OK)$)', 'CRITICAL'], - ['^OK$', 'OK'], - ], + ['^OK$', 'OK'] + ] }; - + $self->{components_path} = 'hardware::server::sun::mgmt_cards::components::showenvironment'; $self->{components_module} = ['temperature', 'si', 'disk', 'fan', 'voltage', 'psu', 'sensors']; } @@ -75,7 +72,7 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1, no_absent => 1); bless $self, $class; - + $options{options}->add_options(arguments => { 'hostname:s' => { name => 'hostname' }, 'port:s' => { name => 'port', default => 23 }, @@ -83,7 +80,7 @@ sub new { 'password:s' => { name => 'password' }, 'timeout:s' => { name => 'timeout', default => 30 }, 'command-plink:s' => { name => 'command_plink', default => 'plink' }, - 'ssh' => { name => 'ssh' }, + 'ssh' => { name => 'ssh' } }); return $self; diff --git a/hardware/server/supermicro/superdoctor/snmp/mode/hardware.pm b/hardware/server/supermicro/superdoctor/snmp/mode/hardware.pm index 57b54ff2c..e01383b1c 100644 --- a/hardware/server/supermicro/superdoctor/snmp/mode/hardware.pm +++ b/hardware/server/supermicro/superdoctor/snmp/mode/hardware.pm @@ -27,8 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(sensor\..*|memory|disk|cpu)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(sensor\..*)$'; $self->{cb_hook2} = 'snmp_execute'; @@ -37,12 +36,12 @@ sub set_system { sensor => [ ['ok', 'OK'], ['warning', 'WARNING'], - ['critical', 'CRITICAL'], + ['critical', 'CRITICAL'] ], default => [ ['ok', 'OK'], - ['critical', 'CRITICAL'], - ], + ['critical', 'CRITICAL'] + ] }; $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); bless $self, $class; - $options{options}->add_options(arguments => { - }); + $options{options}->add_options(arguments => {}); return $self; } sub snmp_execute { my ($self, %options) = @_; - + $self->{snmp} = $options{snmp}; $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); } diff --git a/hardware/telephony/avaya/mediagateway/snmp/mode/hardware.pm b/hardware/telephony/avaya/mediagateway/snmp/mode/hardware.pm index d0ff6bcef..61a41697a 100644 --- a/hardware/telephony/avaya/mediagateway/snmp/mode/hardware.pm +++ b/hardware/telephony/avaya/mediagateway/snmp/mode/hardware.pm @@ -27,16 +27,14 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(alarm)$'; - + $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { alarm => [ ['enabled', 'CRITICAL'], - ['disabled', 'OK'], - ], + ['disabled', 'OK'] + ] }; $self->{components_path} = 'hardware::telephony::avaya::mediagateway::snmp::mode::components'; @@ -54,10 +52,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1, force_new_perfdata => 1); bless $self, $class; - - $options{options}->add_options(arguments => { - }); - + + $options{options}->add_options(arguments => {}); + return $self; } diff --git a/hardware/ups/alpha/snmp/mode/alarms.pm b/hardware/ups/alpha/snmp/mode/alarms.pm index 5a90db0b6..ff34e03fc 100644 --- a/hardware/ups/alpha/snmp/mode/alarms.pm +++ b/hardware/ups/alpha/snmp/mode/alarms.pm @@ -27,18 +27,16 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(alarm)$'; - + $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { alarm => [ ['on', 'CRITICAL'], - ['off', 'OK'], - ], + ['off', 'OK'] + ] }; - + $self->{components_path} = 'hardware::ups::alpha::snmp::mode::components'; $self->{components_module} = ['alarm']; } @@ -47,7 +45,7 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1, no_load_components => 1); bless $self, $class; - + $options{options}->add_options(arguments => {}); return $self; diff --git a/hardware/ups/apc/snmp/mode/sensors.pm b/hardware/ups/apc/snmp/mode/sensors.pm index e94cfa598..aaf14db99 100644 --- a/hardware/ups/apc/snmp/mode/sensors.pm +++ b/hardware/ups/apc/snmp/mode/sensors.pm @@ -28,7 +28,6 @@ use warnings; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(sensor)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|humidity)$'; $self->{cb_hook2} = 'snmp_execute'; @@ -41,8 +40,8 @@ sub set_system { ['sensorStatusNotApplicable', 'OK'], ['disconnected', 'OK'], - ['connected', 'OK'], - ], + ['connected', 'OK'] + ] }; $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); bless $self, $class; - $options{options}->add_options(arguments => { - }); + $options{options}->add_options(arguments => {}); return $self; } diff --git a/network/3com/snmp/mode/hardware.pm b/network/3com/snmp/mode/hardware.pm index a5146df56..5fff1c8c2 100644 --- a/network/3com/snmp/mode/hardware.pm +++ b/network/3com/snmp/mode/hardware.pm @@ -28,8 +28,6 @@ use warnings; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^psu|fan$'; - $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { @@ -37,8 +35,8 @@ sub set_system { ['active', 'OK'], ['deactive', 'CRITICAL'], ['not-install', 'OK'], - ['unsupport', 'WARNING'], - ], + ['unsupport', 'WARNING'] + ] }; $self->{components_path} = 'network::3com::snmp::mode::components'; @@ -56,9 +54,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1); bless $self, $class; - + $options{options}->add_options(arguments => {}); - + return $self; } diff --git a/network/a10/ax/snmp/mode/hardware.pm b/network/a10/ax/snmp/mode/hardware.pm index 68562f7eb..3736e12f3 100644 --- a/network/a10/ax/snmp/mode/hardware.pm +++ b/network/a10/ax/snmp/mode/hardware.pm @@ -27,8 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(temperature|fan|psu)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan)$'; $self->{cb_hook2} = 'snmp_execute'; @@ -37,7 +36,7 @@ sub set_system { psu => [ ['off', 'CRITICAL'], ['on', 'OK'], - ['unknown', 'UNKNOWN'], + ['unknown', 'UNKNOWN'] ], fan => [ ['failed', 'CRITICAL'], @@ -46,8 +45,8 @@ sub set_system { ['okMedMed', 'OK'], ['okMedHigh', 'OK'], ['notReady', 'WARNING'], - ['unknown', 'UNKNOWN'], - ], + ['unknown', 'UNKNOWN'] + ] }; $self->{components_path} = 'network::a10::ax::snmp::mode::components'; @@ -58,9 +57,8 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_load_components => 1); bless $self, $class; - - $options{options}->add_options(arguments => { - }); + + $options{options}->add_options(arguments => {}); return $self; } diff --git a/network/acmepacket/snmp/mode/hardware.pm b/network/acmepacket/snmp/mode/hardware.pm index 6e57e9908..4e7b0b497 100644 --- a/network/acmepacket/snmp/mode/hardware.pm +++ b/network/acmepacket/snmp/mode/hardware.pm @@ -27,8 +27,7 @@ use warnings; sub set_system { 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->{cb_hook2} = 'snmp_execute'; @@ -42,8 +41,8 @@ sub set_system { ['shutdown', 'CRITICAL'], ['notPresent', 'OK'], ['notFunctioning', 'CRITICAL'], - ['unknown', 'UNKNOWN'], - ], + ['unknown', 'UNKNOWN'] + ] }; $self->{components_path} = 'network::acmepacket::snmp::mode::components'; @@ -61,11 +60,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); - + + $options{options}->add_options(arguments => {}); + return $self; } diff --git a/network/adva/fsp150/snmp/mode/hardware.pm b/network/adva/fsp150/snmp/mode/hardware.pm index 82887d745..49f85be01 100644 --- a/network/adva/fsp150/snmp/mode/hardware.pm +++ b/network/adva/fsp150/snmp/mode/hardware.pm @@ -29,15 +29,12 @@ use network::adva::fsp150::snmp::mode::components::resources qw($oids); sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = - '^(?:shefl|card)$'; - $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { operational => [ ['normal', 'OK'], - ['outage', 'CRITICAL'], + ['outage', 'CRITICAL'] ], secondary => [ ['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); bless $self, $class; - $options{options}->add_options(arguments => { - }); + $options{options}->add_options(arguments => {}); return $self; } diff --git a/network/alcatel/isam/snmp/mode/hardware.pm b/network/alcatel/isam/snmp/mode/hardware.pm index 040530531..42c912a5d 100644 --- a/network/alcatel/isam/snmp/mode/hardware.pm +++ b/network/alcatel/isam/snmp/mode/hardware.pm @@ -27,8 +27,7 @@ use warnings; sub set_system { 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->{cb_hook2} = 'snmp_execute'; @@ -37,8 +36,8 @@ sub set_system { sfp => [ ['noLos', 'OK'], ['notAvailable', 'OK'], - ['los', 'WARNING'], - ], + ['los', 'WARNING'] + ] }; $self->{components_path} = 'network::alcatel::isam::snmp::mode::components'; @@ -59,11 +58,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); - + + $options{options}->add_options(arguments => {}); + return $self; } diff --git a/network/alcatel/omniswitch/snmp/mode/hardware.pm b/network/alcatel/omniswitch/snmp/mode/hardware.pm index 32f195db1..9ffc16baa 100644 --- a/network/alcatel/omniswitch/snmp/mode/hardware.pm +++ b/network/alcatel/omniswitch/snmp/mode/hardware.pm @@ -25,10 +25,7 @@ use network::alcatel::omniswitch::snmp::mode::components::resources qw(%oids); sub set_system { 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->{thresholds} = { @@ -90,10 +87,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - - $options{options}->add_options(arguments => { - }); - + + $options{options}->add_options(arguments => {}); + return $self; } diff --git a/network/allied/snmp/mode/hardware.pm b/network/allied/snmp/mode/hardware.pm index a6c1b48d6..18ccc24de 100644 --- a/network/allied/snmp/mode/hardware.pm +++ b/network/allied/snmp/mode/hardware.pm @@ -27,8 +27,7 @@ use warnings; sub set_system { 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->{cb_hook2} = 'snmp_execute'; @@ -37,16 +36,16 @@ sub set_system { psu => [ ['good', 'OK'], ['failed', 'CRITICAL'], - ['notPowered', 'WARNING'], + ['notPowered', 'WARNING'] ], fan => [ ['good', 'OK'], - ['failed', 'CRITICAL'], + ['failed', 'CRITICAL'] ], default => [ ['inRange', 'OK'], - ['outOfRange', 'CRITICAL'], - ], + ['outOfRange', 'CRITICAL'] + ] }; $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); bless $self, $class; - $options{options}->add_options(arguments => { - }); + $options{options}->add_options(arguments => {}); return $self; } diff --git a/network/atto/fibrebridge/snmp/mode/hardware.pm b/network/atto/fibrebridge/snmp/mode/hardware.pm index b17d13dce..09fb7ef9c 100644 --- a/network/atto/fibrebridge/snmp/mode/hardware.pm +++ b/network/atto/fibrebridge/snmp/mode/hardware.pm @@ -29,8 +29,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(temperature|alarm)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(temperature)$'; $self->{cb_hook2} = 'snmp_execute'; @@ -39,12 +38,12 @@ sub set_system { temperature => [ ['normal', 'OK'], ['warning', 'WARNING'], - ['critical', 'CRITICAL'], + ['critical', 'CRITICAL'] ], alarm => [ ['normal', 'OK'], - ['warning', 'WARNING'], - ], + ['warning', 'WARNING'] + ] }; $self->{components_path} = 'network::atto::fibrebridge::snmp::mode::components'; @@ -62,10 +61,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, force_new_perfdata => 1); bless $self, $class; - - $options{options}->add_options(arguments => { - }); - + + $options{options}->add_options(arguments => {}); + return $self; } diff --git a/network/audiocodes/snmp/mode/hardware.pm b/network/audiocodes/snmp/mode/hardware.pm index 1941f4d01..12dfa1c35 100644 --- a/network/audiocodes/snmp/mode/hardware.pm +++ b/network/audiocodes/snmp/mode/hardware.pm @@ -28,8 +28,6 @@ use warnings; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(module|fantray|psu)$'; - $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { @@ -39,7 +37,7 @@ sub set_system { ['warning', 'WARNING'], ['minor', 'WARNING'], ['major', 'CRITICAL'], - ['critical', 'CRITICAL'], + ['critical', 'CRITICAL'] ], module => [ ['moduleNotExist', 'OK'], @@ -48,8 +46,8 @@ sub set_system { ['moduleBackToServiceStart', 'WARNING'], ['moduleMismatch', 'WARNING'], ['moduleFaulty', 'CRITICAL'], - ['notApplicable', 'OK'], - ], + ['notApplicable', 'OK'] + ] }; $self->{components_path} = 'network::audiocodes::snmp::mode::components'; @@ -67,11 +65,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); - + + $options{options}->add_options(arguments => {}); + return $self; } @@ -113,4 +109,4 @@ Example: --threshold-overload='psu,CRITICAL,^(?!(cleared)$)' =back -=cut \ No newline at end of file +=cut diff --git a/network/barracuda/cloudgen/snmp/mode/hardware.pm b/network/barracuda/cloudgen/snmp/mode/hardware.pm index f59fc1110..991730ec2 100644 --- a/network/barracuda/cloudgen/snmp/mode/hardware.pm +++ b/network/barracuda/cloudgen/snmp/mode/hardware.pm @@ -27,9 +27,8 @@ use warnings; sub set_system { my ($self, %options) = @_; - + $self->{regexp_threshold_numeric_check_section_option} = '^(fan|temperature|voltage)$'; - $self->{regexp_threshold_overload_check_section_option} = '^(psu)$'; $self->{cb_hook2} = 'snmp_execute'; @@ -37,8 +36,8 @@ sub set_system { 'psu' => [ ['ok', 'OK'], ['critical', 'CRITICAL'], - ['unknown', 'UNKNOWN'], - ], + ['unknown', 'UNKNOWN'] + ] }; $self->{components_path} = 'network::barracuda::cloudgen::snmp::mode::components'; @@ -56,10 +55,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - - $options{options}->add_options(arguments => { - }); - + + $options{options}->add_options(arguments => {}); + return $self; } diff --git a/network/bluecoat/snmp/mode/hardware.pm b/network/bluecoat/snmp/mode/hardware.pm index ab6cdc410..c9e3eb184 100644 --- a/network/bluecoat/snmp/mode/hardware.pm +++ b/network/bluecoat/snmp/mode/hardware.pm @@ -27,8 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(sensor|disk|sensor_opstatus)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^sensor$'; $self->{cb_hook2} = 'snmp_execute'; @@ -38,7 +37,7 @@ sub set_system { ['ok', 'OK'], ['unavailable', 'UNKNOWN'], ['nonoperational', 'UNKNOWN'], - ['unknown', 'UNKNOWN'], + ['unknown', 'UNKNOWN'] ], sensor => [ ['ok', 'OK'], @@ -55,7 +54,7 @@ sub set_system { ['temperatureHighSevere', 'CRITICAL'], ['fanSlowWarning', 'WARNING'], ['fanSlowCritical', 'CRITICAL'], - ['fanStopped', 'CRITICAL'], + ['fanStopped', 'CRITICAL'] ], disk => [ ['present', 'OK'], @@ -67,8 +66,8 @@ sub set_system { ['empty', 'WARNING'], ['ioerror', 'CRITICAL'], ['unusable', 'CRITICAL'], - ['unknown', 'UNKNOWN'], - ], + ['unknown', 'UNKNOWN'] + ] }; $self->{components_path} = 'network::bluecoat::snmp::mode::components'; @@ -86,11 +85,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); - + + $options{options}->add_options(arguments => {}); + return $self; } diff --git a/network/brocade/snmp/mode/hardware.pm b/network/brocade/snmp/mode/hardware.pm index 55be638e4..639cba06f 100644 --- a/network/brocade/snmp/mode/hardware.pm +++ b/network/brocade/snmp/mode/hardware.pm @@ -27,8 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(switch|sensor)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan)$'; $self->{cb_hook2} = 'snmp_execute'; @@ -40,15 +39,15 @@ sub set_system { ['below-min', 'WARNING'], ['nominal', 'OK'], ['above-max', 'CRITICAL'], - ['absent', 'OK'], + ['absent', 'OK'] ], switch => [ ['online', 'OK'], ['offline', 'WARNING'], ['testing', 'WARNING'], ['faulty', 'CRITICAL'], - ['absent', 'OK'], - ], + ['absent', 'OK'] + ] }; $self->{components_path} = 'network::brocade::snmp::mode::components'; @@ -59,16 +58,15 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_load_components => 1); bless $self, $class; - - $options{options}->add_options(arguments => { - }); + + $options{options}->add_options(arguments => {}); return $self; } sub snmp_execute { my ($self, %options) = @_; - + $self->{snmp} = $options{snmp}; $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); } diff --git a/network/checkpoint/snmp/mode/hardware.pm b/network/checkpoint/snmp/mode/hardware.pm index 4bfc9785f..353954223 100644 --- a/network/checkpoint/snmp/mode/hardware.pm +++ b/network/checkpoint/snmp/mode/hardware.pm @@ -27,9 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(temperature|voltage|fan|psu|raiddisk)$'; - + $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { @@ -89,10 +87,8 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1, no_absent => 1); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); + + $options{options}->add_options(arguments => {}); return $self; } diff --git a/network/citrix/netscaler/snmp/mode/health.pm b/network/citrix/netscaler/snmp/mode/health.pm index 373904901..b1e8e4480 100644 --- a/network/citrix/netscaler/snmp/mode/health.pm +++ b/network/citrix/netscaler/snmp/mode/health.pm @@ -27,8 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(psu)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fanspeed|voltage)$'; $self->{cb_hook2} = 'snmp_execute'; @@ -38,8 +37,8 @@ sub set_system { ['normal', 'OK'], ['not present', 'OK'], ['failed', 'CRITICAL'], - ['not supported', 'UNKNOWN'], - ], + ['not supported', 'UNKNOWN'] + ] }; $self->{components_path} = 'network::citrix::netscaler::snmp::mode::components'; @@ -69,11 +68,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); - + + $options{options}->add_options(arguments => {}); + return $self; } diff --git a/network/citrix/sdx/snmp/mode/hardware.pm b/network/citrix/sdx/snmp/mode/hardware.pm index d33a04de9..d4ff65070 100644 --- a/network/citrix/sdx/snmp/mode/hardware.pm +++ b/network/citrix/sdx/snmp/mode/hardware.pm @@ -25,15 +25,13 @@ use base qw(centreon::plugins::templates::hardware); sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(hardware|software)$'; - $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { default => [ ['OK', 'OK'], - ['ERROR', 'CRITICAL'], - ], + ['ERROR', 'CRITICAL'] + ] }; $self->{components_path} = 'network::citrix::sdx::snmp::mode::components'; @@ -44,10 +42,8 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1, no_load_components => 1); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); + + $options{options}->add_options(arguments => {}); return $self; } diff --git a/network/cyberoam/snmp/mode/services.pm b/network/cyberoam/snmp/mode/services.pm index 604be34de..5b23fd065 100644 --- a/network/cyberoam/snmp/mode/services.pm +++ b/network/cyberoam/snmp/mode/services.pm @@ -28,8 +28,6 @@ use warnings; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(service)$'; - $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { @@ -40,8 +38,8 @@ sub set_system { ['running', 'OK'], ['exiting', 'CRITICAL'], ['dead', 'CRITICAL'], - ['unregistered', 'OK'], - ], + ['unregistered', 'OK'] + ] }; $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); bless $self, $class; - $options{options}->add_options(arguments => { - }); + $options{options}->add_options(arguments => {}); return $self; } diff --git a/network/dell/os10/snmp/mode/hardware.pm b/network/dell/os10/snmp/mode/hardware.pm index d3a71e38a..48aeb7fe0 100644 --- a/network/dell/os10/snmp/mode/hardware.pm +++ b/network/dell/os10/snmp/mode/hardware.pm @@ -27,9 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = - '^(?:card|temperature|fan|fantray|psu)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(?:temperature)$'; $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); bless $self, $class; - $options{options}->add_options(arguments => { - }); + $options{options}->add_options(arguments => {}); return $self; } diff --git a/network/dlink/dgs3100/snmp/mode/hardware.pm b/network/dlink/dgs3100/snmp/mode/hardware.pm index 22d8819c3..514d62fb4 100644 --- a/network/dlink/dgs3100/snmp/mode/hardware.pm +++ b/network/dlink/dgs3100/snmp/mode/hardware.pm @@ -28,8 +28,6 @@ use warnings; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(fan|psu)$'; - $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { @@ -39,7 +37,7 @@ sub set_system { ['critical', 'CRITICAL'], ['notFunctioning', 'CRITICAL'], ['notPresent', 'OK'], - ['normal', 'OK'], + ['normal', 'OK'] ], fan => [ ['shutdown', 'WARNING'], @@ -47,8 +45,8 @@ sub set_system { ['critical', 'CRITICAL'], ['notFunctioning', 'CRITICAL'], ['notPresent', 'OK'], - ['normal', 'OK'], - ], + ['normal', 'OK'] + ] }; $self->{components_path} = 'network::dlink::dgs3100::snmp::mode::components'; @@ -66,10 +64,8 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); + + $options{options}->add_options(arguments => {}); return $self; } @@ -112,4 +108,4 @@ Example: --threshold-overload='psu,CRITICAL,^(?!(normal)$)' =back -=cut \ No newline at end of file +=cut diff --git a/network/dlink/standard/snmp/mode/hardware.pm b/network/dlink/standard/snmp/mode/hardware.pm index 5910baf99..cab60310c 100644 --- a/network/dlink/standard/snmp/mode/hardware.pm +++ b/network/dlink/standard/snmp/mode/hardware.pm @@ -27,8 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(fan|psu)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(fan|temperature)$'; $self->{cb_hook2} = 'snmp_execute'; @@ -41,7 +40,7 @@ sub set_system { ['lowVoltage', 'WARNING'], ['overCurrent', 'CRITICAL'], ['fail', 'CRITICAL'], - ['disconnect', 'WARNING'], + ['disconnect', 'WARNING'] ], fan => [ ['working', 'OK'], @@ -50,8 +49,8 @@ sub set_system { ['speed-0', 'WARNING'], ['speed-low', 'WARNING'], ['speed-middle', 'OK'], - ['speed-high', 'WARNING'], - ], + ['speed-high', 'WARNING'] + ] }; $self->{components_path} = 'network::dlink::standard::snmp::mode::components'; @@ -69,10 +68,8 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); + + $options{options}->add_options(arguments => {}); return $self; } @@ -120,4 +117,4 @@ Example: --critical='temperature,.*,40' =back -=cut \ No newline at end of file +=cut diff --git a/network/evertz/FC7800/snmp/mode/hardware.pm b/network/evertz/FC7800/snmp/mode/hardware.pm index 163ace576..9fa4b680b 100644 --- a/network/evertz/FC7800/snmp/mode/hardware.pm +++ b/network/evertz/FC7800/snmp/mode/hardware.pm @@ -24,9 +24,7 @@ use base qw(centreon::plugins::templates::hardware); sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(psu|frameline)$'; - + $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { @@ -50,10 +48,8 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1, no_load_components => 1); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); + + $options{options}->add_options(arguments => {}); return $self; } diff --git a/network/extreme/snmp/mode/hardware.pm b/network/extreme/snmp/mode/hardware.pm index 2e61d2090..edc902610 100644 --- a/network/extreme/snmp/mode/hardware.pm +++ b/network/extreme/snmp/mode/hardware.pm @@ -27,8 +27,7 @@ use warnings; sub set_system { 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->{cb_hook2} = 'snmp_execute'; @@ -91,8 +90,7 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => { - }); + $options{options}->add_options(arguments => {}); return $self; } diff --git a/network/f5/bigip/snmp/mode/hardware.pm b/network/f5/bigip/snmp/mode/hardware.pm index 229816314..1b4da6c60 100644 --- a/network/f5/bigip/snmp/mode/hardware.pm +++ b/network/f5/bigip/snmp/mode/hardware.pm @@ -27,8 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(temperature|fan|psu)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan)$'; $self->{cb_hook2} = 'snmp_execute'; @@ -37,13 +36,13 @@ sub set_system { fan => [ ['bad', 'CRITICAL'], ['good', 'OK'], - ['notPresent', 'OK'], + ['notPresent', 'OK'] ], psu => [ ['bad', 'CRITICAL'], ['good', 'OK'], - ['notPresent', 'OK'], - ], + ['notPresent', 'OK'] + ] }; $self->{components_path} = 'network::f5::bigip::snmp::mode::components'; @@ -61,10 +60,8 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); + + $options{options}->add_options(arguments => {}); return $self; } diff --git a/network/hirschmann/standard/snmp/mode/hardware.pm b/network/hirschmann/standard/snmp/mode/hardware.pm index 28537da6b..6f4ce0002 100644 --- a/network/hirschmann/standard/snmp/mode/hardware.pm +++ b/network/hirschmann/standard/snmp/mode/hardware.pm @@ -27,8 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(fan|psu|led)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(temperature)$'; $self->{cb_hook2} = 'snmp_execute'; @@ -68,9 +67,8 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - - $options{options}->add_options(arguments => { - }); + + $options{options}->add_options(arguments => {}); return $self; } diff --git a/network/hp/procurve/snmp/mode/environment.pm b/network/hp/procurve/snmp/mode/environment.pm index 3db16f77c..04e8ea48a 100644 --- a/network/hp/procurve/snmp/mode/environment.pm +++ b/network/hp/procurve/snmp/mode/environment.pm @@ -28,8 +28,6 @@ use warnings; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(sensor|fan|psu)$'; - $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { @@ -77,10 +75,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); + + $options{options}->add_options(arguments => { + }); return $self; } diff --git a/network/hp/vc/snmp/mode/hardware.pm b/network/hp/vc/snmp/mode/hardware.pm index 2e4af3e24..254f4e860 100644 --- a/network/hp/vc/snmp/mode/hardware.pm +++ b/network/hp/vc/snmp/mode/hardware.pm @@ -27,9 +27,7 @@ use warnings; sub set_system { 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->{thresholds} = { @@ -69,10 +67,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1, no_absent => 1); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); + + $options{options}->add_options(arguments => { + }); return $self; } @@ -110,4 +107,4 @@ Example: --threshold-overload='module,CRITICAL,^(?!(normal)$)' =back -=cut \ No newline at end of file +=cut diff --git a/network/huawei/snmp/mode/hardware.pm b/network/huawei/snmp/mode/hardware.pm index 1a00a3eb7..6791fd729 100644 --- a/network/huawei/snmp/mode/hardware.pm +++ b/network/huawei/snmp/mode/hardware.pm @@ -29,7 +29,6 @@ use centreon::plugins::statefile; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(fan|temperature)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(fan|temperature)$'; $self->{cb_hook1} = 'init_cache'; @@ -38,8 +37,8 @@ sub set_system { $self->{thresholds} = { fan => [ ['abnormal', 'CRITICAL'], - ['normal', 'OK'], - ], + ['normal', 'OK'] + ] }; $self->{components_path} = 'network::huawei::snmp::mode::components'; @@ -64,10 +63,10 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1); bless $self, $class; - + $options{options}->add_options(arguments => { - 'reload-cache-time:s' => { name => 'reload_cache_time', default => 180 }, - 'short-name' => { name => 'short_name' }, + 'reload-cache-time:s' => { name => 'reload_cache_time', default => 180 }, + 'short-name' => { name => 'short_name' } }); $self->{statefile_cache} = centreon::plugins::statefile->new(%options); diff --git a/network/infoblox/snmp/mode/services.pm b/network/infoblox/snmp/mode/services.pm index 3b7620585..d06597112 100644 --- a/network/infoblox/snmp/mode/services.pm +++ b/network/infoblox/snmp/mode/services.pm @@ -27,9 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(service)$'; - + $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { @@ -38,8 +36,8 @@ sub set_system { ['working', 'OK'], ['inactive', 'OK'], ['warning', 'WARNING'], - ['failed', 'CRITICAL'], - ], + ['failed', 'CRITICAL'] + ] }; $self->{components_path} = 'network::infoblox::snmp::mode::components'; @@ -50,7 +48,7 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_load_components => 1); bless $self, $class; - + $options{options}->add_options(arguments => {}); return $self; diff --git a/network/juniper/common/junos/mode/hardware.pm b/network/juniper/common/junos/mode/hardware.pm index 93d01906d..c520c663e 100644 --- a/network/juniper/common/junos/mode/hardware.pm +++ b/network/juniper/common/junos/mode/hardware.pm @@ -28,8 +28,7 @@ use centreon::plugins::statefile; sub set_system { 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->{cb_hook1} = 'init_cache'; @@ -81,9 +80,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - + $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); diff --git a/network/juniper/common/screenos/snmp/mode/hardware.pm b/network/juniper/common/screenos/snmp/mode/hardware.pm index 763ba93c4..5297f7d4a 100644 --- a/network/juniper/common/screenos/snmp/mode/hardware.pm +++ b/network/juniper/common/screenos/snmp/mode/hardware.pm @@ -27,8 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(psu|module|fan)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(temperature)$'; $self->{cb_hook2} = 'snmp_execute'; @@ -63,10 +62,8 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); + + $options{options}->add_options(arguments => {}); return $self; } diff --git a/network/lenovo/flexsystem/snmp/mode/environment.pm b/network/lenovo/flexsystem/snmp/mode/environment.pm index ff39352e7..d0e3cbf79 100644 --- a/network/lenovo/flexsystem/snmp/mode/environment.pm +++ b/network/lenovo/flexsystem/snmp/mode/environment.pm @@ -28,7 +28,6 @@ use warnings; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(?:faultled)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(?:temperature)$'; $self->{cb_hook2} = 'snmp_execute'; @@ -54,9 +53,8 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1); bless $self, $class; - - $options{options}->add_options(arguments => { - }); + + $options{options}->add_options(arguments => {}); return $self; } diff --git a/network/mrv/optiswitch/snmp/mode/environment.pm b/network/mrv/optiswitch/snmp/mode/environment.pm index eea10e880..bd402ba09 100644 --- a/network/mrv/optiswitch/snmp/mode/environment.pm +++ b/network/mrv/optiswitch/snmp/mode/environment.pm @@ -27,8 +27,6 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(cpu|fan|psu)$'; $self->{cb_hook2} = 'snmp_execute'; @@ -65,10 +63,8 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); + + $options{options}->add_options(arguments => {}); return $self; } @@ -111,4 +107,4 @@ Example: --threshold-overload='fan,CRITICAL,^(?!(notActive)$)' =back -=cut \ No newline at end of file +=cut diff --git a/network/netgear/mseries/snmp/mode/hardware.pm b/network/netgear/mseries/snmp/mode/hardware.pm index 8c984aeae..6b5c04b46 100644 --- a/network/netgear/mseries/snmp/mode/hardware.pm +++ b/network/netgear/mseries/snmp/mode/hardware.pm @@ -27,8 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(temperature|fan|psu)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan)$'; $self->{cb_hook2} = 'snmp_execute'; @@ -69,11 +68,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); - + + $options{options}->add_options(arguments => {}); + return $self; } diff --git a/network/nokia/timos/snmp/mode/hardware.pm b/network/nokia/timos/snmp/mode/hardware.pm index 88de27025..ec3a52e98 100644 --- a/network/nokia/timos/snmp/mode/hardware.pm +++ b/network/nokia/timos/snmp/mode/hardware.pm @@ -27,12 +27,11 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(entity)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^temperature$'; - + $self->{cb_hook2} = 'snmp_execute'; - + $self->{thresholds} = { default => [ ['unknown', 'UNKNOWN'], @@ -48,8 +47,8 @@ sub set_system { ['downgrade', 'OK'], ['resetPending', 'OK'], ['softReset', 'OK'], - ['preExtension', 'OK'], - ], + ['preExtension', 'OK'] + ] }; $self->{components_path} = 'network::nokia::timos::snmp::mode::components'; @@ -67,11 +66,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_load_components => 1); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); - + + $options{options}->add_options(arguments => {}); + return $self; } diff --git a/network/nortel/standard/snmp/mode/hardware.pm b/network/nortel/standard/snmp/mode/hardware.pm index 9bc90ce9b..a1281b841 100644 --- a/network/nortel/standard/snmp/mode/hardware.pm +++ b/network/nortel/standard/snmp/mode/hardware.pm @@ -27,8 +27,7 @@ use warnings; sub set_system { 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->{cb_hook2} = 'snmp_execute'; @@ -83,11 +82,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); - + + $options{options}->add_options(arguments => {}); + return $self; } @@ -134,4 +131,4 @@ Example: --critical='temperature,.*,40' =back -=cut \ No newline at end of file +=cut diff --git a/network/paloalto/ssh/mode/environment.pm b/network/paloalto/ssh/mode/environment.pm index e38707463..a6a941208 100644 --- a/network/paloalto/ssh/mode/environment.pm +++ b/network/paloalto/ssh/mode/environment.pm @@ -28,8 +28,6 @@ use warnings; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = - '^(?:psu|temperature|voltage)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(?:temperature|voltage)$'; $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); bless $self, $class; - $options{options}->add_options(arguments => { - }); + $options{options}->add_options(arguments => {}); return $self; } diff --git a/network/perle/ids/snmp/mode/hardware.pm b/network/perle/ids/snmp/mode/hardware.pm index 7085e27de..be8182688 100644 --- a/network/perle/ids/snmp/mode/hardware.pm +++ b/network/perle/ids/snmp/mode/hardware.pm @@ -27,8 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(temperature|psu)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(temperature)$'; $self->{cb_hook2} = 'snmp_execute'; @@ -58,9 +57,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1); bless $self, $class; - + $options{options}->add_options(arguments => {}); - + return $self; } diff --git a/network/polycom/rmx/snmp/mode/hardware.pm b/network/polycom/rmx/snmp/mode/hardware.pm index 564f3e1fb..348c28641 100644 --- a/network/polycom/rmx/snmp/mode/hardware.pm +++ b/network/polycom/rmx/snmp/mode/hardware.pm @@ -27,17 +27,15 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(fan|psu|board)$'; - + $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { default => [ ['disabled', 'OK'], ['ok', 'OK'], - ['failed', 'CRITICAL'], - ], + ['failed', 'CRITICAL'] + ] }; $self->{components_path} = 'network::polycom::rmx::snmp::mode::components'; @@ -48,7 +46,7 @@ my %map_status = (1 => 'disabled', 2 => 'ok', 3 => 'failed'); my $mapping = { 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 }, - 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 { @@ -64,11 +62,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); - + + $options{options}->add_options(arguments => {}); + return $self; } @@ -104,4 +100,4 @@ Example: --threshold-overload='psu,CRITICAL,disabled' =back -=cut \ No newline at end of file +=cut diff --git a/network/radware/alteon/snmp/mode/hardware.pm b/network/radware/alteon/snmp/mode/hardware.pm index b9d81ec83..b347321ae 100644 --- a/network/radware/alteon/snmp/mode/hardware.pm +++ b/network/radware/alteon/snmp/mode/hardware.pm @@ -25,8 +25,6 @@ use base qw(centreon::plugins::templates::hardware); sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(cpu|temperature|psu|fan)$'; - $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { @@ -60,10 +58,8 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1, no_load_components => 1); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); + + $options{options}->add_options(arguments => {}); return $self; } @@ -276,4 +272,4 @@ sub check { } 1; - \ No newline at end of file + diff --git a/network/raisecom/snmp/mode/hardware.pm b/network/raisecom/snmp/mode/hardware.pm index a9dab27f4..8fc3b0578 100644 --- a/network/raisecom/snmp/mode/hardware.pm +++ b/network/raisecom/snmp/mode/hardware.pm @@ -28,7 +28,6 @@ use warnings; sub set_system { 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->{cb_hook2} = 'snmp_execute'; @@ -36,8 +35,8 @@ sub set_system { $self->{thresholds} = { fan => [ ['abnormal', 'CRITICAL'], - ['normal', 'OK'], - ], + ['normal', 'OK'] + ] }; $self->{components_path} = 'network::raisecom::snmp::mode::components'; @@ -56,9 +55,7 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => - { - }); + $options{options}->add_options(arguments => {}); return $self; } diff --git a/network/redback/snmp/mode/hardware.pm b/network/redback/snmp/mode/hardware.pm index 28531969f..0f5299a00 100644 --- a/network/redback/snmp/mode/hardware.pm +++ b/network/redback/snmp/mode/hardware.pm @@ -27,8 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(fan|psu|disk)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|voltage)$'; $self->{cb_hook2} = 'snmp_execute'; @@ -38,21 +37,21 @@ sub set_system { ['unknown', 'UNKNOWN'], ['normal', 'OK'], ['failed', 'CRITICAL'], - ['absent', 'OK'], + ['absent', 'OK'] ], psu => [ ['unknown', 'UNKNOWN'], ['normal', 'OK'], ['failed', 'CRITICAL'], - ['absent', 'OK'], + ['absent', 'OK'] ], disk => [ ['operational', 'OK'], ['failed', 'CRITICAL'], - ['degrading', 'WARNING'], - ], + ['degrading', 'WARNING'] + ] }; - + $self->{components_path} = 'network::redback::snmp::mode::components'; $self->{components_module} = ['fan', 'psu', 'temperature', 'voltage', 'disk']; } @@ -68,10 +67,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); + + $options{options}->add_options(arguments => { + }); return $self; } diff --git a/network/ruggedcom/mode/hardware.pm b/network/ruggedcom/mode/hardware.pm index 34be65ad6..c181feaa7 100644 --- a/network/ruggedcom/mode/hardware.pm +++ b/network/ruggedcom/mode/hardware.pm @@ -29,8 +29,6 @@ use centreon::plugins::misc; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^psu|fan$'; - $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { @@ -64,9 +62,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1); bless $self, $class; - + $options{options}->add_options(arguments => {}); - + return $self; } diff --git a/network/sophos/es/snmp/mode/health.pm b/network/sophos/es/snmp/mode/health.pm index c4015a569..1bad97492 100644 --- a/network/sophos/es/snmp/mode/health.pm +++ b/network/sophos/es/snmp/mode/health.pm @@ -28,8 +28,6 @@ use warnings; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(system|component)$'; - $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { @@ -38,8 +36,8 @@ sub set_system { ['disabled', 'OK'], ['ok', 'OK'], ['warn', 'WARNING'], - ['error', 'CRITICAL'], - ], + ['error', 'CRITICAL'] + ] }; $self->{components_path} = 'network::sophos::es::snmp::mode::components'; @@ -57,11 +55,10 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); - + + $options{options}->add_options(arguments => { + }); + return $self; } @@ -98,4 +95,4 @@ Example: --threshold-overload='component,UNKNOWN,unknown' =back -=cut \ No newline at end of file +=cut diff --git a/os/solaris/local/mode/lomv120.pm b/os/solaris/local/mode/lomv120.pm index 87c89ec6d..83596a7c3 100644 --- a/os/solaris/local/mode/lomv120.pm +++ b/os/solaris/local/mode/lomv120.pm @@ -29,14 +29,12 @@ use centreon::plugins::misc; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^fan|psu|voltage|sf$'; - $self->{cb_hook2} = 'command_execute'; $self->{thresholds} = { default => [ - ['^(?!(OK)$)' => 'CRITICAL'], - ], + ['^(?!(OK)$)' => 'CRITICAL'] + ] }; $self->{components_exec_load} = 0; @@ -63,7 +61,7 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1); bless $self, $class; - + $options{options}->add_options(arguments => { 'hostname:s' => { name => 'hostname' }, 'remote' => { name => 'remote' }, @@ -74,7 +72,7 @@ sub new { 'sudo' => { name => 'sudo' }, 'command:s' => { name => 'command', default => 'lom' }, 'command-path:s' => { name => 'command_path', default => '/usr/sbin' }, - 'command-options:s' => { name => 'command_options', default => '-fpv 2>&1'}, + 'command-options:s' => { name => 'command_options', default => '-fpv 2>&1'} }); return $self; diff --git a/snmp_standard/mode/entity.pm b/snmp_standard/mode/entity.pm index 8a3e903b9..93e8ef3a1 100644 --- a/snmp_standard/mode/entity.pm +++ b/snmp_standard/mode/entity.pm @@ -27,8 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(sensor\..*)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(sensor\..*)$'; $self->{cb_hook2} = 'snmp_execute'; @@ -49,7 +48,7 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_load_components => 1); bless $self, $class; - + $options{options}->add_options(arguments => { 'sensor-scale' => { name => 'sensor_scale' }, }); diff --git a/snmp_standard/mode/hardwaredevice.pm b/snmp_standard/mode/hardwaredevice.pm index f519f5abe..4ab098c9f 100644 --- a/snmp_standard/mode/hardwaredevice.pm +++ b/snmp_standard/mode/hardwaredevice.pm @@ -28,8 +28,6 @@ use warnings; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(device\..*)$'; - $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { @@ -50,10 +48,8 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1, no_load_components => 1); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); + + $options{options}->add_options(arguments => {}); return $self; } diff --git a/snmp_standard/mode/hardwarefibrealliance.pm b/snmp_standard/mode/hardwarefibrealliance.pm index 404b432da..6a6ec9a0a 100644 --- a/snmp_standard/mode/hardwarefibrealliance.pm +++ b/snmp_standard/mode/hardwarefibrealliance.pm @@ -28,8 +28,6 @@ use warnings; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(sensors|port|unit)$'; - $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { diff --git a/storage/buffalo/terastation/snmp/mode/hardware.pm b/storage/buffalo/terastation/snmp/mode/hardware.pm index e61286d54..522e4eb0f 100644 --- a/storage/buffalo/terastation/snmp/mode/hardware.pm +++ b/storage/buffalo/terastation/snmp/mode/hardware.pm @@ -27,9 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(disk|psu|iscsi)$'; - + $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { @@ -70,10 +68,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1, force_new_perfdata => 1); bless $self, $class; - - $options{options}->add_options(arguments => { - }); - + + $options{options}->add_options(arguments => {}); + return $self; } diff --git a/storage/dell/compellent/snmp/mode/hardware.pm b/storage/dell/compellent/snmp/mode/hardware.pm index 665250cda..dff734dd5 100644 --- a/storage/dell/compellent/snmp/mode/hardware.pm +++ b/storage/dell/compellent/snmp/mode/hardware.pm @@ -27,9 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = - '^(ctrl|disk|encl|ctrlfan|ctrlpower|ctrlvoltage|ctrltemp|enclfan|enclpower|encliomod|encltemp|volume|cache|server|sc)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(ctrltemp|ctrlvoltage|ctrlfan|encltemp)$'; $self->{cb_hook2} = 'snmp_execute'; @@ -43,8 +41,10 @@ sub set_system { }; $self->{components_path} = 'storage::dell::compellent::snmp::mode::components'; - $self->{components_module} = ['ctrl', 'disk', 'ctrlfan', 'ctrlpower', 'ctrlvoltage', 'ctrltemp', - 'encl', 'enclfan', 'enclpower', 'encliomod', 'encltemp', 'volume', 'cache', 'server', 'sc']; + $self->{components_module} = [ + 'ctrl', 'disk', 'ctrlfan', 'ctrlpower', 'ctrlvoltage', 'ctrltemp', + 'encl', 'enclfan', 'enclpower', 'encliomod', 'encltemp', 'volume', 'cache', 'server', 'sc' + ]; } sub snmp_execute { @@ -58,11 +58,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); - + + $options{options}->add_options(arguments => { }); + return $self; } @@ -110,4 +108,4 @@ Example: --critical='ctrltemp,1,50' =back -=cut \ No newline at end of file +=cut diff --git a/storage/dell/equallogic/snmp/mode/hardware.pm b/storage/dell/equallogic/snmp/mode/hardware.pm index 52d53e902..671db55b4 100644 --- a/storage/dell/equallogic/snmp/mode/hardware.pm +++ b/storage/dell/equallogic/snmp/mode/hardware.pm @@ -27,10 +27,9 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(fan|psu|temperature|raid|disk|health)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|fan)$'; - + $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { @@ -94,11 +93,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); - + + $options{options}->add_options(arguments => {}); + return $self; } diff --git a/storage/dell/fluidfs/snmp/mode/hardware.pm b/storage/dell/fluidfs/snmp/mode/hardware.pm index a334bf09d..8d210c56a 100644 --- a/storage/dell/fluidfs/snmp/mode/hardware.pm +++ b/storage/dell/fluidfs/snmp/mode/hardware.pm @@ -28,8 +28,6 @@ use warnings; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(ad|extservers|overall|substorage)$'; - $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { @@ -62,11 +60,10 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); - + + $options{options}->add_options(arguments => { + }); + return $self; } diff --git a/storage/dell/me4/restapi/mode/hardware.pm b/storage/dell/me4/restapi/mode/hardware.pm index ef47e2d12..2d75bff08 100644 --- a/storage/dell/me4/restapi/mode/hardware.pm +++ b/storage/dell/me4/restapi/mode/hardware.pm @@ -27,8 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(controller|disk|fan|fru|psu|sensor|volume)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(fan|disk|sensor)$'; $self->{cb_hook1} = 'init_custom'; @@ -129,9 +128,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, force_new_perfdata => 1); bless $self, $class; - + $options{options}->add_options(arguments => {}); - + return $self; } diff --git a/storage/emc/DataDomain/mode/hardware.pm b/storage/emc/DataDomain/mode/hardware.pm index fefe31de7..18b0b6dbe 100644 --- a/storage/emc/DataDomain/mode/hardware.pm +++ b/storage/emc/DataDomain/mode/hardware.pm @@ -28,10 +28,9 @@ use storage::emc::DataDomain::lib::functions; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(fan|temperature|psu|disk|battery)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(battery|temperature)$'; - + $self->{cb_hook1} = 'get_version'; # before the loads $self->{cb_hook2} = 'snmp_execute'; @@ -80,7 +79,7 @@ sub set_system { sub snmp_execute { my ($self, %options) = @_; - + $self->{snmp} = $options{snmp}; $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request}); } @@ -89,9 +88,8 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - - $options{options}->add_options(arguments => { - }); + + $options{options}->add_options(arguments => {}); return $self; } diff --git a/storage/emc/celerra/local/mode/getreason.pm b/storage/emc/celerra/local/mode/getreason.pm index 42706adb8..817615cec 100644 --- a/storage/emc/celerra/local/mode/getreason.pm +++ b/storage/emc/celerra/local/mode/getreason.pm @@ -28,10 +28,7 @@ use centreon::plugins::misc; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = - '^(controlstation|datamover)$'; - + $self->{cb_hook2} = 'cmd_execute'; $self->{thresholds} = { @@ -71,19 +68,21 @@ sub set_system { sub cmd_execute { my ($self, %options) = @_; - ($self->{stdout}) = centreon::plugins::misc::execute(output => $self->{output}, - options => $self->{option_results}, - sudo => $self->{option_results}->{sudo}, - command => $self->{option_results}->{command}, - command_path => $self->{option_results}->{command_path}, - command_options => $self->{option_results}->{command_options}); + ($self->{stdout}) = centreon::plugins::misc::execute( + output => $self->{output}, + options => $self->{option_results}, + sudo => $self->{option_results}->{sudo}, + command => $self->{option_results}->{command}, + command_path => $self->{option_results}->{command_path}, + command_options => $self->{option_results}->{command_options} + ); } sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1); bless $self, $class; - + $options{options}->add_options(arguments => { 'hostname:s' => { name => 'hostname' }, 'remote' => { name => 'remote' }, @@ -94,7 +93,7 @@ sub new { 'sudo' => { name => 'sudo' }, 'command:s' => { name => 'command', default => 'getreason' }, 'command-path:s' => { name => 'command_path', default => '/nas/sbin' }, - 'command-options:s' => { name => 'command_options', default => '2>&1' }, + 'command-options:s' => { name => 'command_options', default => '2>&1' } }); return $self; diff --git a/storage/emc/isilon/snmp/mode/hardware.pm b/storage/emc/isilon/snmp/mode/hardware.pm index 6a4f79753..9741941e5 100644 --- a/storage/emc/isilon/snmp/mode/hardware.pm +++ b/storage/emc/isilon/snmp/mode/hardware.pm @@ -27,8 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(disk)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(fan|temperature|power)$'; $self->{cb_hook1} = 'get_version'; # before the loads @@ -59,7 +58,7 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); bless $self, $class; - + $options{options}->add_options(arguments => {}); return $self; diff --git a/storage/emc/unisphere/restapi/mode/hardware.pm b/storage/emc/unisphere/restapi/mode/hardware.pm index e31743b42..bd91d7785 100644 --- a/storage/emc/unisphere/restapi/mode/hardware.pm +++ b/storage/emc/unisphere/restapi/mode/hardware.pm @@ -27,8 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(disk|fan|iomodule|psu|dpe|battery|ssd|sp)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|power)$'; $self->{cb_hook1} = 'init_custom'; @@ -54,9 +53,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, force_new_perfdata => 1); bless $self, $class; - + $options{options}->add_options(arguments => {}); - + return $self; } diff --git a/storage/hitachi/standard/snmp/mode/hardware.pm b/storage/hitachi/standard/snmp/mode/hardware.pm index c90ed3c02..1ded7dbae 100644 --- a/storage/hitachi/standard/snmp/mode/hardware.pm +++ b/storage/hitachi/standard/snmp/mode/hardware.pm @@ -27,11 +27,9 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(component|dkc|dku)$'; - + $self->{cb_hook2} = 'snmp_execute'; - + $self->{thresholds} = { component => [ ['ok', 'OK'], @@ -61,11 +59,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); - + + $options{options}->add_options(arguments => {}); + return $self; } @@ -102,4 +98,4 @@ Example: --threshold-overload='component,NAS Server,OK,abnormal' =back -=cut \ No newline at end of file +=cut diff --git a/storage/hp/3par/ssh/mode/hardware.pm b/storage/hp/3par/ssh/mode/hardware.pm index 9ecc8cffb..ad48335dd 100644 --- a/storage/hp/3par/ssh/mode/hardware.pm +++ b/storage/hp/3par/ssh/mode/hardware.pm @@ -27,9 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = - '^(battery|cim|port|node|disk|psu|sensor)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(battery\.charge|sensor)$'; $self->{cb_hook2} = 'ssh_execute'; @@ -72,8 +70,7 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, force_new_perfdata => 1); bless $self, $class; - $options{options}->add_options(arguments => { - }); + $options{options}->add_options(arguments => {}); $self->{commands} = []; return $self; diff --git a/storage/hp/eva/cli/mode/hardware.pm b/storage/hp/eva/cli/mode/hardware.pm index af8431023..4df7a1c72 100644 --- a/storage/hp/eva/cli/mode/hardware.pm +++ b/storage/hp/eva/cli/mode/hardware.pm @@ -27,9 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = - '^(fan|temperature|system|disk|diskgrp|psu|battery|iomodule)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(fan|temperature|psu)$'; $self->{cb_hook2} = 'api_execute'; @@ -59,10 +57,8 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); + + $options{options}->add_options(arguments => {}); $self->{ssu_commands} = {}; return $self; diff --git a/storage/hp/lefthand/snmp/mode/hardware.pm b/storage/hp/lefthand/snmp/mode/hardware.pm index 1c4f1348e..c1f1692f4 100644 --- a/storage/hp/lefthand/snmp/mode/hardware.pm +++ b/storage/hp/lefthand/snmp/mode/hardware.pm @@ -28,7 +28,6 @@ use warnings; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(fan|psu|temperature|rcc|voltage|device||device\.smart|rc|ro|bbu)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|voltage|fan|device\.temperature)$'; $self->{cb_hook2} = 'snmp_execute'; @@ -64,11 +63,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); - + + $options{options}->add_options(arguments => { }); + return $self; } @@ -116,4 +113,4 @@ Example: --critical='temperature,.*,50' =back =cut - \ No newline at end of file + diff --git a/storage/hp/msl/snmp/mode/hardware.pm b/storage/hp/msl/snmp/mode/hardware.pm index 6927ed13f..b43d00495 100644 --- a/storage/hp/msl/snmp/mode/hardware.pm +++ b/storage/hp/msl/snmp/mode/hardware.pm @@ -28,8 +28,6 @@ use warnings; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(library)$'; - $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { @@ -52,9 +50,7 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1, no_load_components => 1); bless $self, $class; - $options{options}->add_options(arguments => - { - }); + $options{options}->add_options(arguments => {}); return $self; } diff --git a/storage/hp/p2000/xmlapi/mode/health.pm b/storage/hp/p2000/xmlapi/mode/health.pm index 4d98acf23..784e2c540 100644 --- a/storage/hp/p2000/xmlapi/mode/health.pm +++ b/storage/hp/p2000/xmlapi/mode/health.pm @@ -27,9 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = - '^(disk|enclosure|fru|sensor|vdisk)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(sensor)$'; diff --git a/storage/hp/storeonce/ssh/mode/hardware.pm b/storage/hp/storeonce/ssh/mode/hardware.pm index d44c36497..d4545bc0d 100644 --- a/storage/hp/storeonce/ssh/mode/hardware.pm +++ b/storage/hp/storeonce/ssh/mode/hardware.pm @@ -28,9 +28,6 @@ use warnings; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = - '^(hardware|serviceset)$'; - $self->{cb_hook2} = 'ssh_execute'; $self->{thresholds} = { @@ -60,10 +57,8 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); + + $options{options}->add_options(arguments => {}); $self->{commands} = []; return $self; diff --git a/storage/ibm/fs900/snmp/mode/hardware.pm b/storage/ibm/fs900/snmp/mode/hardware.pm index 6c8334629..3ad2cd484 100644 --- a/storage/ibm/fs900/snmp/mode/hardware.pm +++ b/storage/ibm/fs900/snmp/mode/hardware.pm @@ -28,7 +28,6 @@ use warnings; sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(psu|fibrechannel)$'; $self->{regexp_threshold_numeric_check_section_option} = '^(battery.capacity|battery.current|battery.voltage|fan.pwm|fan.temperature|fan.speed|flashcard.health|flashcard.power|flashcard.temperature|psu.fan)$'; $self->{cb_hook2} = 'snmp_execute'; @@ -62,10 +61,8 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); + + $options{options}->add_options(arguments => {}); return $self; } @@ -118,4 +115,4 @@ Example: --critical='battery.voltage,1,1000' =back -=cut \ No newline at end of file +=cut diff --git a/storage/ibm/storwize/ssh/mode/hardware.pm b/storage/ibm/storwize/ssh/mode/hardware.pm index dafbe1afa..70173992b 100644 --- a/storage/ibm/storwize/ssh/mode/hardware.pm +++ b/storage/ibm/storwize/ssh/mode/hardware.pm @@ -27,9 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = - '^(array|drive|enclosure|enclosurebattery|enclosurecanister|enclosurepsu|host|portfc|portsas|vdisk|node|quorum|mdisk)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(systemstats)$'; $self->{cb_hook2} = 'ssh_execute'; @@ -83,8 +81,7 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); bless $self, $class; - $options{options}->add_options(arguments => { - }); + $options{options}->add_options(arguments => {}); $self->{ssh_commands} = ''; return $self; diff --git a/storage/ibm/ts2900/snmp/mode/hardware.pm b/storage/ibm/ts2900/snmp/mode/hardware.pm index ee22bc213..8f04eced3 100644 --- a/storage/ibm/ts2900/snmp/mode/hardware.pm +++ b/storage/ibm/ts2900/snmp/mode/hardware.pm @@ -25,8 +25,6 @@ use base qw(centreon::plugins::templates::hardware); sub set_system { my ($self, %options) = @_; - $self->{regexp_threshold_overload_check_section_option} = '^(cpu|temperature|psu|fan)$'; - $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { @@ -47,10 +45,8 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1, no_load_components => 1); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); + + $options{options}->add_options(arguments => {}); return $self; } diff --git a/storage/lenovo/iomega/snmp/mode/hardware.pm b/storage/lenovo/iomega/snmp/mode/hardware.pm index 08fbbe626..6ce57f3ae 100644 --- a/storage/lenovo/iomega/snmp/mode/hardware.pm +++ b/storage/lenovo/iomega/snmp/mode/hardware.pm @@ -27,8 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(?:raid|disk)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(?:temperature|temperature|voltage)$'; $self->{cb_hook2} = 'snmp_execute'; @@ -65,8 +64,7 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, force_new_perfdata => 1); bless $self, $class; - $options{options}->add_options(arguments => { - }); + $options{options}->add_options(arguments => {}); return $self; } diff --git a/storage/netapp/ontap/restapi/mode/hardware.pm b/storage/netapp/ontap/restapi/mode/hardware.pm index ab55ff23c..e31590910 100644 --- a/storage/netapp/ontap/restapi/mode/hardware.pm +++ b/storage/netapp/ontap/restapi/mode/hardware.pm @@ -27,8 +27,6 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(?:bay|fru)$'; $self->{cb_hook2} = 'execute_custom'; @@ -48,9 +46,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1, force_new_perfdata => 1); bless $self, $class; - + $options{options}->add_options(arguments => {}); - + return $self; } diff --git a/storage/netapp/santricity/restapi/mode/hardware.pm b/storage/netapp/santricity/restapi/mode/hardware.pm index e651fcb00..18baa60ba 100644 --- a/storage/netapp/santricity/restapi/mode/hardware.pm +++ b/storage/netapp/santricity/restapi/mode/hardware.pm @@ -27,9 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = - '^(?:storage|battery|cbd|cmd|boards|psu|fan|thsensor|ctrl|drive)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(?:drive.temperature)$'; $self->{cb_hook2} = 'execute_custom'; @@ -138,9 +136,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, force_new_perfdata => 1); bless $self, $class; - + $options{options}->add_options(arguments => {}); - + return $self; } diff --git a/storage/netgear/readynas/snmp/mode/hardware.pm b/storage/netgear/readynas/snmp/mode/hardware.pm index 8782a6e7f..f3d40b355 100644 --- a/storage/netgear/readynas/snmp/mode/hardware.pm +++ b/storage/netgear/readynas/snmp/mode/hardware.pm @@ -29,8 +29,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(fan|psu|disk|volume|temperature)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(fan|temperature)$'; $self->{cb_hook1} = 'init_mib_ver'; @@ -93,11 +92,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); - + + $options{options}->add_options(arguments => {}); + return $self; } diff --git a/storage/nimble/restapi/mode/hardware.pm b/storage/nimble/restapi/mode/hardware.pm index 086811d29..a5825d0cb 100644 --- a/storage/nimble/restapi/mode/hardware.pm +++ b/storage/nimble/restapi/mode/hardware.pm @@ -27,8 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(?:disk|fan|psu|temperature)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(?:fan|temperature)$'; $self->{cb_hook2} = 'execute_custom'; diff --git a/storage/oracle/zs/restapi/mode/hardware.pm b/storage/oracle/zs/restapi/mode/hardware.pm index da5c756f5..670ca145d 100644 --- a/storage/oracle/zs/restapi/mode/hardware.pm +++ b/storage/oracle/zs/restapi/mode/hardware.pm @@ -27,8 +27,6 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(chassis|cpu|disk|fan|memory|psu|slot)$'; $self->{cb_hook2} = 'execute_custom'; @@ -49,9 +47,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1, force_new_perfdata => 1); bless $self, $class; - + $options{options}->add_options(arguments => {}); - + return $self; } diff --git a/storage/oracle/zs/snmp/mode/hardware.pm b/storage/oracle/zs/snmp/mode/hardware.pm index d9c56a511..6d2131bb5 100644 --- a/storage/oracle/zs/snmp/mode/hardware.pm +++ b/storage/oracle/zs/snmp/mode/hardware.pm @@ -27,9 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(module)$'; - + $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { @@ -55,11 +53,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); - + + $options{options}->add_options(arguments => { }); + return $self; } @@ -97,4 +93,4 @@ Example: --threshold-overload='module,OK,other' =back =cut - \ No newline at end of file + diff --git a/storage/overland/neo/snmp/mode/hardware.pm b/storage/overland/neo/snmp/mode/hardware.pm index d813d427a..5671af99a 100644 --- a/storage/overland/neo/snmp/mode/hardware.pm +++ b/storage/overland/neo/snmp/mode/hardware.pm @@ -27,9 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(drive|library)$'; - + $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { @@ -62,11 +60,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); - + + $options{options}->add_options(arguments => {}); + return $self; } @@ -103,4 +99,4 @@ Example: --threshold-overload='drive,OK,notInitialized' =back -=cut \ No newline at end of file +=cut diff --git a/storage/purestorage/restapi/mode/hardware.pm b/storage/purestorage/restapi/mode/hardware.pm index 0cce20635..acc3db323 100644 --- a/storage/purestorage/restapi/mode/hardware.pm +++ b/storage/purestorage/restapi/mode/hardware.pm @@ -27,12 +27,11 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(entity)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(temperature)$'; - + $self->{cb_hook2} = 'restapi_execute'; - + $self->{thresholds} = { entity => [ ['ok', 'OK'], @@ -53,10 +52,8 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_load_components => 1); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); + + $options{options}->add_options(arguments => { }); return $self; } diff --git a/storage/qnap/snmp/mode/hardware.pm b/storage/qnap/snmp/mode/hardware.pm index ff6457ba4..103a28c20 100644 --- a/storage/qnap/snmp/mode/hardware.pm +++ b/storage/qnap/snmp/mode/hardware.pm @@ -27,10 +27,9 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(temperature|disk|smartdisk|fan|raid)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|disk|smartdisk|fan)$'; - + $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { @@ -69,10 +68,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - - $options{options}->add_options(arguments => { - }); - + + $options{options}->add_options(arguments => {}); + return $self; } diff --git a/storage/qsan/nas/snmp/mode/hardware.pm b/storage/qsan/nas/snmp/mode/hardware.pm index 83b43b677..772852e78 100644 --- a/storage/qsan/nas/snmp/mode/hardware.pm +++ b/storage/qsan/nas/snmp/mode/hardware.pm @@ -28,10 +28,9 @@ use storage::qsan::nas::snmp::mode::components::resources qw($mapping); sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(disk|voltage|temperature|psu|fan)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|disk.temperature|voltage|fan)$'; - + $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { @@ -66,11 +65,10 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); - + + $options{options}->add_options(arguments => { + }); + return $self; } diff --git a/storage/quantum/scalar/snmp/mode/hardware.pm b/storage/quantum/scalar/snmp/mode/hardware.pm index a02da0b9a..9bcd5d5a2 100644 --- a/storage/quantum/scalar/snmp/mode/hardware.pm +++ b/storage/quantum/scalar/snmp/mode/hardware.pm @@ -27,8 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(?:subsystem|physicaldrive\.(status|cleaning)|psu|voltage|humidity|temperature)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(?:temperature|humidity|power|voltage)$'; $self->{cb_hook2} = 'snmp_execute'; @@ -75,9 +74,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, force_new_perfdata => 1); bless $self, $class; - + $options{options}->add_options(arguments => {}); - + return $self; } diff --git a/storage/storagetek/sl/snmp/mode/hardware.pm b/storage/storagetek/sl/snmp/mode/hardware.pm index 64fae068d..0d1911833 100644 --- a/storage/storagetek/sl/snmp/mode/hardware.pm +++ b/storage/storagetek/sl/snmp/mode/hardware.pm @@ -27,8 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(interface|temperature|fan|psu|robot|elevator|controller|cap|turntable)$'; + $self->{regexp_threshold_numeric_check_section_option} = '^(temperature)$'; $self->{cb_hook2} = 'snmp_execute'; @@ -62,11 +61,9 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1); bless $self, $class; - - $options{options}->add_options(arguments => - { - }); - + + $options{options}->add_options(arguments => {}); + return $self; } @@ -113,4 +110,4 @@ Example: --critical='temperature,.*,40' =back -=cut \ No newline at end of file +=cut diff --git a/storage/synology/snmp/mode/hardware.pm b/storage/synology/snmp/mode/hardware.pm index 53558005f..3ad909c71 100644 --- a/storage/synology/snmp/mode/hardware.pm +++ b/storage/synology/snmp/mode/hardware.pm @@ -27,9 +27,7 @@ use warnings; sub set_system { my ($self, %options) = @_; - - $self->{regexp_threshold_overload_check_section_option} = '^(?:fan|psu|disk|system|raid)$'; - + $self->{cb_hook2} = 'snmp_execute'; $self->{thresholds} = { @@ -93,7 +91,7 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1); bless $self, $class; - $options{options}->add_options(arguments => { }); + $options{options}->add_options(arguments => {}); return $self; }