move default device type per os into ['os'] array and dedupe some of the OS entries in there

git-svn-id: http://www.observium.org/svn/observer/trunk@1267 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2010-06-25 13:43:05 +00:00
parent f76d512188
commit 25970487fa
2 changed files with 54 additions and 55 deletions
+7 -33
View File
@@ -132,40 +132,14 @@ while ($device = mysql_fetch_array($device_query))
if ($device['type'] == "unknown")
{
switch ($device['os'])
if ($config['os'][$device['os']]['type'])
{
case "procurve":
case "powerconnect":
case "ironware":
case "allied":
case "junos": # Could also be a Netscreen?
case "ios":
case "iosxe":
case "catos":
case "3com":
$device['type'] = 'network';
break;
case "asa":
case "pix":
case "screenos":
$device['type'] = 'firewall';
break;
case "dell-laser":
$device['type'] = 'printer';
break;
case "linux":
if (preg_match("/-server$/", $device['version'])) { $device['type'] = 'server'; }
break;
case "apc":
case "mgeups":
case "netmanplus":
$device['type'] = 'power';
break;
case "akcp":
case "minkelsrms":
case "papouch-tme":
$device['type'] = 'environment';
break;
$device['type'] = $config['os'][$device['os']]['type'];
}
if ($device['os'] == "linux")
{
if (preg_match("/-server$/", $device['version'])) { $device['type'] = 'server'; }
}
}