Code: Select all
cpqHeTemperatureLocale OBJECT-TYPE
SYNTAX INTEGER {
other(1),
unknown(2),
system(3),
systemBoard(4),
ioBoard(5),
cpu(6),
memory(7),
storage(8),
removableMedia(9),
powerSupply(10),
ambient(11),
chassis(12),
bridgeCard(13)
}
Code: Select all
$snmp_array[$i]["mibvalue"] = format_raw_snmp_string($temp_array[$i]);
Code: Select all
function format_raw_snmp_string($string) {
/* strip off all leading junk (the oid and stuff) */
$string = trim(ereg_replace(".*= ", "", $string));
return trim($string);
}
Code: Select all
enterprises.compaq.cpqHealth.cpqHeComponent.cpqHeThermal.cpqHeTemperatureTable.cpqHeTemperatureEntry.cpqHeTemperatureChassis.0.1 = 0
enterprises.compaq.cpqHealth.cpqHeComponent.cpqHeThermal.cpqHeTemperatureTable.cpqHeTemperatureEntry.cpqHeTemperatureChassis.0.2 = 0
enterprises.compaq.cpqHealth.cpqHeComponent.cpqHeThermal.cpqHeTemperatureTable.cpqHeTemperatureEntry.cpqHeTemperatureChassis.0.3 = 0
enterprises.compaq.cpqHealth.cpqHeComponent.cpqHeThermal.cpqHeTemperatureTable.cpqHeTemperatureEntry.cpqHeTemperatureChassis.0.4 = 0
enterprises.compaq.cpqHealth.cpqHeComponent.cpqHeThermal.cpqHeTemperatureTable.cpqHeTemperatureEntry.cpqHeTemperatureIndex.0.1 = 1
enterprises.compaq.cpqHealth.cpqHeComponent.cpqHeThermal.cpqHeTemperatureTable.cpqHeTemperatureEntry.cpqHeTemperatureIndex.0.2 = 2
enterprises.compaq.cpqHealth.cpqHeComponent.cpqHeThermal.cpqHeTemperatureTable.cpqHeTemperatureEntry.cpqHeTemperatureIndex.0.3 = 3
enterprises.compaq.cpqHealth.cpqHeComponent.cpqHeThermal.cpqHeTemperatureTable.cpqHeTemperatureEntry.cpqHeTemperatureIndex.0.4 = 4
enterprises.compaq.cpqHealth.cpqHeComponent.cpqHeThermal.cpqHeTemperatureTable.cpqHeTemperatureEntry.cpqHeTemperatureLocale.0.1 = cpu(6)
enterprises.compaq.cpqHealth.cpqHeComponent.cpqHeThermal.cpqHeTemperatureTable.cpqHeTemperatureEntry.cpqHeTemperatureLocale.0.2 = cpu(6)
enterprises.compaq.cpqHealth.cpqHeComponent.cpqHeThermal.cpqHeTemperatureTable.cpqHeTemperatureEntry.cpqHeTemperatureLocale.0.3 = ioBoard(5)
enterprises.compaq.cpqHealth.cpqHeComponent.cpqHeThermal.cpqHeTemperatureTable.cpqHeTemperatureEntry.cpqHeTemperatureLocale.0.4 = cpu(6)
enterprises.compaq.cpqHealth.cpqHeComponent.cpqHeThermal.cpqHeTemperatureTable.cpqHeTemperatureEntry.cpqHeTemperatureCelsius.0.1 = 31
enterprises.compaq.cpqHealth.cpqHeComponent.cpqHeThermal.cpqHeTemperatureTable.cpqHeTemperatureEntry.cpqHeTemperatureCelsius.0.2 = 29
enterprises.compaq.cpqHealth.cpqHeComponent.cpqHeThermal.cpqHeTemperatureTable.cpqHeTemperatureEntry.cpqHeTemperatureCelsius.0.3 = 36
enterprises.compaq.cpqHealth.cpqHeComponent.cpqHeThermal.cpqHeTemperatureTable.cpqHeTemperatureEntry.cpqHeTemperatureCelsius.0.4 = 30
enterprises.compaq.cpqHealth.cpqHeComponent.cpqHeThermal.cpqHeTemperatureTable.cpqHeTemperatureEntry.cpqHeTemperatureThreshold.0.1 = 58
enterprises.compaq.cpqHealth.cpqHeComponent.cpqHeThermal.cpqHeTemperatureTable.cpqHeTemperatureEntry.cpqHeTemperatureThreshold.0.2 = 70
enterprises.compaq.cpqHealth.cpqHeComponent.cpqHeThermal.cpqHeTemperatureTable.cpqHeTemperatureEntry.cpqHeTemperatureThreshold.0.3 = 62
enterprises.compaq.cpqHealth.cpqHeComponent.cpqHeThermal.cpqHeTemperatureTable.cpqHeTemperatureEntry.cpqHeTemperatureThreshold.0.4 = 70
enterprises.compaq.cpqHealth.cpqHeComponent.cpqHeThermal.cpqHeTemperatureTable.cpqHeTemperatureEntry.cpqHeTemperatureCondition.0.1 = ok(2)
enterprises.compaq.cpqHealth.cpqHeComponent.cpqHeThermal.cpqHeTemperatureTable.cpqHeTemperatureEntry.cpqHeTemperatureCondition.0.2 = ok(2)
enterprises.compaq.cpqHealth.cpqHeComponent.cpqHeThermal.cpqHeTemperatureTable.cpqHeTemperatureEntry.cpqHeTemperatureCondition.0.3 = ok(2)
enterprises.compaq.cpqHealth.cpqHeComponent.cpqHeThermal.cpqHeTemperatureTable.cpqHeTemperatureEntry.cpqHeTemperatureCondition.0.4 = ok(2)
enterprises.compaq.cpqHealth.cpqHeComponent.cpqHeThermal.cpqHeTemperatureTable.cpqHeTemperatureEntry.cpqHeTemperatureThresholdType.0.1 = caution(9)
enterprises.compaq.cpqHealth.cpqHeComponent.cpqHeThermal.cpqHeTemperatureTable.cpqHeTemperatureEntry.cpqHeTemperatureThresholdType.0.2 = caution(9)
enterprises.compaq.cpqHealth.cpqHeComponent.cpqHeThermal.cpqHeTemperatureTable.cpqHeTemperatureEntry.cpqHeTemperatureThresholdType.0.3 = caution(9)
enterprises.compaq.cpqHealth.cpqHeComponent.cpqHeThermal.cpqHeTemperatureTable.cpqHeTemperatureEntry.cpqHeTemperatureThresholdType.0.4 = caution(9)
Finally, in lib/data_query.php function query_snmp_host() had to be modified to support a new "source" tag type called "mibvalue". This code looks like...
Code: Select all
elseif ($field_array["source"] == "mibvalue") {
for ($i=0;($i<sizeof($snmp_data));$i++) {
$snmp_index = ereg_replace('.*\.([0-9]+)$', "\\1", $snmp_data[$i]["oid"]);
$oid = $field_array["oid"] . ".$snmp_index";
debug_log_insert("data_query", "Found item [$field_name='" . $snmp_data[$i]["mibvalue"]. "'] index: $snmp_index [from mibvalue]");
db_execute("replace into host_snmp_cache
(host_id,snmp_query_id,field_name,field_value,snmp_index,oid)
values ($host_id,$snmp_query_id,'$field_name','" . $snmp_data[$i]["mibvalue"] . "',$snmp_index,'$oid')");
}
Code: Select all
- <cpqHeTemperatureLocale>
<name>Location</name>
<method>walk</method>
<source>mibvalue</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.232.6.2.6.8.1.3.0</oid>
</cpqHeTemperatureLocale>
I don't know if you would want to extend this type of value since it doesn't work with all 3 methods of SNMP walking. I just find it useful.
_Paul