Zabbix 4.4试用(五):通过SNMP监控CentOS7服务器

通过SNMP来监控LINUX服务器,首先在CENTOS服务器上安装SNMP,如下:

[root@localhost ~]# yum -y install net-snmp net-snmp-utils
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
  * base: mirrors.cn99.com
  * extras: mirrors.nju.edu.cn
  * updates: mirrors.nju.edu.cn
base

[root@localhost ~]# rpm -qa | grep snmp
net-snmp-libs-5.7.2-43.el7_7.3.x86_64
net-snmp-5.7.2-43.el7_7.3.x86_64
net-snmp-utils-5.7.2-43.el7_7.3.x86_64
net-snmp-agent-libs-5.7.2-43.el7_7.3.x86_64

zabbix4.4config_20

zabbix4.4config_21

通过snmpd -v查看SNMP版本:

[root@localhost ~]# snmpd -v

NET-SNMP version:  5.7.2
Web:               http://www.net-snmp.org/
Email:             net-snmp-coders@lists.sourceforge.net

[root@localhost ~]#

zabbix4.4config_22

开始更改团体名,更改为lsywsnmp123:

[root@localhost ~]# vi /etc/snmp/snmpd.conf

com2sec notConfigUser  default       public

更改为

com2sec notConfigUser  default       lsywsnmp123

重启SNMP服务,并设置为开机启动,如下:

[root@localhost ~]# systemctl start snmpd.service
[root@localhost ~]#
[root@localhost ~]# systemctl enable snmpd.service
Created symlink from /etc/systemd/system/multi-user.target.wants/snmpd.service to /usr/lib/systemd/system/snmpd.service.
[root@localhost ~]#
[root@localhost ~]#

zabbix4.4config_23

接着开始ZABBIX端的设置,添加这台CENTOS服务器:

zabbix4.4config_24

模块设置:

zabbix4.4config_27

设置宏中的团体名

zabbix4.4config_26

完成后,清单中已有服务器,SNMP监控也显示绿色,正常。

zabbix4.4config_28

Leave a Reply