Commit version 24.12.13800
This commit is contained in:
@ -4,9 +4,9 @@
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage discovery
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
|
||||
* @package observium
|
||||
* @subpackage discovery
|
||||
* @copyright (C) Adam Armstrong
|
||||
*
|
||||
*/
|
||||
|
||||
@ -23,56 +23,56 @@ $oids = snmpwalk_cache_oid($device, 'pethMainPseTable', [], 'POWER-ETHERNET-MIB'
|
||||
//NETONIX-SWITCH-MIB::poeStatus.10 = STRING: Off
|
||||
//NETONIX-SWITCH-MIB::poeStatus.11 = STRING: 48V
|
||||
|
||||
$oids = snmpwalk_cache_oid($device, 'poeStatusTable', $oids, 'NETONIX-SWITCH-MIB');
|
||||
$oids = snmpwalk_cache_oid($device, 'poeStatusTable', $oids, 'NETONIX-SWITCH-MIB');
|
||||
|
||||
print_debug_vars($oids);
|
||||
|
||||
////// Per-port Statistics
|
||||
|
||||
foreach ($oids as $index => $entry) {
|
||||
$options = [ 'entPhysicalIndex' => $index ];
|
||||
$port = get_port_by_ifIndex($device['device_id'], $index);
|
||||
// print_vars($port);
|
||||
$options = ['entPhysicalIndex' => $index];
|
||||
$port = get_port_by_ifIndex($device['device_id'], $index);
|
||||
// print_vars($port);
|
||||
|
||||
if (is_array($port)) {
|
||||
$entry['ifDescr'] = $port['port_label'];
|
||||
$options['measured_class'] = 'port';
|
||||
$options['measured_entity'] = $port['port_id'];
|
||||
$options['entPhysicalIndex_measured'] = $port['ifIndex'];
|
||||
} else {
|
||||
$entry['ifDescr'] = "Port $index";
|
||||
}
|
||||
if (is_array($port)) {
|
||||
$entry['ifDescr'] = $port['port_label'];
|
||||
$options['measured_class'] = 'port';
|
||||
$options['measured_entity'] = $port['port_id'];
|
||||
$options['entPhysicalIndex_measured'] = $port['ifIndex'];
|
||||
} else {
|
||||
$entry['ifDescr'] = "Port $index";
|
||||
}
|
||||
|
||||
$descr = $entry['ifDescr'] . ' PoE Status';
|
||||
$descr = $entry['ifDescr'] . ' PoE Status';
|
||||
|
||||
$oid_name = 'pethMainPseOperStatus';
|
||||
$oid_num = ".1.3.6.1.2.1.105.1.3.1.1.3.$index";
|
||||
$type = 'power-ethernet-mib-pse-state';
|
||||
$value = $entry[$oid_name];
|
||||
|
||||
discover_status($device, $oid_num, $oid_name.'.'.$index, $type, $descr, $value, $options);
|
||||
|
||||
if ($entry['pethMainPseOperStatus'] != 'off') {
|
||||
$descr = $entry['ifDescr'] . ' PoE Power';
|
||||
|
||||
$oid_name = 'pethMainPseConsumptionPower';
|
||||
$oid_num = ".1.3.6.1.2.1.105.1.3.1.1.4.$index";
|
||||
$type = 'power-ethernet-mib'; // $mib . '-' . $oid_name;
|
||||
$scale = 1;
|
||||
$oid_name = 'pethMainPseOperStatus';
|
||||
$oid_num = ".1.3.6.1.2.1.105.1.3.1.1.3.$index";
|
||||
$type = 'power-ethernet-mib-pse-state';
|
||||
$value = $entry[$oid_name];
|
||||
|
||||
discover_sensor('power', $device, $oid_num, "pethMainPseConsumptionPower.$index", $type, $descr, $scale, $value, $options);
|
||||
}
|
||||
discover_status($device, $oid_num, $oid_name . '.' . $index, $type, $descr, $value, $options);
|
||||
|
||||
// Another status
|
||||
$descr = $entry['ifDescr'] . ' PoE';
|
||||
if ($entry['pethMainPseOperStatus'] != 'off') {
|
||||
$descr = $entry['ifDescr'] . ' PoE Power';
|
||||
|
||||
$oid_name = 'poeStatus';
|
||||
$oid_num = ".1.3.6.1.4.1.46242.5.1.2.$index";
|
||||
$type = 'netonix-poeStatus';
|
||||
$value = $entry[$oid_name];
|
||||
$oid_name = 'pethMainPseConsumptionPower';
|
||||
$oid_num = ".1.3.6.1.2.1.105.1.3.1.1.4.$index";
|
||||
$type = 'power-ethernet-mib'; // $mib . '-' . $oid_name;
|
||||
$scale = 1;
|
||||
$value = $entry[$oid_name];
|
||||
|
||||
discover_status($device, $oid_num, $oid_name.'.'.$index, $type, $descr, $value, $options);
|
||||
discover_sensor('power', $device, $oid_num, "pethMainPseConsumptionPower.$index", $type, $descr, $scale, $value, $options);
|
||||
}
|
||||
|
||||
// Another status
|
||||
$descr = $entry['ifDescr'] . ' PoE';
|
||||
|
||||
$oid_name = 'poeStatus';
|
||||
$oid_num = ".1.3.6.1.4.1.46242.5.1.2.$index";
|
||||
$type = 'netonix-poeStatus';
|
||||
$value = $entry[$oid_name];
|
||||
|
||||
discover_status($device, $oid_num, $oid_name . '.' . $index, $type, $descr, $value, $options);
|
||||
}
|
||||
|
||||
// EOF
|
||||
|
Reference in New Issue
Block a user