2016-03-22 09:32:26 -04:00
|
|
|
<?php
|
|
|
|
/*
|
|
|
|
* LibreNMS
|
|
|
|
*
|
|
|
|
* 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. Please see LICENSE.txt at the top level of
|
|
|
|
* the source code distribution for details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
$transmitPower = snmp_get($device, "transmitPower.0", "-Ovqn", "CAMBIUM-PTP650-MIB");
|
|
|
|
if (is_numeric($transmitPower)) {
|
2016-07-07 01:33:43 -05:00
|
|
|
$rrd_def = 'DS:transmitPower:GAUGE:600:0:100';
|
2016-03-22 09:32:26 -04:00
|
|
|
$fields = array(
|
2016-07-07 01:33:43 -05:00
|
|
|
'transmitPower' => $transmitPower / 10,
|
2016-03-22 09:32:26 -04:00
|
|
|
);
|
2016-07-07 01:33:43 -05:00
|
|
|
$tags = compact('rrd_def');
|
|
|
|
data_update($device, 'cambium-650-transmitPower', $tags, $fields);
|
2016-08-28 12:32:58 -05:00
|
|
|
$graphs['cambium_650_transmitPower'] = true;
|
2016-03-22 09:32:26 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
$rawReceivePower = snmp_get($device, "rawReceivePower.0", "-Ovqn", "CAMBIUM-PTP650-MIB");
|
|
|
|
if (is_numeric($rawReceivePower)) {
|
2016-07-07 01:33:43 -05:00
|
|
|
$rrd_def = 'DS:rawReceivePower:GAUGE:600:-100:0';
|
2016-03-22 09:32:26 -04:00
|
|
|
$fields = array(
|
2016-07-07 01:33:43 -05:00
|
|
|
'rawReceivePower' => $rawReceivePower / 10,
|
2016-03-22 09:32:26 -04:00
|
|
|
);
|
2016-07-07 01:33:43 -05:00
|
|
|
$tags = compact('rrd_def');
|
|
|
|
data_update($device, 'cambium-650-rawReceivePower', $tags, $fields);
|
2016-08-28 12:32:58 -05:00
|
|
|
$graphs['cambium_650_rawReceivePower'] = true;
|
2016-03-22 09:32:26 -04:00
|
|
|
}
|
|
|
|
|
2016-07-07 01:33:43 -05:00
|
|
|
|
2016-03-22 09:32:26 -04:00
|
|
|
$txModulation = snmp_get($device, ".1.3.6.1.4.1.17713.7.12.15.0", "-Ovqn", "");
|
|
|
|
$rxModulation = snmp_get($device, ".1.3.6.1.4.1.17713.7.12.14.0", "-Ovqn", "");
|
|
|
|
if (is_numeric($txModulation) && is_numeric($rxModulation)) {
|
2016-07-07 01:33:43 -05:00
|
|
|
$rrd_def = array(
|
|
|
|
'DS:txModulation:GAUGE:600:0:24',
|
|
|
|
'DS:rxModulation:GAUGE:600:0:24'
|
|
|
|
);
|
2016-03-22 09:32:26 -04:00
|
|
|
$fields = array(
|
|
|
|
'txModuation' => $txModulation,
|
|
|
|
'rxModulation' => $rxModulation,
|
|
|
|
);
|
2016-07-07 01:33:43 -05:00
|
|
|
$tags = compact('rrd_def');
|
|
|
|
data_update($device, 'cambium-650-modulationMode', $tags, $fields);
|
2016-08-28 12:32:58 -05:00
|
|
|
$graphs['cambium_650_modulationMode'] = true;
|
2016-03-22 09:32:26 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
$receiveDataRate = snmp_get($device, "receiveDataRate.0", "-Ovqn", "CAMBIUM-PTP650-MIB");
|
|
|
|
$transmitDataRate = snmp_get($device, "transmitDataRate.0", "-Ovqn", "CAMBIUM-PTP650-MIB");
|
|
|
|
$aggregateDataRate = snmp_get($device, "aggregateDataRate.0", "-Ovqn", "CAMBIUM-PTP650-MIB");
|
|
|
|
if (is_numeric($receiveDataRate) && is_numeric($transmitDataRate) && is_numeric($aggregateDataRate)) {
|
2016-07-07 01:33:43 -05:00
|
|
|
$rrd_def = array(
|
|
|
|
'DS:receiveDataRate:GAUGE:600:0:10000',
|
|
|
|
'DS:transmitDataRate:GAUGE:600:0:10000',
|
|
|
|
'DS:aggregateDataRate:GAUGE:600:0:10000'
|
|
|
|
);
|
2016-03-22 09:32:26 -04:00
|
|
|
$fields = array(
|
2016-07-07 01:33:43 -05:00
|
|
|
'receiveDataRate' => $receiveDataRate / 100,
|
|
|
|
'transmitDataRate' => $transmitDataRate / 100,
|
|
|
|
'aggregateDataRate' => $aggregateDataRate / 100,
|
2016-03-22 09:32:26 -04:00
|
|
|
);
|
2016-07-07 01:33:43 -05:00
|
|
|
$tags = compact('rrd_def');
|
|
|
|
data_update($device, 'cambium-650-dataRate', $tags, $fields);
|
2016-08-28 12:32:58 -05:00
|
|
|
$graphs['cambium_650_dataRate'] = true;
|
2016-03-22 09:32:26 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
$ssr = snmp_get($device, "signalStrengthRatio.0", "-Ovqn", "CAMBIUM-PTP650-MIB");
|
|
|
|
if (is_numeric($ssr)) {
|
2016-07-07 01:33:43 -05:00
|
|
|
$rrd_def = 'DS:ssr:GAUGE:600:-150:150';
|
2016-03-22 09:32:26 -04:00
|
|
|
$fields = array(
|
|
|
|
'ssr' => $ssr,
|
|
|
|
);
|
2016-07-07 01:33:43 -05:00
|
|
|
$tags = compact('rrd_def');
|
|
|
|
data_update($device, 'cambium-650-ssr', $tags, $fields);
|
2016-08-28 12:32:58 -05:00
|
|
|
$graphs['cambium_650_ssr'] = true;
|
2016-03-22 09:32:26 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
$gps = snmp_get($device, "tDDSynchronizationStatus.0", "-Ovqn", "CAMBIUM-PTP650-MIB");
|
|
|
|
if ($gps == 'locked') {
|
|
|
|
$gps = 0;
|
2016-08-28 12:32:58 -05:00
|
|
|
} elseif ($gps == 'holdover') {
|
2016-03-22 09:32:26 -04:00
|
|
|
$gps = 1;
|
2016-08-28 12:32:58 -05:00
|
|
|
} elseif ($gps == 'holdoverNoGPSSyncIn') {
|
|
|
|
$gps = 2;
|
|
|
|
} elseif ($gps == 'notSynchronized') {
|
|
|
|
$gps = 3;
|
|
|
|
} elseif ($gps == 'notSynchronizedNoGPSSyncIn') {
|
|
|
|
$gps = 4;
|
|
|
|
} elseif ($gps == 'pTPSYNCNotConnected') {
|
|
|
|
$gps = 5;
|
|
|
|
} elseif ($gps == 'initialising') {
|
|
|
|
$gps = 6;
|
|
|
|
} elseif ($gps == 'clusterTimingMaster') {
|
|
|
|
$gps = 7;
|
|
|
|
} elseif ($gps == 'acquiringLock') {
|
|
|
|
$gps = 8;
|
|
|
|
} elseif ($gps == 'inactive') {
|
|
|
|
$gps = 9;
|
|
|
|
}
|
2016-03-22 09:32:26 -04:00
|
|
|
if (is_numeric($gps)) {
|
2016-07-07 01:33:43 -05:00
|
|
|
$rrd_def = 'DS:gps:GAUGE:600:0:10';
|
2016-03-22 09:32:26 -04:00
|
|
|
$fields = array(
|
2016-08-28 12:32:58 -05:00
|
|
|
'gps' => $gps,
|
|
|
|
);
|
|
|
|
$tags = compact('rrd_def');
|
|
|
|
data_update($device, 'cambium-650-gps', $tags, $fields);
|
|
|
|
$graphs['cambium_650_gps'] = true;
|
|
|
|
}
|