設備:H3C SecPath F1000-AK110、H3C 5500-28C-EI、H3C S1848G
目標:監(jiān)控網(wǎng)絡設備的溫度、CPU、內(nèi)存、各端口的流量和狀態(tài)
1、設備開啟的snmp,設定community(除了FW1000,其他都可以在WEB界面設置snmp)
<IDC-FW1000-slave>system-view
System View: return to User View with Ctrl+Z.
[IDC-FW1000-slave]snmp-agent
[IDC-FW1000-slave]snmp-agent community read public
[IDC-FW1000-slave]snmp-agent sys-info version all
[IDC-FW1000-slave]display current-configuration
......
#
snmp-agent
snmp-agent local-engineid 800063A280B0F963139FB000000001
snmp-agent community read public
snmp-agent sys-info version all
#
......
[IDC-FW1000-slave]save
The current configuration will be written to the device. Are you sure? [Y/N]:y
Please input the file name(*.cfg)[flash:/startup.cfg]
(To leave the existing filename unchanged, press the enter key):
flash:/startup.cfg exists, overwrite? [Y/N]:y
Validating file. Please wait...
Saved the current configuration to mainboard device successfully.
[IDC-FW1000-slave]
2、獲取OID值
H3C的廠商就是坑,問來了一堆oid毛用沒有。下載MG-SOFT Browser 然后申請一個60天的license.key。 H3C官網(wǎng)上下載Comware MIB,導入MG-SOFT,可以查看每個OID。
第二種方法獲取SNMP字符串
# snmpwalk -v 2c -c public . > mib.txt
費勁周折搞到了幾個oid值
5500-28C-EI
1.3.6.1.4.1.25506.2.6.1.1.1.1.6.65 CPU
1.3.6.1.4.1.25506.2.6.1.1.1.1.8.65 內(nèi)存
1.3.6.1.4.1.25506.2.6.1.1.1.1.12.1 溫度
F1000-AK110
1.3.6.1.4.1.25506.2.6.1.1.1.1.6.4 cpu
1.3.6.1.4.1.25506.2.6.1.1.1.1.8.4 內(nèi)存
S1848G
1.3.6.1.4.1.25506.2.6.1.1.1.1.6.8 cpu
1.3.6.1.4.1.25506.2.6.1.1.1.1.8.8 內(nèi)存
端口
#管理狀態(tài)
IF-MIB::ifAdminStatus.
# 操作狀態(tài)
IF-MIB::ifOperStatus.
# 接收 單播包
IF-MIB::ifInUcastPkts.
# 發(fā)送 單播包
IF-MIB::ifOutUcastPkts.
# 接收 錯誤包
IF-MIB::ifInErrors.
# 發(fā)送 錯誤包
IF-MIB::ifOutErrors.
# 接收 列隊
IF-MIB::ifInQLen.
# 發(fā)送 列隊
IF-MIB::ifOutQLen.
# 接收 多播包
IF-MIB::ifInMulticastPkts.
# 發(fā)送 多播包
IF-MIB::ifOutMulticastPkts.
# 接收 廣播包
IF-MIB::ifInBroadcastPkts.
# 發(fā)送 廣播包
IF-MIB::ifOutBroadcastPkts.
# 接收 非單播包
IF-MIB::ifInNUcastPkts.
# 發(fā)送 非單播包
IF-MIB::ifOutNUcastPkts
# 端口描述
IF-MIB::ifAlias.
3、建立zabbix模板
由于OID各不一樣,不同的設備建一套模板,端口狀態(tài)的OID一樣,共同用一套模板


添加Items ,添加Triggers 然后新建host就可以

然后把模板應用到主機上
網(wǎng)絡模板就用zabbix自帶的
Template SNMP Interfaces,保留進流量、出流量、端口狀態(tài),三個Iterms,其他的都刪除,克隆一份作為新模板應用到host,根據(jù)自己的情況添加Triggers