SNMP Exporter介绍
SNMP Exporter是一个用于监控和收集网络设备信息的开源软件。它作为Prometheus监控系统的一个重要组件,通过使用Simple Network Management Protocol(SNMP)协议,从网络设备(如路由器、交换机、服务器等)中提取性能指标和状态信息,并将其转换为Prometheus可以理解的格式,从而实现对网络设备的监控和指标收集。
SNMP Exporter充当一个网关,它与目标设备进行通信并获取SNMP协议提供的数据。它能够收集和导出诸如CPU利用率、内存使用情况、接口状态、网络流量等各种指标。这些指标可以通过HTTP端点暴露给Prometheus服务器,Prometheus服务器将这些指标进行存储、分析和可视化。
SNMP Exporter具有配置灵活性,可以通过配置文件定义要监控的设备、指标以及与设备通信的SNMP凭据。它还支持SNMP v1、v2c和v3协议,并提供了各种选项来处理SNMP数据的解析和转换。本案例都是使用的v2协议
SNMP Exporter使用
对于 SNMP Exporter 的使用来说, 配置文件比较重要,配置文件中根据硬件的 MIB 文件生成了 OID 的映射关系。以 Cisco 交换机为例,在官方 GitHub 上下载最新的 snmp.yml 文件,由于 Cisco 交换机使用的是 if_mib 模块,在 if_mib 下新增 auth ,用来在请求交换机的时候做验证使用,这个值是配置在交换机上的。
在默认情况下,github代码的根目录存在snmp.yaml,但是里面采集的数据不一定满足我们的需求,同样的是特别多的采集数据会加重网络设备的压力,影响正常的网络质量。本案例会采取根据generator去生成snmp.yaml文件,根据自己的需求去采集对应的数据。
1 snmp源码部署
1.1 Golang基础环境部署
wget https://studygolang.com/dl/golang/go1.19.7.linux-amd64.tar.gz
tar -xf go1.19.7.linux-amd64.tar.gz -C /usr/local
cat >> /etc/profile << "eof"
export PATH=$PATH:/usr/local/go/bin
export GO111MODULE=on
export GOPROXY=https://goproxy.cn,direct #设置proxy代理加速
export PATH=$PATH:/root/go/bin
eof
source /etc/profile # 刷新环境变量
# 查看go版本
go version
# go version go1.19.7 linux/amd64
1.2 部署snmp-exporter
## 安装依赖
yum install -y epel-release.noarch
yum install -y wget tree net-snmp net-snmp-utils net-snmp-libs net-snmp-devel p7zip* git
# 下载snmp_exporter源码
cd /usr/local/git
git clone https://github.com/prometheus/snmp_exporter.git
# 编译源码
cd /usr/local/git/snmp_exporter
go build
配置启动项
touch /etc/systemd/system/snmp_exporter.service
cat > /etc/systemd/system/snmp_exporter.service << "eof"
[Unit]
Description=Prometheus SNMP Exporter
Wants=network-online.target
After=network-online.target
[Service]
User=snmp_exporter
Group=snmp_exporter
Type=simple
ExecStart=/usr/local/git/snmp_exporter/snmp_exporter --config.file /usr/local/git/snmp_exporter/snmp.yml
[Install]
WantedBy=multi-user.target
eof
1.3 部署generator
官方当前的 snmp.yml 支持 如下这些模块[2022.10.19]
apcups : 一般用于 UPS 监控
arista_sw
cisco_wlc : 一般用于 ap 监控
ddwrt : 一般用于软路由
if_mib : 一般用于网络设备。该MIB描述了网络接口子层的通用表项。是MIB-II中ifTable的升级版本,也是对RFC1573扩展定义的具体说明。IF-MIB包含了一组与网络设备的通用接口相关的管理对象。这些管理对象适用于所有的网络接口,与接口上使用的通信介质合协议的类型无关。IF-MIB也定义了用于特殊介质和低层协议栈(子网层或更低层)的管理对象。
infrapower_pdu
keepalived
kemp_loadmaster
liebert_pdu
mikrotik
nec_ix
paloalto_fw
printer_mib
raritan
servertech_sentry3
servertech_sentry4
synology
ubiquiti_airfiber
ubiquiti_airmax
ubiquiti_unifi
wienner_mpod
自己生成snmp.yaml文件需要在源码中编译
# 编译generator
cd /usr/local/git/snmp_exporter/generator
go build
export MIBDIRS=/usr/local/git/snmp_exporter/generator/mibs:/usr/local/git/snmp_exporter/generator/mibs/h3c
# 这个/usr/local/git/snmp_exporter/generator/mibs/h3c是可以不填的,根据自己想存放的mibs位子来判断,可以将所有mibs文件放入generator/mibs这个文件下,也可以更加优雅的处理多设备mibs文件过多,例如
# export MIBDIRS=/usr/local/git/snmp_exporter/generator/mibs:/usr/local/git/snmp_exporter/generator/mibs/H3C:/usr/local/git/snmp_exporter/generator/mibs/Cisco:/usr/local/git/snmp_exporter/generator/mibs/Huawei
方法一 make,根据Makefile下载mibs
make mibs #编译Makefile的包,下载mib文件,翻墙编译最好,多重试几次,经过我自己尝试,这个步骤非常难成功,github的代理dns,科学上网均无法成功。
方法二 自己去官网下载mibs文件,并且将文件放入mibs文件夹内
以我们的H3C网络设备来举例
1 去H3C的官网支持中心
2 选中自己的网络设备型号
3 下载Mibs库,并且将文件放入mibs库内
获取第三方github仓库下载mibs文件,其他人分享的华为mib库 https://github.com/dkruyt/Huawei_FatAP_Grafana/tree/master/mibs
2 自定义生成snmp.yml
snmp基础
snmpwalk -v 2c -c xxxxxxxx 172.16.1.1
参数解释:
-v 2c : 指定 SNMP 协议的版本,当前指定为 2c
-c xxxx : SNMP 的 Community 值,就是密码
172.16.1.1 : 硬件的 IP地址
# 例子 硬件IP地址后就是查询网络设备的OID 关于snmpwalk命令使用请自行百度
snmpwalk -v 2c -c 123456 172.18.48.5 1.3.6.1.2.1.47.1.1.1.1.7
2.1 generator.yml官方模版解读
modules:
module_name: # 模块名,可自定义名,该模块名需要和prometheus.yml文件
walk: # 遍历OID列表,也可以是SNMP对象名称或特定实例
- 1.3.6.1.2.1.1.1 # sysDescr 想要收集的指标,这个指标取决于你想采取什么数据
- sysName # 1.3.6.1.2.1.1.5
- 1.3.6.1.4.1.25506.2.6.1.1.1.1.6 #cpu
- 1.3.6.1.4.1.25506.2.6.1.1.1.1.8 #内存
version: 2 #snmp版本,需要看交换机开启了那个版本,华为交换机一般都是开启2c,如果是3的版本需要添加认证
max_repetitions: 25 #如果不写默认就是25
retries: 3 #如果不写默认就是3
timeout: 5s #如果不写默认就是5s
auth:
community: 123456 #snmp版本2就写团体名就好
# snmp版本需要完善下面信息 community就不需要了
lookups: # 在promSQL查询的时候可以使用的选项,例如 ifHCInOctets{ifAlias="eth1"} 查询网络设备接口为eth1的数据
- source_indexes: [ifIndex] # ifAlias 表示网络设备接口的别名
lookup: ifAlias
- source_indexes: [ifIndex]
lookup: 1.3.6.1.2.1.2.2.1.2 # ifDescr 表示网络设备接口的描述
- source_indexes: [ifIndex]
lookup: 1.3.6.1.2.1.31.1.1.1.1 # ifName 表示网络设备接口的名称
- source_indexes: [entPhysicalIndex]
lookup: 1.3.6.1.2.1.47.1.1.1.1.7 # entPhysicalIndex 表示网络设备接口的物理索引
overrides: # 每次都会覆盖这几个标签,例如设备名,接口名这些都是不会改变的
ifAlias:
ignore: true # Lookup metric
ifDescr:
ignore: true # Lookup metric
ifName:
ignore: true # Lookup metric
ifType:
ignore: true # Lookup metric
entPhysicalIndex:
ignore: true # Lookup metric
entPhysicalName:
ignore: true # Lookup metric
2.2 生成snmp.yml
因为自己的snmp.yml文件不是全部都由自己生成的,所以我只演示一下,我相对官方默认的if-mib内容新增,内存,CPU的监控,以及添加自己的community
/usr/local/git/snmp_exporter/generator/generator.yml
modules:
if_mib:
walk:
- 1.3.6.1.4.1.25506.2.6.1.1.1.1.6 #hh3cEntityExtCpuUsage CPU实体在最后1分钟内的利用率
- 1.3.6.1.4.1.25506.2.6.1.1.1.1.8 #h3cEntityExtCpuUsage CPU实体在最后1分钟内的利用率
version: 2
max_repetitions: 25
retries: 3
timeout: 10s
auth:
community: GQ1HuMUB65eZvR2
cd /usr/local/git/snmp_exporter/generator/
./generator generate
输出结果如下,在 /usr/local/git/snmp_exporter/generator 目录下生成了snmp.yml
root@user:/usr/local/git/snmp_exporter/generator# ./generator generate
ts=2023-05-11T08:32:59.838Z caller=net_snmp.go:161 level=info msg="Loading MIBs" from=/usr/local/git/snmp_exporter/generator/mibs:/usr/local/git/snmp_exporter/generator/mibs/H3C/
ts=2023-05-11T08:33:01.879Z caller=main.go:119 level=warn msg="NetSNMP reported parse error(s)" errors=7047
ts=2023-05-11T08:33:02.215Z caller=main.go:51 level=info msg="Generating config for module" module=if_mib
ts=2023-05-11T08:33:02.296Z caller=main.go:66 level=info msg="Generated metrics" module=if_mib metrics=2
ts=2023-05-11T08:33:02.296Z caller=main.go:91 level=info msg="Config written" file=/usr/local/git/snmp_exporter/generator/snmp.yml
snmp.yml
# WARNING: This file was auto-generated using snmp_exporter generator, manual changes will be lost.
if_mib:
walk:
- 1.3.6.1.4.1.25506.2.6.1.1.1.1.6
- 1.3.6.1.4.1.25506.2.6.1.1.1.1.8
metrics:
- name: hh3cEntityExtCpuUsage
oid: 1.3.6.1.4.1.25506.2.6.1.1.1.1.6
type: gauge
help: The CPU usage for this entity - 1.3.6.1.4.1.25506.2.6.1.1.1.1.6
indexes:
- labelname: hh3cEntityExtPhysicalIndex
type: gauge
- name: hh3cEntityExtMemUsage
oid: 1.3.6.1.4.1.25506.2.6.1.1.1.1.8
type: gauge
help: The memory usage for the entity - 1.3.6.1.4.1.25506.2.6.1.1.1.1.8
indexes:
- labelname: hh3cEntityExtPhysicalIndex
type: gauge
version: 2
max_repetitions: 25
retries: 3
timeout: 10s
auth:
community: GQ1HuMUB65eZvR2
2.3 组装snmp.yml
将此内容与官方文件中的if-mib库组合一下
/usr/local/git/snmp_exporter/snmp.yml
if_mib:
auth:
community: GQ1HuMUB65eZvR2
walk:
- 1.3.6.1.2.1.2
- 1.3.6.1.2.1.31.1.1
- 1.3.6.1.4.1.25506.2.6.1.1.1.1.6
- 1.3.6.1.4.1.25506.2.6.1.1.1.1.8
get:
- 1.3.6.1.2.1.1.3.0
metrics:
- name: hh3cEntityExtCpuUsage
oid: 1.3.6.1.4.1.25506.2.6.1.1.1.1.6
type: gauge
help: The CPU usage for this entity - 1.3.6.1.4.1.25506.2.6.1.1.1.1.6
indexes:
- labelname: hh3cEntityExtPhysicalIndex
type: gauge
- name: hh3cEntityExtMemUsage
oid: 1.3.6.1.4.1.25506.2.6.1.1.1.1.8
type: gauge
help: The memory usage for the entity - 1.3.6.1.4.1.25506.2.6.1.1.1.1.8
indexes:
- labelname: hh3cEntityExtPhysicalIndex
type: gauge
- name: sysUpTime
oid: 1.3.6.1.2.1.1.3
type: gauge
help: The time (in hundredths of a second) since the network management portion
of the system was last re-initialized. - 1.3.6.1.2.1.1.3
- name: ifNumber
oid: 1.3.6.1.2.1.2.1
type: gauge
help: The number of network interfaces (regardless of their current state) present
on this system. - 1.3.6.1.2.1.2.1
- name: ifIndex
oid: 1.3.6.1.2.1.2.2.1.1
type: gauge
help: A unique value, greater than zero, for each interface - 1.3.6.1.2.1.2.2.1.1
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: ifAlias
oid: 1.3.6.1.2.1.31.1.1.1.18
type: DisplayString
- labels:
- ifIndex
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- labels:
- ifIndex
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
- name: ifType
oid: 1.3.6.1.2.1.2.2.1.3
type: EnumAsInfo
help: The type of interface - 1.3.6.1.2.1.2.2.1.3
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: ifAlias
oid: 1.3.6.1.2.1.31.1.1.1.18
type: DisplayString
- labels:
- ifIndex
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- labels:
- ifIndex
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
enum_values:
1: other
2: regular1822
3: hdh1822
4: ddnX25
5: rfc877x25
6: ethernetCsmacd
7: iso88023Csmacd
8: iso88024TokenBus
9: iso88025TokenRing
10: iso88026Man
11: starLan
12: proteon10Mbit
13: proteon80Mbit
14: hyperchannel
15: fddi
16: lapb
17: sdlc
18: ds1
19: e1
20: basicISDN
21: primaryISDN
22: propPointToPointSerial
23: ppp
24: softwareLoopback
25: eon
26: ethernet3Mbit
27: nsip
28: slip
29: ultra
30: ds3
31: sip
32: frameRelay
33: rs232
34: para
35: arcnet
36: arcnetPlus
37: atm
38: miox25
39: sonet
40: x25ple
41: iso88022llc
42: localTalk
43: smdsDxi
44: frameRelayService
45: v35
46: hssi
47: hippi
48: modem
49: aal5
50: sonetPath
51: sonetVT
52: smdsIcip
53: propVirtual
54: propMultiplexor
55: ieee80212
56: fibreChannel
57: hippiInterface
58: frameRelayInterconnect
59: aflane8023
60: aflane8025
61: cctEmul
62: fastEther
63: isdn
64: v11
65: v36
66: g703at64k
67: g703at2mb
68: qllc
69: fastEtherFX
70: channel
71: ieee80211
72: ibm370parChan
73: escon
74: dlsw
75: isdns
76: isdnu
77: lapd
78: ipSwitch
79: rsrb
80: atmLogical
81: ds0
82: ds0Bundle
83: bsc
84: async
85: cnr
86: iso88025Dtr
87: eplrs
88: arap
89: propCnls
90: hostPad
91: termPad
92: frameRelayMPI
93: x213
94: adsl
95: radsl
96: sdsl
97: vdsl
98: iso88025CRFPInt
99: myrinet
100: voiceEM
101: voiceFXO
102: voiceFXS
103: voiceEncap
104: voiceOverIp
105: atmDxi
106: atmFuni
107: atmIma
108: pppMultilinkBundle
109: ipOverCdlc
110: ipOverClaw
111: stackToStack
112: virtualIpAddress
113: mpc
114: ipOverAtm
115: iso88025Fiber
116: tdlc
117: gigabitEthernet
118: hdlc
119: lapf
120: v37
121: x25mlp
122: x25huntGroup
123: transpHdlc
124: interleave
125: fast
126: ip
127: docsCableMaclayer
128: docsCableDownstream
129: docsCableUpstream
130: a12MppSwitch
131: tunnel
132: coffee
133: ces
134: atmSubInterface
135: l2vlan
136: l3ipvlan
137: l3ipxvlan
138: digitalPowerline
139: mediaMailOverIp
140: dtm
141: dcn
142: ipForward
143: msdsl
144: ieee1394
145: if-gsn
146: dvbRccMacLayer
147: dvbRccDownstream
148: dvbRccUpstream
149: atmVirtual
150: mplsTunnel
151: srp
152: voiceOverAtm
153: voiceOverFrameRelay
154: idsl
155: compositeLink
156: ss7SigLink
157: propWirelessP2P
158: frForward
159: rfc1483
160: usb
161: ieee8023adLag
162: bgppolicyaccounting
163: frf16MfrBundle
164: h323Gatekeeper
165: h323Proxy
166: mpls
167: mfSigLink
168: hdsl2
169: shdsl
170: ds1FDL
171: pos
172: dvbAsiIn
173: dvbAsiOut
174: plc
175: nfas
176: tr008
177: gr303RDT
178: gr303IDT
179: isup
180: propDocsWirelessMaclayer
181: propDocsWirelessDownstream
182: propDocsWirelessUpstream
183: hiperlan2
184: propBWAp2Mp
185: sonetOverheadChannel
186: digitalWrapperOverheadChannel
187: aal2
188: radioMAC
189: atmRadio
190: imt
191: mvl
192: reachDSL
193: frDlciEndPt
194: atmVciEndPt
195: opticalChannel
196: opticalTransport
197: propAtm
198: voiceOverCable
199: infiniband
200: teLink
201: q2931
202: virtualTg
203: sipTg
204: sipSig
205: docsCableUpstreamChannel
206: econet
207: pon155
208: pon622
209: bridge
210: linegroup
211: voiceEMFGD
212: voiceFGDEANA
213: voiceDID
214: mpegTransport
215: sixToFour
216: gtp
217: pdnEtherLoop1
218: pdnEtherLoop2
219: opticalChannelGroup
220: homepna
221: gfp
222: ciscoISLvlan
223: actelisMetaLOOP
224: fcipLink
225: rpr
226: qam
227: lmp
228: cblVectaStar
229: docsCableMCmtsDownstream
230: adsl2
231: macSecControlledIF
232: macSecUncontrolledIF
233: aviciOpticalEther
234: atmbond
235: voiceFGDOS
236: mocaVersion1
237: ieee80216WMAN
238: adsl2plus
239: dvbRcsMacLayer
240: dvbTdm
241: dvbRcsTdma
242: x86Laps
243: wwanPP
244: wwanPP2
245: voiceEBS
246: ifPwType
247: ilan
248: pip
249: aluELP
250: gpon
251: vdsl2
252: capwapDot11Profile
253: capwapDot11Bss
254: capwapWtpVirtualRadio
255: bits
256: docsCableUpstreamRfPort
257: cableDownstreamRfPort
258: vmwareVirtualNic
259: ieee802154
260: otnOdu
261: otnOtu
262: ifVfiType
263: g9981
264: g9982
265: g9983
266: aluEpon
267: aluEponOnu
268: aluEponPhysicalUni
269: aluEponLogicalLink
270: aluGponOnu
271: aluGponPhysicalUni
272: vmwareNicTeam
277: docsOfdmDownstream
278: docsOfdmaUpstream
279: gfast
280: sdci
281: xboxWireless
282: fastdsl
283: docsCableScte55d1FwdOob
284: docsCableScte55d1RetOob
285: docsCableScte55d2DsOob
286: docsCableScte55d2UsOob
287: docsCableNdf
288: docsCableNdr
289: ptm
290: ghn
291: otnOtsi
292: otnOtuc
293: otnOduc
294: otnOtsig
295: microwaveCarrierTermination
296: microwaveRadioLinkTerminal
297: ieee8021axDrni
298: ax25
299: ieee19061nanocom
300: cpri
- name: ifMtu
oid: 1.3.6.1.2.1.2.2.1.4
type: gauge
help: The size of the largest packet which can be sent/received on the interface,
specified in octets - 1.3.6.1.2.1.2.2.1.4
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: ifAlias
oid: 1.3.6.1.2.1.31.1.1.1.18
type: DisplayString
- labels:
- ifIndex
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- labels:
- ifIndex
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
- name: ifSpeed
oid: 1.3.6.1.2.1.2.2.1.5
type: gauge
help: An estimate of the interface's current bandwidth in bits per second - 1.3.6.1.2.1.2.2.1.5
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: ifAlias
oid: 1.3.6.1.2.1.31.1.1.1.18
type: DisplayString
- labels:
- ifIndex
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- labels:
- ifIndex
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
- name: ifPhysAddress
oid: 1.3.6.1.2.1.2.2.1.6
type: PhysAddress48
help: The interface's address at its protocol sub-layer - 1.3.6.1.2.1.2.2.1.6
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: ifAlias
oid: 1.3.6.1.2.1.31.1.1.1.18
type: DisplayString
- labels:
- ifIndex
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- labels:
- ifIndex
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
- name: ifAdminStatus
oid: 1.3.6.1.2.1.2.2.1.7
type: gauge
help: The desired state of the interface - 1.3.6.1.2.1.2.2.1.7
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: ifAlias
oid: 1.3.6.1.2.1.31.1.1.1.18
type: DisplayString
- labels:
- ifIndex
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- labels:
- ifIndex
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
enum_values:
1: up
2: down
3: testing
- name: ifOperStatus
oid: 1.3.6.1.2.1.2.2.1.8
type: gauge
help: The current operational state of the interface - 1.3.6.1.2.1.2.2.1.8
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: ifAlias
oid: 1.3.6.1.2.1.31.1.1.1.18
type: DisplayString
- labels:
- ifIndex
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- labels:
- ifIndex
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
enum_values:
1: up
2: down
3: testing
4: unknown
5: dormant
6: notPresent
7: lowerLayerDown
- name: ifLastChange
oid: 1.3.6.1.2.1.2.2.1.9
type: gauge
help: The value of sysUpTime at the time the interface entered its current operational
state - 1.3.6.1.2.1.2.2.1.9
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: ifAlias
oid: 1.3.6.1.2.1.31.1.1.1.18
type: DisplayString
- labels:
- ifIndex
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- labels:
- ifIndex
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
- name: ifInOctets
oid: 1.3.6.1.2.1.2.2.1.10
type: counter
help: The total number of octets received on the interface, including framing
characters - 1.3.6.1.2.1.2.2.1.10
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: ifAlias
oid: 1.3.6.1.2.1.31.1.1.1.18
type: DisplayString
- labels:
- ifIndex
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- labels:
- ifIndex
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
- name: ifInUcastPkts
oid: 1.3.6.1.2.1.2.2.1.11
type: counter
help: The number of packets, delivered by this sub-layer to a higher (sub-)layer,
which were not addressed to a multicast or broadcast address at this sub-layer
- 1.3.6.1.2.1.2.2.1.11
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: ifAlias
oid: 1.3.6.1.2.1.31.1.1.1.18
type: DisplayString
- labels:
- ifIndex
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- labels:
- ifIndex
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
- name: ifInNUcastPkts
oid: 1.3.6.1.2.1.2.2.1.12
type: counter
help: The number of packets, delivered by this sub-layer to a higher (sub-)layer,
which were addressed to a multicast or broadcast address at this sub-layer -
1.3.6.1.2.1.2.2.1.12
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: ifAlias
oid: 1.3.6.1.2.1.31.1.1.1.18
type: DisplayString
- labels:
- ifIndex
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- labels:
- ifIndex
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
- name: ifInDiscards
oid: 1.3.6.1.2.1.2.2.1.13
type: counter
help: The number of inbound packets which were chosen to be discarded even though
no errors had been detected to prevent their being deliverable to a higher-layer
protocol - 1.3.6.1.2.1.2.2.1.13
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: ifAlias
oid: 1.3.6.1.2.1.31.1.1.1.18
type: DisplayString
- labels:
- ifIndex
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- labels:
- ifIndex
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
- name: ifInErrors
oid: 1.3.6.1.2.1.2.2.1.14
type: counter
help: For packet-oriented interfaces, the number of inbound packets that contained
errors preventing them from being deliverable to a higher-layer protocol - 1.3.6.1.2.1.2.2.1.14
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: ifAlias
oid: 1.3.6.1.2.1.31.1.1.1.18
type: DisplayString
- labels:
- ifIndex
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- labels:
- ifIndex
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
- name: ifInUnknownProtos
oid: 1.3.6.1.2.1.2.2.1.15
type: counter
help: For packet-oriented interfaces, the number of packets received via the interface
which were discarded because of an unknown or unsupported protocol - 1.3.6.1.2.1.2.2.1.15
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: ifAlias
oid: 1.3.6.1.2.1.31.1.1.1.18
type: DisplayString
- labels:
- ifIndex
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- labels:
- ifIndex
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
- name: ifOutOctets
oid: 1.3.6.1.2.1.2.2.1.16
type: counter
help: The total number of octets transmitted out of the interface, including framing
characters - 1.3.6.1.2.1.2.2.1.16
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: ifAlias
oid: 1.3.6.1.2.1.31.1.1.1.18
type: DisplayString
- labels:
- ifIndex
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- labels:
- ifIndex
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
- name: ifOutUcastPkts
oid: 1.3.6.1.2.1.2.2.1.17
type: counter
help: The total number of packets that higher-level protocols requested be transmitted,
and which were not addressed to a multicast or broadcast address at this sub-layer,
including those that were discarded or not sent - 1.3.6.1.2.1.2.2.1.17
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: ifAlias
oid: 1.3.6.1.2.1.31.1.1.1.18
type: DisplayString
- labels:
- ifIndex
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- labels:
- ifIndex
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
- name: ifOutNUcastPkts
oid: 1.3.6.1.2.1.2.2.1.18
type: counter
help: The total number of packets that higher-level protocols requested be transmitted,
and which were addressed to a multicast or broadcast address at this sub-layer,
including those that were discarded or not sent - 1.3.6.1.2.1.2.2.1.18
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: ifAlias
oid: 1.3.6.1.2.1.31.1.1.1.18
type: DisplayString
- labels:
- ifIndex
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- labels:
- ifIndex
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
- name: ifOutDiscards
oid: 1.3.6.1.2.1.2.2.1.19
type: counter
help: The number of outbound packets which were chosen to be discarded even though
no errors had been detected to prevent their being transmitted - 1.3.6.1.2.1.2.2.1.19
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: ifAlias
oid: 1.3.6.1.2.1.31.1.1.1.18
type: DisplayString
- labels:
- ifIndex
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- labels:
- ifIndex
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
- name: ifOutErrors
oid: 1.3.6.1.2.1.2.2.1.20
type: counter
help: For packet-oriented interfaces, the number of outbound packets that could
not be transmitted because of errors - 1.3.6.1.2.1.2.2.1.20
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: ifAlias
oid: 1.3.6.1.2.1.31.1.1.1.18
type: DisplayString
- labels:
- ifIndex
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- labels:
- ifIndex
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
- name: ifOutQLen
oid: 1.3.6.1.2.1.2.2.1.21
type: gauge
help: The length of the output packet queue (in packets). - 1.3.6.1.2.1.2.2.1.21
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: ifAlias
oid: 1.3.6.1.2.1.31.1.1.1.18
type: DisplayString
- labels:
- ifIndex
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- labels:
- ifIndex
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
- name: ifSpecific
oid: 1.3.6.1.2.1.2.2.1.22
type: OctetString
help: A reference to MIB definitions specific to the particular media being used
to realize the interface - 1.3.6.1.2.1.2.2.1.22
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: ifAlias
oid: 1.3.6.1.2.1.31.1.1.1.18
type: DisplayString
- labels:
- ifIndex
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- labels:
- ifIndex
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
- name: ifInMulticastPkts
oid: 1.3.6.1.2.1.31.1.1.1.2
type: counter
help: The number of packets, delivered by this sub-layer to a higher (sub-)layer,
which were addressed to a multicast address at this sub-layer - 1.3.6.1.2.1.31.1.1.1.2
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: ifAlias
oid: 1.3.6.1.2.1.31.1.1.1.18
type: DisplayString
- labels:
- ifIndex
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- labels:
- ifIndex
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
- name: ifInBroadcastPkts
oid: 1.3.6.1.2.1.31.1.1.1.3
type: counter
help: The number of packets, delivered by this sub-layer to a higher (sub-)layer,
which were addressed to a broadcast address at this sub-layer - 1.3.6.1.2.1.31.1.1.1.3
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: ifAlias
oid: 1.3.6.1.2.1.31.1.1.1.18
type: DisplayString
- labels:
- ifIndex
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- labels:
- ifIndex
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
- name: ifOutMulticastPkts
oid: 1.3.6.1.2.1.31.1.1.1.4
type: counter
help: The total number of packets that higher-level protocols requested be transmitted,
and which were addressed to a multicast address at this sub-layer, including
those that were discarded or not sent - 1.3.6.1.2.1.31.1.1.1.4
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: ifAlias
oid: 1.3.6.1.2.1.31.1.1.1.18
type: DisplayString
- labels:
- ifIndex
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- labels:
- ifIndex
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
- name: ifOutBroadcastPkts
oid: 1.3.6.1.2.1.31.1.1.1.5
type: counter
help: The total number of packets that higher-level protocols requested be transmitted,
and which were addressed to a broadcast address at this sub-layer, including
those that were discarded or not sent - 1.3.6.1.2.1.31.1.1.1.5
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: ifAlias
oid: 1.3.6.1.2.1.31.1.1.1.18
type: DisplayString
- labels:
- ifIndex
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- labels:
- ifIndex
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
- name: ifHCInOctets
oid: 1.3.6.1.2.1.31.1.1.1.6
type: counter
help: The total number of octets received on the interface, including framing
characters - 1.3.6.1.2.1.31.1.1.1.6
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: ifAlias
oid: 1.3.6.1.2.1.31.1.1.1.18
type: DisplayString
- labels:
- ifIndex
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- labels:
- ifIndex
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
- name: ifHCInUcastPkts
oid: 1.3.6.1.2.1.31.1.1.1.7
type: counter
help: The number of packets, delivered by this sub-layer to a higher (sub-)layer,
which were not addressed to a multicast or broadcast address at this sub-layer
- 1.3.6.1.2.1.31.1.1.1.7
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: ifAlias
oid: 1.3.6.1.2.1.31.1.1.1.18
type: DisplayString
- labels:
- ifIndex
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- labels:
- ifIndex
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
- name: ifHCInMulticastPkts
oid: 1.3.6.1.2.1.31.1.1.1.8
type: counter
help: The number of packets, delivered by this sub-layer to a higher (sub-)layer,
which were addressed to a multicast address at this sub-layer - 1.3.6.1.2.1.31.1.1.1.8
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: ifAlias
oid: 1.3.6.1.2.1.31.1.1.1.18
type: DisplayString
- labels:
- ifIndex
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- labels:
- ifIndex
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
- name: ifHCInBroadcastPkts
oid: 1.3.6.1.2.1.31.1.1.1.9
type: counter
help: The number of packets, delivered by this sub-layer to a higher (sub-)layer,
which were addressed to a broadcast address at this sub-layer - 1.3.6.1.2.1.31.1.1.1.9
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: ifAlias
oid: 1.3.6.1.2.1.31.1.1.1.18
type: DisplayString
- labels:
- ifIndex
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- labels:
- ifIndex
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
- name: ifHCOutOctets
oid: 1.3.6.1.2.1.31.1.1.1.10
type: counter
help: The total number of octets transmitted out of the interface, including framing
characters - 1.3.6.1.2.1.31.1.1.1.10
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: ifAlias
oid: 1.3.6.1.2.1.31.1.1.1.18
type: DisplayString
- labels:
- ifIndex
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- labels:
- ifIndex
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
- name: ifHCOutUcastPkts
oid: 1.3.6.1.2.1.31.1.1.1.11
type: counter
help: The total number of packets that higher-level protocols requested be transmitted,
and which were not addressed to a multicast or broadcast address at this sub-layer,
including those that were discarded or not sent - 1.3.6.1.2.1.31.1.1.1.11
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: ifAlias
oid: 1.3.6.1.2.1.31.1.1.1.18
type: DisplayString
- labels:
- ifIndex
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- labels:
- ifIndex
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
- name: ifHCOutMulticastPkts
oid: 1.3.6.1.2.1.31.1.1.1.12
type: counter
help: The total number of packets that higher-level protocols requested be transmitted,
and which were addressed to a multicast address at this sub-layer, including
those that were discarded or not sent - 1.3.6.1.2.1.31.1.1.1.12
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: ifAlias
oid: 1.3.6.1.2.1.31.1.1.1.18
type: DisplayString
- labels:
- ifIndex
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- labels:
- ifIndex
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
- name: ifHCOutBroadcastPkts
oid: 1.3.6.1.2.1.31.1.1.1.13
type: counter
help: The total number of packets that higher-level protocols requested be transmitted,
and which were addressed to a broadcast address at this sub-layer, including
those that were discarded or not sent - 1.3.6.1.2.1.31.1.1.1.13
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: ifAlias
oid: 1.3.6.1.2.1.31.1.1.1.18
type: DisplayString
- labels:
- ifIndex
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- labels:
- ifIndex
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
- name: ifLinkUpDownTrapEnable
oid: 1.3.6.1.2.1.31.1.1.1.14
type: gauge
help: Indicates whether linkUp/linkDown traps should be generated for this interface
- 1.3.6.1.2.1.31.1.1.1.14
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: ifAlias
oid: 1.3.6.1.2.1.31.1.1.1.18
type: DisplayString
- labels:
- ifIndex
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- labels:
- ifIndex
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
enum_values:
1: enabled
2: disabled
- name: ifHighSpeed
oid: 1.3.6.1.2.1.31.1.1.1.15
type: gauge
help: An estimate of the interface's current bandwidth in units of 1,000,000 bits
per second - 1.3.6.1.2.1.31.1.1.1.15
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: ifAlias
oid: 1.3.6.1.2.1.31.1.1.1.18
type: DisplayString
- labels:
- ifIndex
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- labels:
- ifIndex
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
- name: ifPromiscuousMode
oid: 1.3.6.1.2.1.31.1.1.1.16
type: gauge
help: This object has a value of false(2) if this interface only accepts packets/frames
that are addressed to this station - 1.3.6.1.2.1.31.1.1.1.16
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: ifAlias
oid: 1.3.6.1.2.1.31.1.1.1.18
type: DisplayString
- labels:
- ifIndex
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- labels:
- ifIndex
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
enum_values:
1: "true"
2: "false"
- name: ifConnectorPresent
oid: 1.3.6.1.2.1.31.1.1.1.17
type: gauge
help: This object has the value 'true(1)' if the interface sublayer has a physical
connector and the value 'false(2)' otherwise. - 1.3.6.1.2.1.31.1.1.1.17
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: ifAlias
oid: 1.3.6.1.2.1.31.1.1.1.18
type: DisplayString
- labels:
- ifIndex
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- labels:
- ifIndex
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
enum_values:
1: "true"
2: "false"
- name: ifCounterDiscontinuityTime
oid: 1.3.6.1.2.1.31.1.1.1.19
type: gauge
help: The value of sysUpTime on the most recent occasion at which any one or more
of this interface's counters suffered a discontinuity - 1.3.6.1.2.1.31.1.1.1.19
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels:
- ifIndex
labelname: ifAlias
oid: 1.3.6.1.2.1.31.1.1.1.18
type: DisplayString
- labels:
- ifIndex
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
type: DisplayString
- labels:
- ifIndex
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
2.4 启动snmp_exporter服务
systemctl daemon-reload snmp_exporter
systemctl start snmp_exporter
systemctl status snmp_exporter