librenms/includes/discovery/os.inc.php
Tony Murray 374a4041af fix: inconsistent device discovery (#6518)
There were two or more separate $device arrays during discovery. When one was updated, others were not.
Combine those all.
Make sure the new os is loaded if the os changed.
2017-04-28 22:50:00 +01:00

17 lines
415 B
PHP

<?php
$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 (!isset($config['os'][$device['os']])) {
load_os($device);
}
echo "Changed OS! : $os\n";
}
update_device_logo($device);