commit version 22.12.12447

This commit is contained in:
2023-01-01 22:36:12 -05:00
parent af1b03d79f
commit b948283a96
744 changed files with 620715 additions and 27381 deletions

View File

@ -6,18 +6,17 @@
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2020 Observium Limited
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
*
*/
// Currently not possible convert to definitions because type detection is hard, based on descriptions
// SAME code in ATEN-IPMI-MIB
$oids = snmpwalk_multipart_oid($device, "fgHwSensorTable", array(), "FORTINET-FORTIGATE-MIB");
$oids = snmpwalk_multipart_oid($device, "fgHwSensorTable", [], "FORTINET-FORTIGATE-MIB");
print_debug_vars($oids);
foreach ($oids as $index => $entry)
{
foreach ($oids as $index => $entry) {
$descr = $entry['fgHwSensorEntName'];
$oid_name = 'fgHwSensorEntValue';
@ -25,6 +24,8 @@ foreach ($oids as $index => $entry)
$scale = 1;
$value = $entry[$oid_name];
if (empty($descr) && $value == 0) { continue; }
// Detect class based on descr anv value (this is derp, table not have other data for detect class
if (str_iends($descr, ' Temp')) {
if ($value == 0) { continue; }
@ -58,7 +59,10 @@ foreach ($oids as $index => $entry)
$class = 'temperature';
}
discover_sensor_ng($device, $class, $mib, $oid_name, $oid_num, $index, NULL, $descr, $scale, $value);
discover_status_ng($device, $mib, `fgHwSensorEntAlarmStatus`, '.1.3.6.1.4.1.12356.101.4.3.2.1.4.'.$index, $index,
'fgHwSensorEntAlarmStatus', $descr, $entry['fgHwSensorEntAlarmStatus']);
discover_sensor_ng($device, $class, $mib, $oid_name, $oid_num, $index, NULL, $descr, $scale, $value);
}
// EOF