mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
committed by
Tony Murray
parent
0f4263bdb4
commit
569a3b4a8b
@@ -162,7 +162,7 @@ function discover_device($device, $options = null)
|
||||
$device_run = ($device_end - $device_start);
|
||||
$device_time = substr($device_run, 0, 5);
|
||||
|
||||
dbUpdate(array('last_discovered' => array('NOW()'), 'type' => $device['type'], 'last_discovered_timetaken' => $device_time), 'devices', '`device_id` = ?', array($device['device_id']));
|
||||
dbUpdate(array('last_discovered' => array('NOW()'), 'last_discovered_timetaken' => $device_time), 'devices', '`device_id` = ?', array($device['device_id']));
|
||||
|
||||
echo "Discovered in $device_time seconds\n";
|
||||
|
||||
|
@@ -15,3 +15,10 @@ if ($icon != $device['icon']) {
|
||||
$sql = dbUpdate(array('icon' => $icon), 'devices', 'device_id=?', array($device['device_id']));
|
||||
echo "Changed Icon! : $icon\n";
|
||||
}
|
||||
|
||||
if ($config['os'][$device['os']]['type'] != $device['type']) {
|
||||
log_event('Device type changed '.$device['type'].' => '.$config['os'][$device['os']]['type'], $device, 'system');
|
||||
$device['type'] = $config['os'][$device['os']]['type'];
|
||||
$sql = dbUpdate(array('type' => $device['type']), 'devices', 'device_id=?', array($device['device_id']));
|
||||
echo "Changed Type! : ".$device['type'].PHP_EOL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user