Moved the device type discovery to before it is needed

This commit is contained in:
laf
2016-07-11 12:33:09 +01:00
parent 919b50f76b
commit 0ec980c1cd

View File

@ -97,6 +97,13 @@ function discover_device($device, $options = null) {
}
}
// Set type to a predefined type for the OS if it's not already set
if ($device['type'] == 'unknown' || $device['type'] == '') {
if ($config['os'][$device['os']]['type']) {
$device['type'] = $config['os'][$device['os']]['type'];
}
}
if ($config['os'][$device['os']]['group']) {
$device['os_group'] = $config['os'][$device['os']]['group'];
echo ' (' . $device['os_group'] . ')';
@ -134,13 +141,6 @@ function discover_device($device, $options = null) {
register_mibs($device, $devicemib, "includes/discovery/functions.inc.php");
}
// Set type to a predefined type for the OS if it's not already set
if ($device['type'] == 'unknown' || $device['type'] == '') {
if ($config['os'][$device['os']]['type']) {
$device['type'] = $config['os'][$device['os']]['type'];
}
}
$device_end = microtime(true);
$device_run = ($device_end - $device_start);
$device_time = substr($device_run, 0, 5);