Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

119 lines
2.9 KiB
PHP
Raw Permalink Normal View History

2018-12-12 17:49:30 -05:00
<?php
/**
* ApexPlus.php
* Trango Systems Apex Plus Wireless Sensors for LibreNMS
* Author: Cory Hill (cory@metavrs.com)
*/
2020-09-21 14:54:51 +02:00
2018-12-12 17:49:30 -05:00
namespace LibreNMS\OS;
use LibreNMS\Device\WirelessSensor;
2020-09-18 08:12:07 -05:00
use LibreNMS\Interfaces\Discovery\Sensors\WirelessErrorRateDiscovery;
2018-12-12 17:49:30 -05:00
use LibreNMS\Interfaces\Discovery\Sensors\WirelessFrequencyDiscovery;
use LibreNMS\Interfaces\Discovery\Sensors\WirelessMseDiscovery;
use LibreNMS\Interfaces\Discovery\Sensors\WirelessRateDiscovery;
2020-09-18 08:12:07 -05:00
use LibreNMS\Interfaces\Discovery\Sensors\WirelessRssiDiscovery;
2018-12-12 17:49:30 -05:00
use LibreNMS\OS;
class ApexPlus extends OS implements
WirelessRssiDiscovery,
WirelessFrequencyDiscovery,
WirelessMseDiscovery,
WirelessRateDiscovery,
WirelessErrorRateDiscovery
{
public function discoverWirelessRssi()
{
// GIGA-PLUS-MIB::rfRSSIInt
$oid = '.1.3.6.1.4.1.5454.1.80.3.14.2.0';
$sensors = [];
$sensors[] = new WirelessSensor(
'rssi',
$this->getDeviceId(),
$oid,
'apex-plus',
1,
'RSSI'
);
2020-09-21 14:54:51 +02:00
2018-12-12 17:49:30 -05:00
return $sensors;
}
2020-09-21 14:54:51 +02:00
2018-12-12 17:49:30 -05:00
public function discoverWirelessFrequency()
{
// GIGA-PLUS-MIB::rfTxFrequencyInt, rfRxFrequencyInt
$txoid = '.1.3.6.1.4.1.5454.1.80.3.1.1.2.0';
$rxoid = '.1.3.6.1.4.1.5454.1.80.3.1.2.2.0';
2020-09-21 14:54:51 +02:00
2018-12-12 17:49:30 -05:00
return [
new WirelessSensor(
'frequency',
$this->getDeviceId(),
$txoid,
'apex-plus',
0,
'Tx Frequency'
),
new WirelessSensor(
'frequency',
$this->getDeviceId(),
$rxoid,
'apex-plus',
1,
'Rx Frequency'
),
];
}
2020-09-21 14:54:51 +02:00
2018-12-12 17:49:30 -05:00
public function discoverWirelessMse()
{
// GIGA-PLUS-MIB::modemMSEInt
$oid = '.1.3.6.1.4.1.5454.1.80.2.4.2.2.0';
$sensors = [];
$sensors[] = new WirelessSensor(
'mse',
$this->getDeviceId(),
$oid,
'apex-plus',
1,
'MSE'
);
2020-09-21 14:54:51 +02:00
2018-12-12 17:49:30 -05:00
return $sensors;
}
2020-09-21 14:54:51 +02:00
2018-12-12 17:49:30 -05:00
public function discoverWirelessRate()
{
// GIGA-PLUS-MIB::rfSpeedInt
$oid = '.1.3.6.1.4.1.5454.1.80.3.6.4.2.0';
$sensors = [];
$sensors[] = new WirelessSensor(
'rate',
$this->getDeviceId(),
$oid,
'apex-plus',
1,
'Rate'
);
2020-09-21 14:54:51 +02:00
2018-12-12 17:49:30 -05:00
return $sensors;
}
2020-09-21 14:54:51 +02:00
2018-12-12 17:49:30 -05:00
public function discoverWirelessErrorRate()
{
// GIGA-PLUS-MIB::modemBER
$oid = '.1.3.6.1.4.1.5454.1.80.2.4.1.1.0';
$sensors = [];
$sensors[] = new WirelessSensor(
'error-rate',
$this->getDeviceId(),
$oid,
'apex-plus',
1,
'BER'
);
2020-09-21 14:54:51 +02:00
2018-12-12 17:49:30 -05:00
return $sensors;
}
}