awplus sensor fixes (#16348)

* awplus sensor fixes

* Update test data
This commit is contained in:
Tony Murray 2024-09-02 22:26:02 -05:00 committed by GitHub
parent 64c0d6ff7f
commit d8097b0c21
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 42 additions and 42 deletions

View File

@ -23,12 +23,12 @@ if ($pre_cache['awplus-sfpddm']) {
'atPluggableDiagTxBiasStatusReading',
'SFP:' . $descr,
$divisor,
null, // $multiplier,
1,
$low_limit,
$low_warn_limit,
$high_warn_limit,
$high_limit,
$value,
$data['atPluggableDiagTxBiasStatusReading'] / $divisor,
'snmp',
$ifIndex,
null,

View File

@ -23,12 +23,12 @@ if ($pre_cache['awplus-sfpddm']) {
'atPluggableDiagTxPowerStatusReading',
'SFP:' . $descr,
$divisor,
null, // $multiplier,
1,
$low_limit,
$low_warn_limit,
$high_warn_limit,
$high_limit,
$value,
$data['atPluggableDiagTxPowerStatusReading'] / $divisor,
'snmp',
$ifIndex,
null,
@ -59,12 +59,12 @@ if ($pre_cache['awplus-sfpddm']) {
'atPluggableDiagRxPowerStatusReading',
'SFP:' . $descr,
$divisor,
null, // $multiplier,
1,
$low_limit,
$low_warn_limit,
$high_warn_limit,
$high_limit,
$value,
$data['atPluggableDiagRxPowerStatusReading'] / $divisor,
'snmp',
$ifIndex,
null,

View File

@ -23,12 +23,12 @@ if ($pre_cache['awplus-sfpddm']) {
'atPluggableDiagTempStatusReading',
'SFP:' . $descr,
$divisor,
null, // $multiplier,
1,
$low_limit,
$low_warn_limit,
$high_warn_limit,
$high_limit,
$value,
$data['atPluggableDiagTempStatusReading'] / $divisor,
'snmp',
$ifIndex,
null,

View File

@ -23,12 +23,12 @@ if ($pre_cache['awplus-sfpddm']) {
'atPluggableDiagVccStatusReading',
'SFP:' . $descr,
$divisor,
null, // $multiplier,
1,
$low_limit,
$low_warn_limit,
$high_warn_limit,
$high_limit,
$value,
$data['atPluggableDiagVccStatusReading'] / $divisor,
'snmp',
$ifIndex,
null,

View File

@ -13,11 +13,11 @@
use LibreNMS\RRD\RrdDefinition;
$tmp_module = 'ntp';
$type = 'ntp';
$component = new LibreNMS\Component();
$options = [];
$options['filter']['type'] = ['=', $tmp_module];
$options['filter']['type'] = ['=', $type];
$options['filter']['disabled'] = ['=', 0];
$options['filter']['ignore'] = ['=', 0];
@ -60,7 +60,7 @@ if ($components) {
$rrd['delay'] = str_replace(' milliseconds', '', $rrd['delay']);
$rrd['delay'] = $rrd['delay'] / 1000; // Convert to seconds
$rrd['dispersion'] = $atNtpAssociationEntry[$array['UID']]['atNtpAssociationDisp'];
$tags = compact('ntp', 'rrd_name', 'rrd_def', 'peer');
$tags = compact('type', 'rrd_name', 'rrd_def', 'peer');
data_update($device, 'ntp', $tags, $rrd);
// Let's print some debugging info.
@ -81,4 +81,4 @@ if ($components) {
} // end if count components
// Clean-up after yourself!
unset($type, $components, $component, $options, $tmp_module);
unset($type, $components, $component, $options, $type);

View File

@ -12,8 +12,8 @@
"sensor_descr": "SFP:",
"group": "SFP",
"sensor_divisor": 1000000,
"sensor_multiplier": 0,
"sensor_current": 0,
"sensor_multiplier": 1,
"sensor_current": 0.041124,
"sensor_limit": null,
"sensor_limit_warn": null,
"sensor_limit_low": null,
@ -37,8 +37,8 @@
"sensor_descr": "SFP:",
"group": "RX Power",
"sensor_divisor": 10000,
"sensor_multiplier": 0,
"sensor_current": 0,
"sensor_multiplier": 1,
"sensor_current": 0.0092,
"sensor_limit": null,
"sensor_limit_warn": null,
"sensor_limit_low": null,
@ -62,8 +62,8 @@
"sensor_descr": "SFP:",
"group": "TX Power",
"sensor_divisor": 10000,
"sensor_multiplier": 0,
"sensor_current": 0,
"sensor_multiplier": 1,
"sensor_current": 0.5738,
"sensor_limit": null,
"sensor_limit_warn": null,
"sensor_limit_low": null,
@ -312,11 +312,11 @@
"sensor_descr": "SFP:",
"group": "SFP Temperature",
"sensor_divisor": 1000,
"sensor_multiplier": 0,
"sensor_current": 0,
"sensor_limit": 20,
"sensor_multiplier": 1,
"sensor_current": 57.984,
"sensor_limit": 77.984,
"sensor_limit_warn": null,
"sensor_limit_low": -10,
"sensor_limit_low": 47.984,
"sensor_limit_low_warn": null,
"sensor_alert": 1,
"sensor_custom": "No",
@ -387,11 +387,11 @@
"sensor_descr": "SFP:",
"group": "SFP",
"sensor_divisor": 10000,
"sensor_multiplier": 0,
"sensor_current": 0,
"sensor_limit": 0,
"sensor_multiplier": 1,
"sensor_current": 3.3065,
"sensor_limit": 3.802475,
"sensor_limit_warn": null,
"sensor_limit_low": 0,
"sensor_limit_low": 2.810525,
"sensor_limit_low_warn": null,
"sensor_alert": 1,
"sensor_custom": "No",
@ -606,7 +606,7 @@
"sensor_descr": "SFP:",
"group": "SFP",
"sensor_divisor": 1000000,
"sensor_multiplier": 0,
"sensor_multiplier": 1,
"sensor_current": 0.041124,
"sensor_limit": null,
"sensor_limit_warn": null,
@ -616,7 +616,7 @@
"sensor_custom": "No",
"entPhysicalIndex": "5028",
"entPhysicalIndex_measured": null,
"sensor_prev": 0,
"sensor_prev": null,
"user_func": null,
"rrd_type": "GAUGE",
"state_name": null
@ -631,7 +631,7 @@
"sensor_descr": "SFP:",
"group": "RX Power",
"sensor_divisor": 10000,
"sensor_multiplier": 0,
"sensor_multiplier": 1,
"sensor_current": -20.362121726544,
"sensor_limit": null,
"sensor_limit_warn": null,
@ -641,7 +641,7 @@
"sensor_custom": "No",
"entPhysicalIndex": "5028",
"entPhysicalIndex_measured": null,
"sensor_prev": 0,
"sensor_prev": 0.0092,
"user_func": "mw_to_dbm",
"rrd_type": "GAUGE",
"state_name": null
@ -656,7 +656,7 @@
"sensor_descr": "SFP:",
"group": "TX Power",
"sensor_divisor": 10000,
"sensor_multiplier": 0,
"sensor_multiplier": 1,
"sensor_current": -2.4123945609002,
"sensor_limit": null,
"sensor_limit_warn": null,
@ -666,7 +666,7 @@
"sensor_custom": "No",
"entPhysicalIndex": "5028",
"entPhysicalIndex_measured": null,
"sensor_prev": 0,
"sensor_prev": 0.5738,
"user_func": "mw_to_dbm",
"rrd_type": "GAUGE",
"state_name": null
@ -906,17 +906,17 @@
"sensor_descr": "SFP:",
"group": "SFP Temperature",
"sensor_divisor": 1000,
"sensor_multiplier": 0,
"sensor_multiplier": 1,
"sensor_current": 57.984,
"sensor_limit": 20,
"sensor_limit": 77.984,
"sensor_limit_warn": null,
"sensor_limit_low": -10,
"sensor_limit_low": 47.984,
"sensor_limit_low_warn": null,
"sensor_alert": 1,
"sensor_custom": "No",
"entPhysicalIndex": "5028",
"entPhysicalIndex_measured": null,
"sensor_prev": 0,
"sensor_prev": null,
"user_func": null,
"rrd_type": "GAUGE",
"state_name": null
@ -981,17 +981,17 @@
"sensor_descr": "SFP:",
"group": "SFP",
"sensor_divisor": 10000,
"sensor_multiplier": 0,
"sensor_multiplier": 1,
"sensor_current": 3.3065,
"sensor_limit": 0,
"sensor_limit": 3.802475,
"sensor_limit_warn": null,
"sensor_limit_low": 0,
"sensor_limit_low": 2.810525,
"sensor_limit_low_warn": null,
"sensor_alert": 1,
"sensor_custom": "No",
"entPhysicalIndex": "5028",
"entPhysicalIndex_measured": null,
"sensor_prev": 0,
"sensor_prev": null,
"user_func": null,
"rrd_type": "GAUGE",
"state_name": null