Commit version 24.12.13800
This commit is contained in:
@ -5,9 +5,9 @@
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage discovery
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
* @package observium
|
||||
* @subpackage discovery
|
||||
* @copyright (C) Adam Armstrong
|
||||
*
|
||||
*/
|
||||
|
||||
@ -44,35 +44,32 @@ MSERIES-PORT-MIB::smartPortLowPowerAlarmThreshold.12 = INTEGER: -50
|
||||
|
||||
*/
|
||||
|
||||
$oids = array();
|
||||
$todo = array ('smartPortName', 'smartPortPower', 'smartPortHighPowerAlarmThreshold', 'smartPortLowPowerAlarmThreshold', 'smartPortStatus');
|
||||
foreach ($todo as $table)
|
||||
{
|
||||
$oids = snmpwalk_cache_oid($device, $table, $oids, 'MSERIES-PORT-MIB');
|
||||
$oids = [];
|
||||
$todo = ['smartPortName', 'smartPortPower', 'smartPortHighPowerAlarmThreshold', 'smartPortLowPowerAlarmThreshold', 'smartPortStatus'];
|
||||
foreach ($todo as $table) {
|
||||
$oids = snmpwalk_cache_oid($device, $table, $oids, 'MSERIES-PORT-MIB');
|
||||
}
|
||||
|
||||
$pwr_pfx = ".1.3.6.1.4.1.30826.1.3.1.2.1.1.5";
|
||||
$status_pfx = ".1.3.6.1.4.1.30826.1.3.1.2.1.1.6";
|
||||
foreach ($oids as $index => $entry)
|
||||
{
|
||||
$pwr_current = $entry['smartPortPower'];
|
||||
$options = array();
|
||||
$options['limit_high'] = $entry['smartPortHighPowerAlarmThreshold'] / 10;
|
||||
$options['limit_low'] = $entry['smartPortLowPowerAlarmThreshold'] / 10;
|
||||
# Idle ports indicate -40dBm signal power and always fail the threshold check
|
||||
# because the lowest threshold is -25dBm. To stop such ports making to the
|
||||
# list of failed health checks override the thresholds of an idle port to
|
||||
# a range that never fails.
|
||||
if ($entry['smartPortStatus'] == 'idle')
|
||||
{
|
||||
$options['limit_high'] = 50;
|
||||
$options['limit_low'] = -50;
|
||||
}
|
||||
foreach ($oids as $index => $entry) {
|
||||
$pwr_current = $entry['smartPortPower'];
|
||||
$options = [];
|
||||
$options['limit_high'] = $entry['smartPortHighPowerAlarmThreshold'] / 10;
|
||||
$options['limit_low'] = $entry['smartPortLowPowerAlarmThreshold'] / 10;
|
||||
# Idle ports indicate -40dBm signal power and always fail the threshold check
|
||||
# because the lowest threshold is -25dBm. To stop such ports making to the
|
||||
# list of failed health checks override the thresholds of an idle port to
|
||||
# a range that never fails.
|
||||
if ($entry['smartPortStatus'] == 'idle') {
|
||||
$options['limit_high'] = 50;
|
||||
$options['limit_low'] = -50;
|
||||
}
|
||||
|
||||
$status_current = $entry['smartPortStatus'];
|
||||
$status_current = $entry['smartPortStatus'];
|
||||
|
||||
discover_sensor('dbm', $device, "$pwr_pfx.$index", $index, 'mseries-port-power', $entry['smartPortName'], 0.1, $pwr_current, $options);
|
||||
discover_status($device, "$status_pfx.$index", $index, 'mseries-port-status-state', $entry['smartPortName'], $status_current);
|
||||
discover_sensor('dbm', $device, "$pwr_pfx.$index", $index, 'mseries-port-power', $entry['smartPortName'], 0.1, $pwr_current, $options);
|
||||
discover_status($device, "$status_pfx.$index", $index, 'mseries-port-status-state', $entry['smartPortName'], $status_current);
|
||||
}
|
||||
|
||||
// EOF
|
||||
|
Reference in New Issue
Block a user