Tony Murray b18c41b1a9 refactor: Use the Config class includes/discovery (#7299)
* refactor: use the Config class includes/discovery

* fix issue with $config variable not accessible in include-dir.inc.php

* improved whitespace

* Tidy up discovery_by_ip
2017-09-11 21:26:41 +01:00

19 lines
435 B
PHP

<?php
use LibreNMS\Config;
$os = getHostOS($device);
if ($os != $device['os']) {
log_event('Device OS changed ' . $device['os'] . " => $os", $device, 'system', 3);
$device['os'] = $os;
$sql = dbUpdate(array('os' => $os), 'devices', 'device_id=?', array($device['device_id']));
if (!Config::has("os.{$device['os']}")) {
load_os($device);
}
echo "Changed OS! : $os\n";
}
update_device_logo($device);