. * * @link https://www.librenms.org * * @copyright 2017 Tony Murray * @author Tony Murray */ namespace LibreNMS\OS; use App\Models\Location; use LibreNMS\Device\WirelessSensor; use LibreNMS\Interfaces\Discovery\OSDiscovery; use LibreNMS\Interfaces\Discovery\Sensors\WirelessRssiDiscovery; use LibreNMS\Interfaces\Discovery\Sensors\WirelessSnrDiscovery; use LibreNMS\OS; class Bats extends OS implements OSDiscovery, WirelessSnrDiscovery, WirelessRssiDiscovery { public function fetchLocation(): Location { $location = parent::fetchLocation(); $lat = snmp_get($this->getDeviceArray(), 'AATS-MIB::networkGPSLatitudeFloat.0', '-Oqv'); $lng = snmp_get($this->getDeviceArray(), 'AATS-MIB::networkGPSLongitudeFloat.0', '-Oqv'); $pointing = snmp_get($this->getDeviceArray(), 'AATS-MIB::status.0', '-Oqv'); return new Location([ 'location' => 'At ' . (string) $lat . ', ' . (string) $lng . '. ' . $pointing, 'lat' => $lat, 'lng' => $lng, ]); } public function discoverWirelessSnr() { $oid = '.1.3.6.1.4.1.37069.1.2.5.3.0'; return [ new WirelessSensor('snr', $this->getDeviceId(), $oid, 'bats', 0, 'SNR'), ]; } public function discoverWirelessRssi() { $oid = '.1.3.6.1.4.1.37069.1.2.4.3.0'; return [ new WirelessSensor('rssi', $this->getDeviceId(), $oid, 'bats', 0, 'RSSI'), ]; } }