AirFiber additional modulation rates, fix gpsSync (#9563)

* Add QAM1024 modulation for AirFiber
Move sensors to yaml

* Fix 0 index

* add additional data
make compatible with old sensors

* Fix whitespace
This commit is contained in:
Tony Murray
2018-12-28 20:11:24 -06:00
committed by GitHub
parent fd573bc879
commit 3dce7aa90c
6 changed files with 1963 additions and 227 deletions

View File

@@ -0,0 +1,52 @@
mib: UBNT-AirFIBER-MIB
modules:
processors:
data:
-
oid: ubntHostCpuLoad
num_oid: '.1.3.6.1.4.1.41112.1.4.8.3.{{ $index }}'
precision: 100
sensors:
state:
data:
-
oid: curTXModRate
num_oid: '.1.3.6.1.4.1.41112.1.3.2.1.2.{{ $index }}'
index: curTXModRate
descr: Tx Modulation Rate
state_name: curTXModRate
states:
- { value: 0, generic: 1, graph: 1, descr: 'qPSK-SISO-1-4x' }
- { value: 1, generic: 1, graph: 1, descr: 'qPSK-SISO-1x' }
- { value: 2, generic: 0, graph: 1, descr: 'qPSK-MIMO-2x' }
- { value: 3, generic: 0, graph: 1, descr: 'qAM8-MIMO-3x' }
- { value: 4, generic: 0, graph: 1, descr: 'qAM16-MIMO-4x' }
- { value: 5, generic: 0, graph: 1, descr: 'qAM32-MIMO-5x' }
- { value: 6, generic: 0, graph: 1, descr: 'qAM64-MIMO-6x' }
- { value: 7, generic: 0, graph: 1, descr: 'qAM128-MIMO-7x' }
- { value: 8, generic: 0, graph: 1, descr: 'qAM256-MIMO-8x' }
- { value: 9, generic: 0, graph: 1, descr: 'qAM256-MIMO-9x' }
- { value: 10, generic: 0, graph: 1, descr: 'qAM1024-MIMO-10x' }
- { value: 11, generic: 0, graph: 1, descr: 'qAM2048-MIMO-11x' }
-
oid: gpsSync
num_oid: '.1.3.6.1.4.1.41112.1.3.1.1.8.{{ $index }}'
index: gpsSync
descr: GPS Sync
state_name: gpsSync
states:
- { value: 1, generic: 1, graph: 0, descr: off }
- { value: 2, generic: 0, graph: 0, descr: on }
temperature:
data:
-
oid: radio0TempC
num_oid: '.1.3.6.1.4.1.41112.1.3.2.1.8.{{ $index }}'
index: 0
descr: Radio 0 Temp
-
oid: radio1TempC
num_oid: '.1.3.6.1.4.1.41112.1.3.2.1.10.{{ $index }}'
index: 1
descr: Radio 1 Temp

View File

@@ -1039,7 +1039,7 @@ function discovery_process(&$valid, $device, $sensor_type, $pre_cache)
$value = ($value / $divisor) * $multiplier;
}
$uindex = str_replace('{{ $index }}', $index, $data['index'] ?: $index);
$uindex = str_replace('{{ $index }}', $index, isset($data['index']) ? $data['index'] : $index);
discover_sensor($valid['sensor'], $sensor_type, $device, $oid, $uindex, $sensor_name, $descr, $divisor, $multiplier, $low_limit, $low_warn_limit, $warn_limit, $high_limit, $value, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured, $user_function);
if ($sensor_type === 'state') {

View File

@@ -1,118 +0,0 @@
<?php
/**
* airos-af.inc.php
*
* Ubiquiti AirFiber States
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package LibreNMS
* @link http://librenms.org
* @copyright 2017 Tony Murray
* @author Tony Murray <murraytony@gmail.com>
*/
$mod = snmp_get($device, 'curTXModRate.1', "-Ovqe", "UBNT-AirFIBER-MIB");
if (is_numeric($mod)) {
$state_name = 'curTXModRate';
$index = $state_name;
$state_index_id = create_state_index($state_name);
if ($state_index_id !== null) {
$states = array(
array($state_index_id, 'qPSK-SISO-1-4x', 1, 0, 1),
array($state_index_id, 'qPSK-SISO-1x', 1, 1, 1),
array($state_index_id, 'qPSK-MIMO-2x', 1, 2, 0),
array($state_index_id, 'qAM16-MIMO-4x', 1, 4, 0),
array($state_index_id, 'qAM64-MIMO-6x', 1, 6, 0),
array($state_index_id, 'qAM256-MIMO-8x', 1, 8, 0),
);
foreach ($states as $value) {
$insert = array(
'state_index_id' => $value[0],
'state_descr' => $value[1],
'state_draw_graph' => $value[2],
'state_value' => $value[3],
'state_generic_value' => $value[4]
);
dbInsert($insert, 'state_translations');
}
}
discover_sensor(
$valid['sensor'],
'state',
$device,
'.1.3.6.1.4.1.41112.1.3.2.1.2.1',
$index,
$state_name,
'Tx Modulation Rate',
1,
1,
null,
null,
null,
null,
$mod
);
create_sensor_to_state_index($device, $state_name, $index);
}
$gps = snmp_get($device, 'gpsSync.1', "-Ovqe", "UBNT-AirFIBER-MIB");
if (is_numeric($gps)) {
$state_name = 'gpsSync';
$index = $state_name;
$state_index_id = create_state_index($state_name);
if ($state_index_id !== null) {
$states = array(
array($state_index_id, 'off', 1, 1, 1),
array($state_index_id, 'on', 1, 4, 0),
);
foreach ($states as $value) {
$insert = array(
'state_index_id' => $value[0],
'state_descr' => $value[1],
'state_draw_graph' => $value[2],
'state_value' => $value[3],
'state_generic_value' => $value[4]
);
dbInsert($insert, 'state_translations');
}
}
discover_sensor(
$valid['sensor'],
'state',
$device,
'.1.3.6.1.4.1.41112.1.3.1.1.8.1',
$index,
$state_name,
'GPS Sync',
1,
1,
null,
null,
null,
null,
$mod
);
create_sensor_to_state_index($device, $state_name, $index);
}
unset($mod, $gps, $state_name, $index, $state_index_id, $states, $descr);

View File

@@ -1,66 +0,0 @@
<?php
/**
* airos-af.inc.php
*
* Ubiquiti AirFiber Temperatures
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package LibreNMS
* @link http://librenms.org
* @copyright 2017 Tony Murray
* @author Tony Murray <murraytony@gmail.com>
*/
$temps = snmp_get_multi($device, 'radio0TempC.1 radio1TempC.1', '-OQUs', 'UBNT-AirFIBER-MIB');
if (isset($temps[1]['radio0TempC'])) {
discover_sensor(
$valid['sensor'],
'temperature',
$device,
'.1.3.6.1.4.1.41112.1.3.2.1.8.1',
0,
'airos-af',
'Radio 0 Temp',
1,
1,
null,
null,
null,
null,
$temps[1]['radio0TempC']
);
}
if (isset($temps[1]['radio1TempC'])) {
discover_sensor(
$valid['sensor'],
'temperature',
$device,
'.1.3.6.1.4.1.41112.1.3.2.1.10.1',
1,
'airos-af',
'Radio 1 Temp',
1,
1,
null,
null,
null,
null,
$temps[1]['radio1TempC']
);
}
unset($temps);

View File

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +1,204 @@
1.3.6.1.2.1.1.1.0|4|Linux 2.6.33 #1 Mon Nov 30 14:15:06 CST 2015 armv5tejl
1.3.6.1.2.1.1.1.0|4|Linux 2.6.33 #1 Fri Jan 26 16:39:18 CST 2018 armv5tejl
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.10002.1
1.3.6.1.2.1.1.3.0|67|1378269700
1.3.6.1.2.1.1.3.0|67|7474900
1.3.6.1.2.1.1.4.0|4|<private>
1.3.6.1.2.1.1.5.0|4|<private>
1.3.6.1.2.1.1.6.0|4|<private>
1.3.6.1.4.1.41112.1.3.1.1.5.1|2|5835
1.3.6.1.4.1.41112.1.3.1.1.6.1|2|5835
1.3.6.1.4.1.41112.1.3.1.1.9.1|2|47
1.3.6.1.4.1.41112.1.3.2.1.4.1|2|12095
1.3.6.1.4.1.41112.1.3.2.1.5.1|2|201251840
1.3.6.1.4.1.41112.1.3.2.1.6.1|2|58612480
1.3.6.1.4.1.41112.1.3.2.1.11.1|2|-52
1.3.6.1.4.1.41112.1.3.2.1.14.1|2|-52
1.3.6.1.4.1.41112.1.3.2.1.40.1|4|v2.2
1.3.6.1.2.1.2.2.1.1.1|2|1
1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
1.3.6.1.2.1.2.2.1.12.1|65|0
1.3.6.1.2.1.2.2.1.12.2|65|0
1.3.6.1.2.1.2.2.1.12.3|65|0
1.3.6.1.2.1.2.2.1.12.4|65|0
1.3.6.1.2.1.2.2.1.12.5|65|0
1.3.6.1.2.1.2.2.1.12.6|65|0
1.3.6.1.2.1.2.2.1.12.7|65|41
1.3.6.1.2.1.2.2.1.13.1|65|0
1.3.6.1.2.1.2.2.1.13.2|65|0
1.3.6.1.2.1.2.2.1.13.3|65|0
1.3.6.1.2.1.2.2.1.13.4|65|0
1.3.6.1.2.1.2.2.1.13.5|65|0
1.3.6.1.2.1.2.2.1.13.6|65|0
1.3.6.1.2.1.2.2.1.13.7|65|0
1.3.6.1.2.1.2.2.1.14.1|65|0
1.3.6.1.2.1.2.2.1.14.2|65|0
1.3.6.1.2.1.2.2.1.14.3|65|0
1.3.6.1.2.1.2.2.1.14.4|65|0
1.3.6.1.2.1.2.2.1.14.5|65|0
1.3.6.1.2.1.2.2.1.14.6|65|0
1.3.6.1.2.1.2.2.1.14.7|65|0
1.3.6.1.2.1.2.2.1.15.1|65|0
1.3.6.1.2.1.2.2.1.15.2|65|0
1.3.6.1.2.1.2.2.1.15.3|65|0
1.3.6.1.2.1.2.2.1.15.4|65|0
1.3.6.1.2.1.2.2.1.15.5|65|0
1.3.6.1.2.1.2.2.1.15.6|65|0
1.3.6.1.2.1.2.2.1.15.7|65|0
1.3.6.1.2.1.2.2.1.16.1|65|70280
1.3.6.1.2.1.2.2.1.16.2|65|0
1.3.6.1.2.1.2.2.1.16.3|65|0
1.3.6.1.2.1.2.2.1.16.4|65|123465350
1.3.6.1.2.1.2.2.1.16.5|65|0
1.3.6.1.2.1.2.2.1.16.6|65|56371853
1.3.6.1.2.1.2.2.1.16.7|65|56067513
1.3.6.1.2.1.2.2.1.17.1|65|806
1.3.6.1.2.1.2.2.1.17.2|65|0
1.3.6.1.2.1.2.2.1.17.3|65|0
1.3.6.1.2.1.2.2.1.17.4|65|190211
1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|6054
1.3.6.1.2.1.11.2.0|65|6041
1.3.6.1.2.1.11.3.0|65|12
1.3.6.1.2.1.11.4.0|65|0
1.3.6.1.2.1.11.5.0|65|0
1.3.6.1.2.1.11.6.0|65|0
1.3.6.1.2.1.11.8.0|65|0
1.3.6.1.2.1.11.9.0|65|0
1.3.6.1.2.1.11.10.0|65|0
1.3.6.1.2.1.11.11.0|65|0
1.3.6.1.2.1.11.12.0|65|0
1.3.6.1.2.1.11.13.0|65|524
1.3.6.1.2.1.11.14.0|65|0
1.3.6.1.2.1.11.15.0|65|840
1.3.6.1.2.1.11.16.0|65|5283
1.3.6.1.2.1.11.17.0|65|0
1.3.6.1.2.1.11.18.0|65|0
1.3.6.1.2.1.11.19.0|65|0
1.3.6.1.2.1.11.20.0|65|0
1.3.6.1.2.1.11.21.0|65|1305
1.3.6.1.2.1.11.22.0|65|0
1.3.6.1.2.1.11.24.0|65|0
1.3.6.1.2.1.11.25.0|65|0
1.3.6.1.2.1.11.26.0|65|0
1.3.6.1.2.1.11.27.0|65|0
1.3.6.1.2.1.11.28.0|65|6123
1.3.6.1.2.1.11.29.0|65|0
1.3.6.1.2.1.11.30.0|2|2
1.3.6.1.2.1.11.31.0|65|0
1.3.6.1.2.1.11.32.0|65|0
1.3.6.1.4.1.10002.1.1.1.1.1.0|66|62064
1.3.6.1.4.1.41112.1.3.1.1.5.1|2|11485000
1.3.6.1.4.1.41112.1.3.1.1.6.1|2|10995000
1.3.6.1.4.1.41112.1.3.1.1.8.1|2|1
1.3.6.1.4.1.41112.1.3.1.1.9.1|2|58
1.3.6.1.4.1.41112.1.3.2.1.2.1|2|10
1.3.6.1.4.1.41112.1.3.2.1.4.1|2|11450
1.3.6.1.4.1.41112.1.3.2.1.5.1|2|686400640
1.3.6.1.4.1.41112.1.3.2.1.6.1|2|684856960
1.3.6.1.4.1.41112.1.3.2.1.8.1|2|22
1.3.6.1.4.1.41112.1.3.2.1.10.1|2|22
1.3.6.1.4.1.41112.1.3.2.1.11.1|2|-42
1.3.6.1.4.1.41112.1.3.2.1.14.1|2|-42
1.3.6.1.4.1.41112.1.3.2.1.40.1|4|v4.0.3