mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Dantherm hostname (#14223)
* Support for configured hostname to override sysName * Update and add test data --------- Co-authored-by: Tony Murray <murraytony@gmail.com>
This commit is contained in:
committed by
GitHub
parent
e8ec4722f7
commit
5b63f109c6
34
LibreNMS/OS/DanthermOs.php
Normal file
34
LibreNMS/OS/DanthermOs.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* DanthermOs.php
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @link https://www.librenms.org
|
||||
*/
|
||||
|
||||
namespace LibreNMS\OS;
|
||||
|
||||
use App\Models\Device;
|
||||
use LibreNMS\Interfaces\Discovery\OSDiscovery;
|
||||
|
||||
class DanthermOs extends \LibreNMS\OS implements OSDiscovery
|
||||
{
|
||||
public function discoverOS(Device $device): void
|
||||
{
|
||||
parent::discoverOS($device); // yaml
|
||||
|
||||
$device->sysName = \SnmpQuery::get('DANTHERM-COOLING-MIB::hostName.0')->value() ?: $device->sysName;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user