librenms-librenms/LibreNMS/OS/HarmonyEnhanced.php
djamp42 b39984994b Add Device Dragonwave Harmony Enhanced (#9499)
* Add Dragonwave Harmony Enhanced MC Device

* Remove single quote from null and 10 divisor

* Update and rename HarmonyEnhancedMc.php to HarmonyEnhanced.php

* Rename harmony-enhanced-mc.yaml to harmony-enhanced.yaml

* Update and rename harmony-enhanced-mc.yaml to harmony-enhanced.yaml

* Rename harmony-enhanced-mc.inc.php to harmony-enhanced.inc.php

* Rename harmony-enhanced-mc.snmprec to harmony-enhanced.snmprec

* Update HarmonyEnhanced.php

* Update HarmonyEnhanced.php

* Update HarmonyEnhanced.php

* Update HarmonyEnhanced.php

* More Code Climate Fixes

* Create harmony-enhanced.json
2018-12-05 12:27:08 -06:00

91 lines
2.9 KiB
PHP

<?php
namespace LibreNMS\OS;
use LibreNMS\Interfaces\Discovery\Sensors\WirelessRssiDiscovery;
use LibreNMS\Interfaces\Discovery\Sensors\WirelessSnrDiscovery;
use LibreNMS\Interfaces\Discovery\Sensors\WirelessPowerDiscovery;
use LibreNMS\Interfaces\Discovery\Sensors\WirelessErrorsDiscovery;
use LibreNMS\Device\WirelessSensor;
use LibreNMS\OS;
class HarmonyEnhanced extends OS implements WirelessRssiDiscovery, WirelessSnrDiscovery, WirelessPowerDiscovery, WirelessErrorsDiscovery
{
public function discoverWirelessRssi()
{
$oids = snmpwalk_cache_oid($this->getDevice(), 'mwrEmcRadioRSL', array(), 'MWR-RADIO-MC-MIB', null, '-Ob');
$sensors = array();
foreach ($oids as $index => $entry) {
$sensors[] = new WirelessSensor(
'rssi',
$this->getDeviceId(),
'.1.3.6.1.4.1.7262.4.5.12.203.1.1.5.' . $index,
'harmony_enhanced',
$index,
'RSL Radio ' .$index,
null,
null,
10
);
}
return $sensors;
}
public function discoverWirelessSnr()
{
$oids = snmpwalk_cache_oid($this->getDevice(), 'mwrEmcRadioSNR', array(), 'MWR-RADIO-MC-MIB', null, '-Ob');
$sensors = array();
foreach ($oids as $index => $entry) {
$sensors[] = new WirelessSensor(
'snr',
$this->getDeviceId(),
'.1.3.6.1.4.1.7262.4.5.12.203.1.1.7.' . $index,
'harmony_enhanced',
$index,
'SNR Radio ' . $index,
null,
null,
10
);
}
return $sensors;
}
public function discoverWirelessPower()
{
$oids = snmpwalk_cache_oid($this->getDevice(), 'mwrEmcRadioActualTxPower', array(), 'MWR-RADIO-MC-MIB', null, '-Ob');
$sensors = array();
foreach ($oids as $index => $entry) {
$sensors[] = new WirelessSensor(
'power',
$this->getDeviceId(),
'.1.3.6.1.4.1.7262.4.5.12.203.1.1.9.' . $index,
'harmony_enhanced',
$index,
'TX Power Radio ' . $index,
null,
null,
10
);
}
return $sensors;
}
public function discoverWirelessErrors()
{
$oids = snmpwalk_cache_oid($this->getDevice(), 'mwrEmcRadioRxErrsFrames', array(), 'MWR-RADIO-MC-MIB', null, '-Ob');
$sensors = array();
foreach ($oids as $index => $entry) {
$sensors[] = new WirelessSensor(
'errors',
$this->getDeviceId(),
'.1.3.6.1.4.1.7262.4.5.12.203.1.1.4.' . $index,
'harmony_enhanced',
$index,
'RX Errors Radio ' . $index
);
}
return $sensors;
}
}