diff --git a/includes/polling/os/procurve.inc.php b/includes/polling/os/procurve.inc.php index 9c05b412c4..a0b61e6ba2 100755 --- a/includes/polling/os/procurve.inc.php +++ b/includes/polling/os/procurve.inc.php @@ -22,6 +22,7 @@ if (preg_match('/^PROCURVE (.*) - (.*)/', $poll_device['sysDescr'], $regexp_resu $serial = snmp_get($device, ".1.3.6.1.4.1.11.2.36.1.1.2.9.0", "-Oqv", "SEMI-MIB"); $serial = trim(str_replace("\"", "", $serial)); +# FIXME maybe genericise? or do away with it if we ever walk the full dot1qTpFdbTable as we can count ourselves then ;) $fdb_rrd_file = $config['rrd_dir'] . "/" . $device['hostname'] . "/fdb_count.rrd"; $FdbAddressCount = snmp_get ($device, "hpSwitchFdbAddressCount.0", "-Ovqn", "STATISTICS-MIB"); diff --git a/includes/polling/os/unix.inc.php b/includes/polling/os/unix.inc.php index ccad4273fc..7287cddad9 100755 --- a/includes/polling/os/unix.inc.php +++ b/includes/polling/os/unix.inc.php @@ -17,19 +17,33 @@ if ($device['os'] == "linux" || $device['os'] == "endian") $features = snmp_get($device, ".1.3.6.1.4.1.2021.7890.1.3.1.1.6.100.105.115.116.114.111", "-Oqv", "UCD-SNMP-MIB"); $features = str_replace("\"", "", $features); - if (!$features) // No "extend" support, try "exec" support + if (!$features) # No "extend" support, try "exec" support { $features = snmp_get($device, ".1.3.6.1.4.1.2021.7890.1.101.1", "-Oqv", "UCD-SNMP-MIB"); $features = str_replace("\"", "", $features); } - // Detect Dell hardware via OpenManage SNMP + # Detect Dell hardware via OpenManage SNMP $hw = snmp_get($device, ".1.3.6.1.4.1.674.10892.1.300.10.1.9.1", "-Oqv", "MIB-Dell-10892"); $hw = trim(str_replace("\"", "", $hw)); if ($hw) { $hardware = "Dell " . $hw; } $serial = snmp_get($device, ".1.3.6.1.4.1.674.10892.1.300.10.1.11.1", "-Oqv", "MIB-Dell-10892"); $serial = trim(str_replace("\"", "", $serial)); + + # Use agent DMI data if available + if (isset($agent_data['dmi'])) + { + if ($agent_data['dmi']['system-product-name']) + { + $hardware = ($agent_data['dmi']['system-manufacturer'] ? $agent_data['dmi']['system-manufacturer'] . ' ' : '') . $agent_data['dmi']['system-product-name']; + } + + if ($agent_data['dmi']['system-serial-number']) + { + $serial = $agent_data['dmi']['system-serial-number']; + } + } } elseif ($device['os'] == "freebsd") diff --git a/includes/polling/unix-agent/hddtemp.inc.php b/includes/polling/unix-agent/hddtemp.inc.php index af999ba35c..b4715ac0c1 100644 --- a/includes/polling/unix-agent/hddtemp.inc.php +++ b/includes/polling/unix-agent/hddtemp.inc.php @@ -4,20 +4,23 @@ global $agent_sensors; include_once("includes/discovery/functions.inc.php"); -$disks = explode('||',trim($agent_data['hddtemp'],'|')); - -if (count($disks)) +if ($agent_data['haddtemp'] != '|') { - echo "hddtemp: "; - foreach ($disks as $disk) - { - list($blockdevice,$descr,$temperature,$unit) = explode('|',$disk,4); - $diskcount++; - discover_sensor($valid['sensor'], 'temperature', $device, '', $diskcount, 'hddtemp', "$blockdevice: $descr", '1', '1', NULL, NULL, NULL, NULL, $temperature, 'agent'); + $disks = explode('||',trim($agent_data['hddtemp'],'|')); - $agent_sensors['temperature']['hddtemp'][$diskcount] = array('description' => "$blockdevice: $descr", 'current' => $temperature, 'index' => $diskcount); + if (count($disks)) + { + echo "hddtemp: "; + foreach ($disks as $disk) + { + list($blockdevice,$descr,$temperature,$unit) = explode('|',$disk,4); + $diskcount++; + discover_sensor($valid['sensor'], 'temperature', $device, '', $diskcount, 'hddtemp', "$blockdevice: $descr", '1', '1', NULL, NULL, NULL, NULL, $temperature, 'agent'); + + $agent_sensors['temperature']['hddtemp'][$diskcount] = array('description' => "$blockdevice: $descr", 'current' => $temperature, 'index' => $diskcount); + } + echo "\n"; } - echo "\n"; } ?> \ No newline at end of file diff --git a/scripts/agent-local/dmi b/scripts/agent-local/dmi new file mode 100755 index 0000000000..f040c89ddb --- /dev/null +++ b/scripts/agent-local/dmi @@ -0,0 +1,9 @@ +#!/bin/bash + +echo '<<>>' + +# requires dmidecode +for FIELD in bios-vendor bios-version bios-release-date system-manufacturer system-product-name system-version system-serial-number system-uuid baseboard-manufacturer baseboard-product-name baseboard-version baseboard-serial-number baseboard-asset-tag chassis-manufacturer chassis-type chassis-version chassis-serial-number chassis-asset-tag processor-family processor-manufacturer processor-version processor-frequency +do + echo $FIELD=$(dmidecode -s $FIELD) +done