$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']; 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