mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-01 16:26:55 +02:00
dmi support for agent
git-svn-id: http://www.observium.org/svn/observer/trunk@3233 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -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 = 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));
|
$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";
|
$fdb_rrd_file = $config['rrd_dir'] . "/" . $device['hostname'] . "/fdb_count.rrd";
|
||||||
|
|
||||||
$FdbAddressCount = snmp_get ($device, "hpSwitchFdbAddressCount.0", "-Ovqn", "STATISTICS-MIB");
|
$FdbAddressCount = snmp_get ($device, "hpSwitchFdbAddressCount.0", "-Ovqn", "STATISTICS-MIB");
|
||||||
|
|||||||
@@ -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 = 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);
|
$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 = snmp_get($device, ".1.3.6.1.4.1.2021.7890.1.101.1", "-Oqv", "UCD-SNMP-MIB");
|
||||||
$features = str_replace("\"", "", $features);
|
$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 = 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));
|
$hw = trim(str_replace("\"", "", $hw));
|
||||||
if ($hw) { $hardware = "Dell " . $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 = 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));
|
$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")
|
elseif ($device['os'] == "freebsd")
|
||||||
|
|||||||
@@ -4,20 +4,23 @@ global $agent_sensors;
|
|||||||
|
|
||||||
include_once("includes/discovery/functions.inc.php");
|
include_once("includes/discovery/functions.inc.php");
|
||||||
|
|
||||||
$disks = explode('||',trim($agent_data['hddtemp'],'|'));
|
if ($agent_data['haddtemp'] != '|')
|
||||||
|
|
||||||
if (count($disks))
|
|
||||||
{
|
{
|
||||||
echo "hddtemp: ";
|
$disks = explode('||',trim($agent_data['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);
|
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";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
Executable
+9
@@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo '<<<dmi>>>'
|
||||||
|
|
||||||
|
# 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
|
||||||
Reference in New Issue
Block a user