如何使用MIB讀取光模塊的收發(fā)光功率
如何使用MIB讀取接口收發(fā)光功率
1、首先,在華為的私有MIB中有一個hwEntityExtentMIB,其中的兩個節(jié)點分別標明了收發(fā)光功率,節(jié)點名和OID分別如下
Name: hwEntityOpticalRxPower
Type: OBJECT-TYPE
OID: 1.3.6.1.4.1.2011.5.25.31.1.1.3.1.8
Name: hwEntityOpticalTxPower
Type: OBJECT-TYPE
OID: 1.3.6.1.4.1.2011.5.25.31.1.1.3.1.9
2、讀取這兩個節(jié)點,可以得到光功率,以收光功率為例
***** SNMP QUERY STARTED *****
1: hwEntityOpticalRxPower.17170689 (integer) 0
2: hwEntityOpticalRxPower.17170690 (integer) 0
3: hwEntityOpticalRxPower.17170691 (integer) -3301
4: hwEntityOpticalRxPower.17170692 (integer) 0
5: hwEntityOpticalRxPower.17170693 (integer) 0
6: hwEntityOpticalRxPower.17170694 (integer) 0
7: hwEntityOpticalRxPower.17170695 (integer) 0
8: hwEntityOpticalRxPower.17170696 (integer) 0
9: hwEntityOpticalRxPower.17432833 (integer) -568
10: hwEntityOpticalRxPower.17432834 (integer) -548
11: hwEntityOpticalRxPower.17432835 (integer) 0
12: hwEntityOpticalRxPower.17432836 (integer) 0
13: hwEntityOpticalRxPower.17563905 (integer) 0
14: hwEntityOpticalRxPower.17563906 (integer) -3301
15: hwEntityOpticalRxPower.17563907 (integer) -483
16: hwEntityOpticalRxPower.17563908 (integer) -537
17: hwEntityOpticalRxPower.17563909 (integer) -572
18: hwEntityOpticalRxPower.17563910 (integer) -4000
19: hwEntityOpticalRxPower.17563911 (integer) -2769
20: hwEntityOpticalRxPower.17563912 (integer) -2958
21: hwEntityOpticalRxPower.17563913 (integer) -445
22: hwEntityOpticalRxPower.17563914 (integer) -3096
23: hwEntityOpticalRxPower.17563915 (integer) -4000
24: hwEntityOpticalRxPower.17563916 (integer) -752
25: hwEntityOpticalRxPower.17564161 (integer) -4000
***** SNMP QUERY FINISHED *****
3、下一步要做的,就是如何將光功率和,接口對應,這里使用的不是常用的ifindex,其實收發(fā)光功率節(jié)點所在的表接口,描述信息中,說明了這個表的索引,使用的是entPhysicalIndex
Name: hwOpticalModuleInfoEntry
Type: OBJECT-TYPE
OID: 1.3.6.1.4.1.2011.5.25.31.1.1.3.1
Indexes: 1: entPhysicalIndex
4、搜索該節(jié)點entPhysicalIndex ,可以看到一個表
這個表中有兩個節(jié)點,分別是實體的描述和實體的名字,在實體的描述中可以看到光模塊類型,實體的名字中,可以看到接口和索引的對應關系
Name: entPhysicalDescr
Type: OBJECT-TYPE
OID: 1.3.6.1.2.1.47.1.1.1.1.2
Name: entPhysicalName
Type: OBJECT-TYPE
OID: 1.3.6.1.2.1.47.1.1.1.1.7
比如收發(fā)光功率中,24: hwEntityOpticalRxPower.17563916 (integer) -752 ,索引為17563916的接口光模塊收光功率為-752
根據(jù)這個索引,讀取entPhysicalDescr 和entPhysicalName ,可以得到光模塊的類型及對應接口
1: entPhysicalDescr.17563916 (octet string) 2100Mb/s-850nm-LC-300m(0.05mm)-150m(0.0625mm)
1: entPhysicalName.17563916 (octet string) GigabitEthernet12/0/11
5、值得注意的是,在接口收發(fā)光功率的節(jié)點描述中,說明了MIB讀取到的值需要乘100
Name: hwEntityOpticalRxPower
Type: OBJECT-TYPE
OID: 1.3.6.1.4.1.2011.5.25.31.1.1.3.1.8
Description: The receive power of the optical module. Unit: dBm. the value is expanded 100 times,so the real value should be reduced 100 times
根據(jù)索引可以確認接口光功率
根據(jù)索引可以確認接口光功率
- 上一篇:AR系列路由器配置內網用戶通過公網地址訪問內部服務器配置方法 2015/3/3
- 下一篇:AR2200 靜態(tài)路由track NQA不生效 2015/3/3