apache / apache/hertzbeat

华为5800 OLT设备,snmp获取相关问题

Open
#4,358 0 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Java
Stars
7.4k
Forks
1.3k
Avg merge
1d 20h
Merged PRs (30d)
32

Description

### Question

我执行华为OLT-5800 snmpwalk -v 2c -c XXXX 71.100.10.3 1.3.6.1.4.1.2011.6.128.1.1.2.51.1.6 这个命令,返回一堆:iso.3.6.1.4.1.2011.6.128.1.1.2.51.1.6.4194344960.0 = INTEGER: 2147483647
iso.3.6.1.4.1.2011.6.128.1.1.2.51.1.6.4194345216.0 = INTEGER: 8775
iso.3.6.1.4.1.2011.6.128.1.1.2.51.1.6.4194345216.1 = INTEGER: 8413
iso.3.6.1.4.1.2011.6.128.1.1.2.51.1.6.4194345216.14 = INTEGER: 8565
iso.3.6.1.4.1.2011.6.128.1.1.2.51.1.6.4194345216.18 = INTEGER: 8630
iso.3.6.1.4.1.2011.6.128.1.1.2.51.1.6.4194345472.1 = INTEGER: 2147483647
iso.3.6.1.4.1.2011.6.128.1.1.2.51.1.6.4194345472.3 = INTEGER: 2147483647
iso.3.6.1.4.1.2011.6.128.1.1.2.51.1.6.4194345472.4 = INTEGER: 2147483647,配置,我该如何获取oid_index索引信息,当前metric_instance不是有效的内置变量,那我该如何编写配置获取全量onu发光值?
yaml模板文件calculates好像并不支持正则表达式:
我想要获取onu的收光,
# ========== 2. OLT接收ONU光功率(使用walk采集全量数据) ==========
- name: olt_onu_rx_power
i18n:
zh-CN: OLT接收ONU光功率
en-US: OLT RX ONU Power
priority: 3
fields:
- field: oid_index
type: 1
label: true
i18n:
zh-CN: 完整OID索引
en-US: Full OID Index
- field: rx_power
type: 0
unit: 'dBm'
i18n:
zh-CN: 接收光功率(OLT侧)
en-US: RX Power(OLT Side)
aliasFields:
- hwGponOntOpticalDdmOltRxOntPower
calculates:
# 使用metric_instance获取完整的OID索引
- oid_index=metric_instance
# 华为官方MIB公式: 实际值=(节点值-10000)/100
# 2147483647(0x7FFFFFFF)为华为"无效/无数据"哨兵, 置9999后由filters剔除
- "rx_power=((hwGponOntOpticalDdmOltRxOntPower==2147483647) ? 9999 : (hwGponOntOpticalDdmOltRxOntPower-10000)/100)"
filters:
- rx_power != '9999'
protocol: snmp
snmp:
host: ^_^host^_^
port: ^_^port^_^
timeout: ^_^timeout^_^
community: ^_^community^_^
version: ^_^snmpVersion^_^
operation: walk
oids:
hwGponOntOpticalDdmOltRxOntPower: 1.3.6.1.4.1.2011.6.128.1.1.2.51.1.6

Contributor guide

Open the contributing guide

Research direction

Start with the YAML template's `calculates`, `filters`, and SNMP `walk` configuration, using the Huawei OID `1.3.6.1.4.1.2011.6.128.1.1.2.51.1.6` as the entry point. Verify how walked OID indexes are exposed and whether `metric_instance` is supported, then check that the configuration can retain valid ONU values while excluding `2147483647`.

Written by the indexing model from the issue text.

Assessment

Domain
networking, observability-sre
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.