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);
|
2010-02-17 18:12:55 +00:00
|
|
|
} elseif ($device['os'] == "openbsd" || $device['os'] == "solaris" || $device['os'] == "opensolaris") {
|
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"; }
|
2010-01-03 20:13:10 +00:00
|
|
|
else if(strstr($sysDescr, "x86_64")) { $hardware = "Generic x86 64-bit"; }
|
|
|
|
else if(strstr($sysDescr, "sparc32")) { $hardware = "Generic SPARC 32-bit"; }
|
|
|
|
else if(strstr($sysDescr, "sparc64")) { $hardware = "Generic SPARC 64-bit"; }
|
2010-06-18 15:57:32 +00:00
|
|
|
|
|
|
|
# Distro "extend" support
|
2010-07-02 19:58:13 +00:00
|
|
|
$cmd = $config['snmpget'] . " -M ".$config['mibdir'] . " -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|grep -v 'No Such Instance'";
|
2008-11-26 17:58:47 +00:00
|
|
|
$features = trim(`$cmd`);
|
|
|
|
$features = str_replace("\"", "", $features);
|
2010-06-18 15:57:32 +00:00
|
|
|
|
|
|
|
if (!$features) # No "extend" support, try "exec" support
|
|
|
|
{
|
2010-07-02 19:58:13 +00:00
|
|
|
$cmd = $config['snmpget'] . " -M ".$config['mibdir'] . " -m UCD-SNMP-MIB -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port']. " .1.3.6.1.4.1.2021.7890.1.101.1|grep -v 'No Such Instance'";
|
2010-06-18 15:57:32 +00:00
|
|
|
$features = trim(`$cmd`);
|
|
|
|
$features = str_replace("\"", "", $features);
|
|
|
|
}
|
2010-06-12 18:14:59 +00:00
|
|
|
if(preg_match("@No\ Such@", $features)||preg_match("@No\ such@", $features)) { unset($features); }
|
2008-11-26 17:58:47 +00:00
|
|
|
// Detect Dell hardware via OpenManage SNMP
|
2010-07-02 19:58:13 +00:00
|
|
|
$cmd = $config['snmpget'] . " -M ".$config['mibdir'] . " -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
|
|
|
}
|
|
|
|
|
2010-02-17 18:12:55 +00:00
|
|
|
echo("$version - $hardware - $features ");
|
|
|
|
|
2009-11-09 15:52:04 +00:00
|
|
|
include("ucd-mib.inc.php");
|
|
|
|
include("hr-mib.inc.php");
|