From ffffdd2663a939aeade7c47671b861443e83ab7c Mon Sep 17 00:00:00 2001 From: Janno Schouwenburg Date: Wed, 26 Jul 2023 01:04:35 +0200 Subject: [PATCH] Fix Timos SAR Cellular RSRP and RSSI sensors (#15163) * Fix Timos SAR Cellular RSRP and RSSI sensors * For some reason test data generated on dev machine double quoted backslashes, fixed --- LibreNMS/OS/Timos.php | 10 ++-------- tests/data/timos_hc.json | 28 ++++++++++++++-------------- 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/LibreNMS/OS/Timos.php b/LibreNMS/OS/Timos.php index 37b3a83a3b..0738e2cca3 100644 --- a/LibreNMS/OS/Timos.php +++ b/LibreNMS/OS/Timos.php @@ -912,10 +912,7 @@ class Timos extends OS implements MplsDiscovery, MplsPolling, WirelessPowerDisco '.1.3.6.1.4.1.6527.3.1.2.109.3.1.1.1.8.' . $index, 'timos', $index, - 'RSSI: ' . $carrier[$index]['ifName'], - null, - 1, - 10 + 'RSSI: ' . $carrier[$index]['ifName'] ); } @@ -935,10 +932,7 @@ class Timos extends OS implements MplsDiscovery, MplsPolling, WirelessPowerDisco '.1.3.6.1.4.1.6527.3.1.2.109.3.1.1.1.9.' . $index, 'timos', $index, - 'RSRP: ' . $carrier[$index]['ifName'], - null, - 1, - 10 + 'RSRP: ' . $carrier[$index]['ifName'] ); } diff --git a/tests/data/timos_hc.json b/tests/data/timos_hc.json index 238418fe69..dd96cd18ce 100644 --- a/tests/data/timos_hc.json +++ b/tests/data/timos_hc.json @@ -8018,10 +8018,10 @@ "sensor_index": "35684352", "sensor_type": "timos", "sensor_descr": "RSRP: 1/1/1", - "sensor_divisor": 10, + "sensor_divisor": 1, "sensor_multiplier": 1, "sensor_aggregator": "sum", - "sensor_current": -7, + "sensor_current": -70, "sensor_prev": null, "sensor_limit": null, "sensor_limit_warn": null, @@ -8040,7 +8040,7 @@ "sensor_index": "35717120", "sensor_type": "timos", "sensor_descr": "RSRP: 1/1/2", - "sensor_divisor": 10, + "sensor_divisor": 1, "sensor_multiplier": 1, "sensor_aggregator": "sum", "sensor_current": 0, @@ -8106,10 +8106,10 @@ "sensor_index": "35684352", "sensor_type": "timos", "sensor_descr": "RSSI: 1/1/1", - "sensor_divisor": 10, + "sensor_divisor": 1, "sensor_multiplier": 1, "sensor_aggregator": "sum", - "sensor_current": -5.1, + "sensor_current": -51, "sensor_prev": null, "sensor_limit": null, "sensor_limit_warn": null, @@ -8128,7 +8128,7 @@ "sensor_index": "35717120", "sensor_type": "timos", "sensor_descr": "RSSI: 1/1/2", - "sensor_divisor": 10, + "sensor_divisor": 1, "sensor_multiplier": 1, "sensor_aggregator": "sum", "sensor_current": 0, @@ -8242,11 +8242,11 @@ "sensor_index": "35684352", "sensor_type": "timos", "sensor_descr": "RSRP: 1/1/1", - "sensor_divisor": 10, + "sensor_divisor": 1, "sensor_multiplier": 1, "sensor_aggregator": "sum", - "sensor_current": -7, - "sensor_prev": -7, + "sensor_current": -70, + "sensor_prev": -70, "sensor_limit": null, "sensor_limit_warn": null, "sensor_limit_low": null, @@ -8264,7 +8264,7 @@ "sensor_index": "35717120", "sensor_type": "timos", "sensor_descr": "RSRP: 1/1/2", - "sensor_divisor": 10, + "sensor_divisor": 1, "sensor_multiplier": 1, "sensor_aggregator": "sum", "sensor_current": 0, @@ -8330,11 +8330,11 @@ "sensor_index": "35684352", "sensor_type": "timos", "sensor_descr": "RSSI: 1/1/1", - "sensor_divisor": 10, + "sensor_divisor": 1, "sensor_multiplier": 1, "sensor_aggregator": "sum", - "sensor_current": -5.1, - "sensor_prev": -5.1, + "sensor_current": -51, + "sensor_prev": -51, "sensor_limit": null, "sensor_limit_warn": null, "sensor_limit_low": null, @@ -8352,7 +8352,7 @@ "sensor_index": "35717120", "sensor_type": "timos", "sensor_descr": "RSSI: 1/1/2", - "sensor_divisor": 10, + "sensor_divisor": 1, "sensor_multiplier": 1, "sensor_aggregator": "sum", "sensor_current": 0,