mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
DO NOT DELETE THIS TEXT #### Please note > Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting. - [ ] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/) #### Testers If you would like to test this pull request then please run: `./scripts/github-apply <pr_id>`, i.e `./scripts/github-apply 5926`
70 lines
2.0 KiB
PHP
70 lines
2.0 KiB
PHP
<?php
|
|
|
|
namespace LibreNMS\OS;
|
|
|
|
use LibreNMS\Device\WirelessSensor;
|
|
use LibreNMS\Interfaces\Discovery\Sensors\WirelessRssiDiscovery;
|
|
use LibreNMS\Interfaces\Discovery\Sensors\WirelessFrequencyDiscovery;
|
|
use LibreNMS\Interfaces\Discovery\Sensors\WirelessMseDiscovery;
|
|
use LibreNMS\OS;
|
|
|
|
class SmOs extends OS implements
|
|
WirelessRssiDiscovery,
|
|
WirelessFrequencyDiscovery,
|
|
WirelessMseDiscovery
|
|
{
|
|
public function discoverWirelessRssi()
|
|
{
|
|
$oids = snmpwalk_cache_oid($this->getDevice(), 'radioPrx', array(), 'SIAE-RADIO-SYSTEM-MIB');
|
|
$sensors = array();
|
|
|
|
foreach ($oids as $index => $entry) {
|
|
$sensors[] = new WirelessSensor(
|
|
'rssi',
|
|
$this->getDeviceId(),
|
|
'.1.3.6.1.4.1.3373.1103.80.12.1.3.' . $index,
|
|
'sm-os',
|
|
$index,
|
|
'RSSI Radio ' . $index
|
|
);
|
|
}
|
|
return $sensors;
|
|
}
|
|
|
|
public function discoverWirelessFrequency()
|
|
{
|
|
$oids = snmpwalk_cache_oid($this->getDevice(), 'radioTxFrequency', array(), 'SIAE-RADIO-SYSTEM-MIB');
|
|
$sensors = array();
|
|
|
|
foreach ($oids as $index => $entry) {
|
|
$sensors[] = new WirelessSensor(
|
|
'frequency',
|
|
$this->getDeviceId(),
|
|
'.1.3.6.1.4.1.3373.1103.80.9.1.4.' . $index,
|
|
'sm-os',
|
|
$index,
|
|
'Tx Frequency ' . $index
|
|
);
|
|
}
|
|
return $sensors;
|
|
}
|
|
|
|
public function discoverWirelessMse()
|
|
{
|
|
$oids = snmpwalk_cache_oid($this->getDevice(), 'radioNormalizedMse', array(), 'SIAE-RADIO-SYSTEM-MIB');
|
|
$sensors = array();
|
|
|
|
foreach ($oids as $index => $entry) {
|
|
$sensors[] = new WirelessSensor(
|
|
'mse',
|
|
$this->getDeviceId(),
|
|
'.1.3.6.1.4.1.3373.1103.80.12.1.5.' . $index,
|
|
'sm-os',
|
|
$index,
|
|
'MSE Radio ' . $index
|
|
);
|
|
}
|
|
return $sensors;
|
|
}
|
|
}
|