Blogger Information
Blog 60
fans 0
comment 0
visits 66646
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
【Zabbix】Zabbix基于SNMP监控配置
大宝
Original
797 people have browsed it

参考链接

阿里巴巴开源镜像站-OPSX镜像站-阿里云开发者社区 (aliyun.com)

zabbix镜像-zabbix下载地址-zabbix安装教程-阿里巴巴开源镜像站 (aliyun.com)

9. Web监控 (zabbix.com)

SNMP:简单网络管理协议

三种通信方式:读(get,getnext),写(set),trap(陷阱)

端口:161/udp 162/udp

SNMP协议

监控网络设备:交换机、路由器

MIB:Management Information Base信息管理基础

OID:Object ID 对象ID

1、下载安装SNMP包

  1. [root@zabbix-server ~]# yum install net-snmp net-snmp-utils

image-20220215221305687

2、修改snmpd.conf配置文件

配置文件:定义ACL访问控制

  1. [root@zabbix-server ~]# vim /etc/snmp/snmpd.conf
  2. #定义认证符,将社区名称"public"映射为"安全名称"
  3. # sec.name source community
  4. com2sec notConfigUser default public
  5. #将安全名称映射到一个组名
  6. # groupName securityModel securityName
  7. group notConfigGroup v1 notConfigUser
  8. group notConfigGroup v2c notConfigUser
  9. #为我们创建一个视图,让我们的团队有权利
  10. view systemview included .1.3.6.1.2.1.1
  11. view systemview included .1.3.6.1.2.1.2 #网络接口的相关数据
  12. view systemview included .1.3.6.1.4.1.2021 # 系统资源负载,memory、disk io、cpu load
  13. view systemview included .1.3.6.1.2.1.25
  14. +__________________________________+
  15. 掩码:.1.3.6.1.2.1.
  16. 1.1.0:系统描述信息,SysDesc
  17. 1.3.0:监控时间,SysUptime
  18. 1.5.0:主机名,SysName
  19. 1.7.0:主机提供的服务,SysService
  20. 掩码:.1.3.6.1.2.2.
  21. 2.1.0:网络接口数目
  22. 2.2.1.2:网络接口的描述信息
  23. 2.2.1.3:网络接口类型
  24. +__________________________________+
  25. # 授权对systemview视图只读访问权限
  26. ####
  27. # Finally, grant the group read-only access to the systemview view.
  28. # group context sec.model sec.level prefix read write notif
  29. access notConfigGroup "" any noauth exact systemview none none

image-20220215222033184

3、启动SNMP服务

  1. [root@zabbix-server ~]# systemctl start snmpd #被监视端开启的服务
  2. [root@zabbix-server ~]# systemctl enable snmpd
  3. [root@zabbix-server ~]# systemctl start snmptrapd #监视端口开启的服务(如果允许被监视端启动主动监控时启用)
  4. [root@zabbix-server ~]# systemctl enable snmptrapd
  5. [root@zabbix-server ~]# systemctl status snmptrapd

4、测试SNMP监控是否生效

  1. # 在zabbix服务端进行测试
  2. [root@zabbix-server ~]# snmpget -v 2c -c public 192.168.200.60 .1.3.6.1.2.1.1.3.0
  3. DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (30223) 0:05:02.23
  4. [root@zabbix-server ~]# snmpget -v 2c -c public 192.168.200.60 .1.3.6.1.2.1.1.5.0
  5. SNMPv2-MIB::sysName.0 = STRING: zabbix-server

5、在监控页面,对应主机上添加SNMP接口和模板

image-20220215224210401

image-20220215225123861

image-20220215225208287

image-20220215225223709

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post