Add zabbix switch on the monitor notes

Add zabbix switch on the monitor notes


Huawei s5720 to add monitoring switch for the first time zabbix, could not find a clue, like a headless flies like to deal with Baidu, the results have no effect, give themselves a lot of pain and upset, increase the number of white hair.

After asking his predecessor, only to find doorways add a switch to monitor, and I record it here:

First: First open zabbix monitor screen, select the menu: configuration - templates, click create template, and enter a name and groups belonging to the group, description, click on the update, as follows:

image-20191031092628687

Second: Adding application (application set)

image-20191031093026501

Third: Add items (monitoring items)

We should pay attention when monitored items added here, where the key to query and snmp oid To get its value according to the corresponding switch to monitor

image-20191031093209670

image-20191031093246788

An example to illustrate to uptime, key and snmp oid how to, find Baidu, there is no use, why?

image-20191031093454223

image-20191031093515001

image-20191031093652603

So much data, I'm looking for that, did not work, I want to test it one by one? It is in trouble, big head. why?

image-20191031093746421

There are ways to look at my operation, or to uptime for example:

image-20191031093246788

snmp oid key and corresponding value sysUpTimeInstance, especially here to explain my side of Huawei s5700 switch on zabbix server to query it, let's go.

First explain snmpwalk command usage

snmpwalk命令格式
snmpwalk -v 版本号 -c 密钥 设备ip oid
如:snmpwalk -v 2c -c luxshare 10.98.18.10 system
这里2c为snmp v2版本,luxshare为交换机的snmp密钥,ip为需要查看的设备ip地址
system为设备的oid基本命令

And then determine the operating environment

首先确认snmp软件是否安装,确定命令snmpwalk是否存在
# rpm -qa net-snmp net-snmp-libs net-snmp-utils
net-snmp-libs-5.7.2-43.el7.x86_64
net-snmp-utils-5.7.2-43.el7.x86_64
net-snmp-5.7.2-43.el7.x86_64
然后知道设备交换机对应的ip地址,我这里已知为10.98.18.10
先查询交换机的基本信息:
# snmpwalk -v2c -c luxshare-ict 10.98.18.10 system
SNMPv2-MIB::sysDescr.0 = STRING: S5720-28P-LI-AC 
Huawei Versatile Routing Platform Software 
 VRP (R) software,Version 5.170 (S5720 V200R010C00SPC600) 
 Copyright (C) 2007 Huawei Technologies Co., Ltd.
SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::enterprises.2011.2.23.402
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (65560044) 7 days, 14:06:40.44
SNMPv2-MIB::sysContact.0 = STRING: R&D Beijing, Huawei Technologies co.,Ltd.
SNMPv2-MIB::sysName.0 = STRING: ENS-A2_1F-INTERNET-S5720
SNMPv2-MIB::sysLocation.0 = STRING: Beijing China
SNMPv2-MIB::sysServices.0 = INTEGER: 78

其中sysUpTimeInstance = Timeticks: (65560044) 7 days, 14:06:40.44就是上面的
key和snmpoid

Needs can query to the appropriate systems information, but its cpu, port, mem, fan and other information, how to query, but also the following query, I do not know its value, how to check, it does not matter, surveillance equipment from the front to know is: Huawei s5720, to Huawei's official website www.huawei.com to query it.

first step:

image-20191031102545054

Step two: find the "technical support center"

image-20191031102607884

Step 3: Select the model, I am here for the s5700, click Queries

image-20191031102644503

Step 4: Select the version number

VRP (R) software,Version 5.170 (S5720 V200R010C00SPC600)

image-20191031103007296

FIG denoted by selecting

image-20191031103336824

Fifth Step: Select the appropriate reference mid

image-20191031103513172

image-20191031103626511

Here you can achieve query cpu usage, I have to test server

查询到交换机所有的端口对应的cpu使用率
[root@mnsv ~]# snmpwalk -v2c -c luxshare-ict 10.98.18.10 1.3.6.1.4.1.2011.5.25.31.1.1.1.1.5
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67108867 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67108869 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67108873 = INTEGER: 11
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67125260 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67141644 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67158028 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67174412 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67190796 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67207180 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67223564 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67239948 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67256332 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67272716 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67289100 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67305484 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67321868 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67338252 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67354636 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67371020 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67436622 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67436686 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67436750 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67436814 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67436878 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67436942 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67437006 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67437070 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67437134 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67437198 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67437262 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67437326 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67437390 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67437454 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67437518 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67437582 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67437646 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67437710 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67437774 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67437838 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67437902 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67437966 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67438030 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67438094 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67438158 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67438222 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67438286 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67438350 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.68157445 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.69206021 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.70254597 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.71303173 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.72351749 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.73400325 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.74448901 = INTEGER: 0
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.75497477 = INTEGER: 0
查询指定端口的cpu指定使用率
# snmpwalk -v2c -c luxshare-ict 10.98.18.10 enterprises.2011.5.25.31.1.1.1.1.5.67108873
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67108873 = INTEGER: 12

Followed by adding items to monitor device location, hostname, serial number, software version, sys description items

4: Adding discovery rules (auto-discovery rules)

Add cpu, mem, mode, port, power, status corresponding automatic monitoring items.

image-20191031104556632

One, for example to: huawei_device_discovery_cpu example:

image-20191031104742583

Wherein the key value: entPhysicalName_cpu and snmp oid value: enterprises.2011.5.25.31.1.1.1.1.5.67108873

The main note snmp oid value must be a right, should not be less than crawl data

# snmpwalk -v2c -c luxshare-ict 10.98.18.10 enterprises.2011.5.25.31.1.1.1.1.5.67108873
SNMPv2-SMI::enterprises.2011.5.25.31.1.1.1.1.5.67108873 = INTEGER: 11

Cpu monitor for automatic entry found

image-20191031105139661

Cpu trigger for automatic discovery

image-20191031105202991

Fifth: template done, the final results are as follows:

image-20191031105507728

And add the template to the hosts go (configuration - hosts)

image-20191031105641962

Sixth: View real-time data

monitoring--latest data

image-20191031105700474

Step Seven: In grafana go to see the data monitoring

image-20191031105759847
This completes

Description:

Later, I feel very simple, mainly because snmp principle of understanding is not very deep, the next step is to strengthen the understanding of snmp.

Guess you like

Origin www.cnblogs.com/wang50902/p/11770055.html