From 746b38ee7d5589721ad003a2b14a031be063626a Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 26 Aug 2015 14:46:03 +0200 Subject: [PATCH] + fix threshold-overload --- hardware/pdu/raritan/snmp/mode/inletsensors.pm | 3 ++- hardware/pdu/raritan/snmp/mode/ocprotsensors.pm | 3 ++- hardware/pdu/raritan/snmp/mode/outletsensors.pm | 3 ++- hardware/sensors/hwgste/snmp/mode/sensors.pm | 3 ++- network/bluecoat/snmp/mode/hardware.pm | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/hardware/pdu/raritan/snmp/mode/inletsensors.pm b/hardware/pdu/raritan/snmp/mode/inletsensors.pm index 9ec719903..7faf3a50b 100644 --- a/hardware/pdu/raritan/snmp/mode/inletsensors.pm +++ b/hardware/pdu/raritan/snmp/mode/inletsensors.pm @@ -206,7 +206,8 @@ sub get_severity { if (defined($self->{overload_th}->{$options{section}})) { foreach (@{$self->{overload_th}->{$options{section}}}) { - if ($options{value} =~ /$_->{filter}/i) { + if ($options{value} =~ /$_->{filter}/i && + (!defined($options{instance}) || $options{instance} =~ /$_->{instance}/)) { $status = $_->{status}; return $status; } diff --git a/hardware/pdu/raritan/snmp/mode/ocprotsensors.pm b/hardware/pdu/raritan/snmp/mode/ocprotsensors.pm index f60deedf0..666aeb569 100644 --- a/hardware/pdu/raritan/snmp/mode/ocprotsensors.pm +++ b/hardware/pdu/raritan/snmp/mode/ocprotsensors.pm @@ -206,7 +206,8 @@ sub get_severity { if (defined($self->{overload_th}->{$options{section}})) { foreach (@{$self->{overload_th}->{$options{section}}}) { - if ($options{value} =~ /$_->{filter}/i) { + if ($options{value} =~ /$_->{filter}/i && + (!defined($options{instance}) || $options{instance} =~ /$_->{instance}/)) { $status = $_->{status}; return $status; } diff --git a/hardware/pdu/raritan/snmp/mode/outletsensors.pm b/hardware/pdu/raritan/snmp/mode/outletsensors.pm index 4a7e0a3b0..b6586f5a6 100644 --- a/hardware/pdu/raritan/snmp/mode/outletsensors.pm +++ b/hardware/pdu/raritan/snmp/mode/outletsensors.pm @@ -206,7 +206,8 @@ sub get_severity { if (defined($self->{overload_th}->{$options{section}})) { foreach (@{$self->{overload_th}->{$options{section}}}) { - if ($options{value} =~ /$_->{filter}/i) { + if ($options{value} =~ /$_->{filter}/i && + (!defined($options{instance}) || $options{instance} =~ /$_->{instance}/)) { $status = $_->{status}; return $status; } diff --git a/hardware/sensors/hwgste/snmp/mode/sensors.pm b/hardware/sensors/hwgste/snmp/mode/sensors.pm index 61ef612ab..305621907 100644 --- a/hardware/sensors/hwgste/snmp/mode/sensors.pm +++ b/hardware/sensors/hwgste/snmp/mode/sensors.pm @@ -224,7 +224,8 @@ sub get_severity { if (defined($self->{overload_th}->{$options{section}})) { foreach (@{$self->{overload_th}->{$options{section}}}) { - if ($options{value} =~ /$_->{filter}/i) { + if ($options{value} =~ /$_->{filter}/i && + (!defined($options{instance}) || $options{instance} =~ /$_->{instance}/)) { $status = $_->{status}; return $status; } diff --git a/network/bluecoat/snmp/mode/hardware.pm b/network/bluecoat/snmp/mode/hardware.pm index c2fb0dee5..af39b7603 100644 --- a/network/bluecoat/snmp/mode/hardware.pm +++ b/network/bluecoat/snmp/mode/hardware.pm @@ -287,7 +287,8 @@ sub get_severity { if (defined($self->{overload_th}->{$options{section}})) { foreach (@{$self->{overload_th}->{$options{section}}}) { - if ($options{value} =~ /$_->{filter}/i) { + if ($options{value} =~ /$_->{filter}/i && + (!defined($options{instance}) || $options{instance} =~ /$_->{instance}/)) { $status = $_->{status}; return $status; }