mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
[pbn] dropped dbfetch from discovery/sensors (#13789)
This commit is contained in:
@@ -7,8 +7,9 @@
|
||||
* 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.
|
||||
*
|
||||
* @author Peca Nesovanovic <peca.nesovanovic@sattrakt.com>
|
||||
*/
|
||||
|
||||
echo 'PBN ';
|
||||
|
||||
$multiplier = 1;
|
||||
@@ -16,7 +17,8 @@ $divisor = 1000000;
|
||||
foreach ($pre_cache['pbn_oids'] as $index => $entry) {
|
||||
if (is_numeric($entry['curr']) && ($entry['curr'] !== '-65535')) {
|
||||
$oid = '.1.3.6.1.4.1.11606.10.9.63.1.7.1.6.' . $index;
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', [$index, $device['device_id']]) . ' Current';
|
||||
$interface = get_port_by_index_cache($device['device_id'], $index)['ifDescr'];
|
||||
$descr = $interface . ' Current';
|
||||
$limit_low = 8000 / $divisor;
|
||||
$warn_limit_low = 8500 / $divisor;
|
||||
$limit = 15000 / $divisor;
|
||||
|
@@ -7,8 +7,9 @@
|
||||
* 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.
|
||||
*
|
||||
* @author Peca Nesovanovic <peca.nesovanovic@sattrakt.com>
|
||||
*/
|
||||
|
||||
echo 'PBN ';
|
||||
|
||||
$multiplier = 1;
|
||||
@@ -16,7 +17,8 @@ $divisor = 1;
|
||||
foreach ($pre_cache['pbn_oids'] as $index => $entry) {
|
||||
if (is_numeric($entry['rxPower']) && ($entry['rxPower'] !== '-65535')) {
|
||||
$oid = '.1.3.6.1.4.1.11606.10.9.63.1.7.1.3.' . $index;
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', [$index, $device['device_id']]) . ' Rx Power';
|
||||
$interface = get_port_by_index_cache($device['device_id'], $index)['ifDescr'];
|
||||
$descr = $interface . ' Rx Power';
|
||||
$limit_low = -30 / $divisor;
|
||||
$warn_limit_low = -25 / $divisor;
|
||||
$limit = -2 / $divisor;
|
||||
@@ -29,7 +31,8 @@ foreach ($pre_cache['pbn_oids'] as $index => $entry) {
|
||||
|
||||
if (is_numeric($entry['txPower']) && ($entry['txPower'] !== '-65535')) {
|
||||
$oid = '.1.3.6.1.4.1.11606.10.9.63.1.7.1.2.' . $index;
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', [$index, $device['device_id']]) . ' Tx Power';
|
||||
$interface = get_port_by_index_cache($device['device_id'], $index)['ifDescr'];
|
||||
$descr = $interface . ' Tx Power';
|
||||
$limit_low = -30 / $divisor;
|
||||
$warn_limit_low = -25 / $divisor;
|
||||
$limit = -2 / $divisor;
|
||||
|
@@ -7,8 +7,9 @@
|
||||
* 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.
|
||||
*
|
||||
* @author Peca Nesovanovic <peca.nesovanovic@sattrakt.com>
|
||||
*/
|
||||
|
||||
echo 'PBN ';
|
||||
|
||||
$multiplier = 1;
|
||||
@@ -16,7 +17,8 @@ $divisor = 256;
|
||||
foreach ($pre_cache['pbn_oids'] as $index => $entry) {
|
||||
if (is_numeric($entry['temperature']) && ($entry['temperature'] !== '-65535')) {
|
||||
$oid = '.1.3.6.1.4.1.11606.10.9.63.1.7.1.4.' . $index;
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', [$index, $device['device_id']]) . ' Temperature';
|
||||
$interface = get_port_by_index_cache($device['device_id'], $index)['ifDescr'];
|
||||
$descr = $interface . ' Temperature';
|
||||
$limit_low = -256;
|
||||
$warn_limit_low = 10;
|
||||
$limit = 256;
|
||||
|
@@ -7,8 +7,9 @@
|
||||
* 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.
|
||||
*
|
||||
* @author Peca Nesovanovic <peca.nesovanovic@sattrakt.com>
|
||||
*/
|
||||
|
||||
echo 'PBN ';
|
||||
|
||||
$multiplier = 1;
|
||||
@@ -16,7 +17,8 @@ $divisor = 10000;
|
||||
foreach ($pre_cache['pbn_oids'] as $index => $entry) {
|
||||
if (is_numeric($entry['voltage']) && ($entry['voltage'] !== '-65535')) {
|
||||
$oid = '.1.3.6.1.4.1.11606.10.9.63.1.7.1.5.' . $index;
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', [$index, $device['device_id']]) . ' Voltage';
|
||||
$interface = get_port_by_index_cache($device['device_id'], $index)['ifDescr'];
|
||||
$descr = $interface . ' Voltage';
|
||||
$limit_low = 30000 / $divisor;
|
||||
$warn_limit_low = 32100 / $divisor;
|
||||
$limit = 35000 / $divisor;
|
||||
|
Reference in New Issue
Block a user