2007-04-08 14:33:42 +00:00
|
|
|
<?php
|
|
|
|
|
2009-12-04 15:28:52 +00:00
|
|
|
if ($device['os'] == "freebsd") {
|
2008-11-26 17:58:47 +00:00
|
|
|
$sysDescr = str_replace(" 0 ", " ", $sysDescr);
|
|
|
|
list(,,$version) = explode (" ", $sysDescr);
|
|
|
|
$hardware = "i386";
|
|
|
|
$features = "GENERIC";
|
2009-12-04 15:28:52 +00:00
|
|
|
} elseif ($device['os'] == "dragonfly") {
|
2008-11-26 17:58:47 +00:00
|
|
|
list(,,$version,,,$features,,$hardware) = explode (" ", $sysDescr);
|
2009-12-04 15:28:52 +00:00
|
|
|
} elseif ($device['os'] == "netbsd") {
|
2008-11-26 17:58:47 +00:00
|
|
|
list(,,$version,,,$features) = explode (" ", $sysDescr);
|
|
|
|
$features = str_replace("(", "", $features);
|
|
|
|
$features = str_replace(")", "", $features);
|
|
|
|
list(,,$hardware) = explode ("$features", $sysDescr);
|
2009-12-04 15:28:52 +00:00
|
|
|
} elseif ($device['os'] == "openbsd") {
|
2008-11-26 17:58:47 +00:00
|
|
|
list(,,$version,$features,$hardware) = explode (" ", $sysDescr);
|
|
|
|
$features = str_replace("(", "", $features);
|
|
|
|
$features = str_replace(")", "", $features);
|
2009-12-04 15:28:52 +00:00
|
|
|
} elseif ($device['os'] == "monowall" || $device['os'] == "Voswall") {
|
2008-11-26 17:58:47 +00:00
|
|
|
list(,,$version,$hardware,$freebsda, $freebsdb, $arch) = split(" ", $sysDescr);
|
|
|
|
$features = $freebsda . " " . $freebsdb;
|
|
|
|
$hardware = "$hardware ($arch)";
|
|
|
|
$hardware = str_replace("\"", "", $hardware);
|
2009-12-04 15:28:52 +00:00
|
|
|
} elseif ($device['os'] == "linux") {
|
2008-11-26 17:58:47 +00:00
|
|
|
list(,,$version) = explode (" ", $sysDescr);
|
|
|
|
if(strstr($sysDescr, "386")|| strstr($sysDescr, "486")||strstr($sysDescr, "586")||strstr($sysDescr, "686")) { $hardware = "Generic x86"; }
|
|
|
|
if(strstr($sysDescr, "x86_64")) { $hardware = "Generic x86 64-bit"; }
|
2009-04-24 15:04:45 +00:00
|
|
|
$cmd = $config['snmpget'] . " -m UCD-SNMP-MIB -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port']. " .1.3.6.1.4.1.2021.7890.1.3.1.1.6.100.105.115.116.114.111";
|
2008-11-26 17:58:47 +00:00
|
|
|
$features = trim(`$cmd`);
|
|
|
|
$features = str_replace("No Such Object available on this agent at this OID", "", $features);
|
|
|
|
$features = str_replace("\"", "", $features);
|
|
|
|
// Detect Dell hardware via OpenManage SNMP
|
2009-04-24 15:04:45 +00:00
|
|
|
$cmd = $config['snmpget'] . " -m MIB-Dell-10892 -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'] . " .1.3.6.1.4.1.674.10892.1.300.10.1.9.1";
|
2008-11-26 17:58:47 +00:00
|
|
|
$hw = trim(str_replace("\"", "", `$cmd`));
|
2009-12-04 15:28:52 +00:00
|
|
|
if(strpos($hw, "No") !== FALSE) { unset($hw); } else { $hardware = "Dell " . $hw; }
|
2008-11-26 17:58:47 +00:00
|
|
|
}
|
|
|
|
|
2009-11-09 15:52:04 +00:00
|
|
|
include("ucd-mib.inc.php");
|
|
|
|
include("hr-mib.inc.php");
|