From fa8d7a008d5f2510cd3cf02eaecbf6901ac082f0 Mon Sep 17 00:00:00 2001 From: dharpster Date: Tue, 22 Jan 2019 17:11:26 -0600 Subject: [PATCH] Fix Sentry3 voltage sensor discovery (#9714) * Fix Sentry3 voltage sensor discovery Previous fix broke voltage sensor discovery with superfluous .1 in the SNMP OID. I have fixed my install with this patch but other testing should probably be done. * Update sentry3.json --- .../discovery/sensors/voltage/sentry3.inc.php | 2 +- tests/data/sentry3.json | 210 +----------------- 2 files changed, 8 insertions(+), 204 deletions(-) diff --git a/includes/discovery/sensors/voltage/sentry3.inc.php b/includes/discovery/sensors/voltage/sentry3.inc.php index 833c797f00..8770fc2e28 100644 --- a/includes/discovery/sensors/voltage/sentry3.inc.php +++ b/includes/discovery/sensors/voltage/sentry3.inc.php @@ -10,7 +10,7 @@ foreach ($oids as $index => $first) { $valid['sensor'], 'voltage', $device, - ".1.3.6.1.4.1.1718.3.2.2.1.11.1.$index.$end", + ".1.3.6.1.4.1.1718.3.2.2.1.11.$index.$end", $index, 'sentry3', 'Tower ' . $index, diff --git a/tests/data/sentry3.json b/tests/data/sentry3.json index 34eb07cd2f..7af5dbb939 100644 --- a/tests/data/sentry3.json +++ b/tests/data/sentry3.json @@ -10,11 +10,11 @@ "version": null, "hardware": null, "features": null, - "location": null, "os": "sentry3", "type": "power", "serial": null, - "icon": "servertech.png" + "icon": "servertech.png", + "location": null } ] }, @@ -28,11 +28,11 @@ "version": " 7.1a", "hardware": "CW-24V2C458C1", "features": null, - "location": null, "os": "sentry3", "type": "power", "serial": "ADLH0001862", - "icon": "servertech.png" + "icon": "servertech.png", + "location": null } ] } @@ -618,7 +618,7 @@ "sensor_deleted": 0, "sensor_class": "voltage", "poller_type": "snmp", - "sensor_oid": ".1.3.6.1.4.1.1718.3.2.2.1.11.1.1.1", + "sensor_oid": ".1.3.6.1.4.1.1718.3.2.2.1.11.1.1", "sensor_index": "1", "sensor_type": "sentry3", "sensor_descr": "Tower 1", @@ -642,7 +642,7 @@ "sensor_deleted": 0, "sensor_class": "voltage", "poller_type": "snmp", - "sensor_oid": ".1.3.6.1.4.1.1718.3.2.2.1.11.1.2.1", + "sensor_oid": ".1.3.6.1.4.1.1718.3.2.2.1.11.2.1", "sensor_index": "2", "sensor_type": "sentry3", "sensor_descr": "Tower 2", @@ -665,202 +665,6 @@ ], "state_indexes": [] }, - "poller": { - "sensors": [ - { - "sensor_deleted": 0, - "sensor_class": "current", - "poller_type": "snmp", - "sensor_oid": ".1.3.6.1.4.1.1718.3.2.2.1.7.1.1", - "sensor_index": "infeedID.1.1", - "sensor_type": "sentry3", - "sensor_descr": "Infeed AA", - "group": null, - "sensor_divisor": 100, - "sensor_multiplier": 1, - "sensor_current": 3.62, - "sensor_limit": 5.43, - "sensor_limit_warn": null, - "sensor_limit_low": null, - "sensor_limit_low_warn": null, - "sensor_alert": 1, - "sensor_custom": "No", - "entPhysicalIndex": null, - "entPhysicalIndex_measured": null, - "sensor_prev": null, - "user_func": null, - "state_name": null - }, - { - "sensor_deleted": 0, - "sensor_class": "current", - "poller_type": "snmp", - "sensor_oid": ".1.3.6.1.4.1.1718.3.2.2.1.7.2.1", - "sensor_index": "infeedID.2.1", - "sensor_type": "sentry3", - "sensor_descr": "Infeed BA", - "group": null, - "sensor_divisor": 100, - "sensor_multiplier": 1, - "sensor_current": 5.02, - "sensor_limit": 7.53, - "sensor_limit_warn": null, - "sensor_limit_low": null, - "sensor_limit_low_warn": null, - "sensor_alert": 1, - "sensor_custom": "No", - "entPhysicalIndex": null, - "entPhysicalIndex_measured": null, - "sensor_prev": null, - "user_func": null, - "state_name": null - }, - { - "sensor_deleted": 0, - "sensor_class": "humidity", - "poller_type": "snmp", - "sensor_oid": ".1.3.6.1.4.1.1718.3.2.5.1.10.1.1", - "sensor_index": "tempHumidSensorHumidValue1.1", - "sensor_type": "sentry3", - "sensor_descr": "Removable Sensor A1", - "group": null, - "sensor_divisor": 1, - "sensor_multiplier": 1, - "sensor_current": 52, - "sensor_limit": 90, - "sensor_limit_warn": null, - "sensor_limit_low": 10, - "sensor_limit_low_warn": null, - "sensor_alert": 1, - "sensor_custom": "No", - "entPhysicalIndex": null, - "entPhysicalIndex_measured": null, - "sensor_prev": null, - "user_func": null, - "state_name": null - }, - { - "sensor_deleted": 0, - "sensor_class": "humidity", - "poller_type": "snmp", - "sensor_oid": ".1.3.6.1.4.1.1718.3.2.5.1.10.1.2", - "sensor_index": "tempHumidSensorHumidValue1.2", - "sensor_type": "sentry3", - "sensor_descr": "Removable Sensor A2", - "group": null, - "sensor_divisor": 1, - "sensor_multiplier": 1, - "sensor_current": 43, - "sensor_limit": 90, - "sensor_limit_warn": null, - "sensor_limit_low": 10, - "sensor_limit_low_warn": null, - "sensor_alert": 1, - "sensor_custom": "No", - "entPhysicalIndex": null, - "entPhysicalIndex_measured": null, - "sensor_prev": null, - "user_func": null, - "state_name": null - }, - { - "sensor_deleted": 0, - "sensor_class": "temperature", - "poller_type": "snmp", - "sensor_oid": ".1.3.6.1.4.1.1718.3.2.5.1.6.1.1", - "sensor_index": "tempHumidSensorTempValue1.1", - "sensor_type": "sentry3", - "sensor_descr": "Removable Sensor A1", - "group": null, - "sensor_divisor": 10, - "sensor_multiplier": 1, - "sensor_current": 20, - "sensor_limit": 45, - "sensor_limit_warn": null, - "sensor_limit_low": 5, - "sensor_limit_low_warn": null, - "sensor_alert": 1, - "sensor_custom": "No", - "entPhysicalIndex": null, - "entPhysicalIndex_measured": null, - "sensor_prev": null, - "user_func": "fahrenheit_to_celsius", - "state_name": null - }, - { - "sensor_deleted": 0, - "sensor_class": "temperature", - "poller_type": "snmp", - "sensor_oid": ".1.3.6.1.4.1.1718.3.2.5.1.6.1.2", - "sensor_index": "tempHumidSensorTempValue1.2", - "sensor_type": "sentry3", - "sensor_descr": "Removable Sensor A2", - "group": null, - "sensor_divisor": 10, - "sensor_multiplier": 1, - "sensor_current": 23.61, - "sensor_limit": 45, - "sensor_limit_warn": null, - "sensor_limit_low": 5, - "sensor_limit_low_warn": null, - "sensor_alert": 1, - "sensor_custom": "No", - "entPhysicalIndex": null, - "entPhysicalIndex_measured": null, - "sensor_prev": null, - "user_func": "fahrenheit_to_celsius", - "state_name": null - }, - { - "sensor_deleted": 0, - "sensor_class": "voltage", - "poller_type": "snmp", - "sensor_oid": ".1.3.6.1.4.1.1718.3.2.2.1.11.1.1.1", - "sensor_index": "1", - "sensor_type": "sentry3", - "sensor_descr": "Tower 1", - "group": null, - "sensor_divisor": 10, - "sensor_multiplier": 1, - "sensor_current": 0, - "sensor_limit": 240.695, - "sensor_limit_warn": null, - "sensor_limit_low": 177.905, - "sensor_limit_low_warn": null, - "sensor_alert": 1, - "sensor_custom": "No", - "entPhysicalIndex": null, - "entPhysicalIndex_measured": null, - "sensor_prev": 209.3, - "user_func": null, - "state_name": null - }, - { - "sensor_deleted": 0, - "sensor_class": "voltage", - "poller_type": "snmp", - "sensor_oid": ".1.3.6.1.4.1.1718.3.2.2.1.11.1.2.1", - "sensor_index": "2", - "sensor_type": "sentry3", - "sensor_descr": "Tower 2", - "group": null, - "sensor_divisor": 10, - "sensor_multiplier": 1, - "sensor_current": 0, - "sensor_limit": 236.785, - "sensor_limit_warn": null, - "sensor_limit_low": 175.015, - "sensor_limit_low_warn": null, - "sensor_alert": 1, - "sensor_custom": "No", - "entPhysicalIndex": null, - "entPhysicalIndex_measured": null, - "sensor_prev": 205.9, - "user_func": null, - "state_name": null - } - ], - "state_indexes": [] - } + "poller": "matches discovery" } }