. * * @link https://www.librenms.org * * @copyright 2021 Tony Murray * @author Tony Murray */ namespace LibreNMS\OS; use App\Models\Device; use LibreNMS\Interfaces\Data\DataStorageInterface; use LibreNMS\Interfaces\Discovery\OSDiscovery; use LibreNMS\Interfaces\Polling\OSPolling; class SupermicroBmc extends \LibreNMS\OS implements OSDiscovery, OSPolling { public function discoverOS(Device $device): void { parent::discoverOS($device); // yaml $this->customSysName($device); } public function pollOS(DataStorageInterface $datastore): void { $this->customSysName($this->getDevice()); } /** * @param Device $device */ private function customSysName(Device $device): void { $device->sysName = \SnmpQuery::get('ATEN-IPMI-MIB::hostName.0')->value() ?: $device->sysName; } }