centos8 部署zabbix-SNMP监控

简单网络管理协议

1.安装snmp监控程序

systemctl disable --now firewalld    # 关闭防火墙

yum -y install net-snmp net-snmp-utils    # 安装snmp

2.开启snmp配置

# 在这配置文件的第57行加入配置信息,执行下在这条命令就行

sed -i.ori '57a view systemview   included   .1' /etc/snmp/snmpd.conf

或手动编辑在57行下在添加
    vi /etc/snmp/snmpd.conf

     44 # Second, map the security name into a group name:
     45 
     46 #       groupName      securityModel securityName
     47 group   notConfigGroup v1           notConfigUser
     48 group   notConfigGroup v2c           notConfigUser
     49 
     50 ####
     51 # Third, create a view for us to let the group have rights to:
     52 
     53 # Make at least  snmpwalk -v 1 localhost -c public system fast again.
     54 #       name           incl/excl     subtree         mask(optional)
     55 view    systemview    included   .1.3.6.1.2.1.1
     56 view    systemview    included   .1.3.6.1.2.1.25.1.1
     57 
     58 view systemview   included   .1        # 添加这一行
     59 ####
     60 # Finally, grant the group read-only access to the systemview view.

centos8 部署zabbix-SNMP监控_第1张图片

启动snmp服务

systemctl start snmpd.service

通过snmp命令获取主机名,获取成功就可以用snmp监控了

# -v 指定协议版本 -c 指定暗号  sysname  snmp的key

snmpwalk -v 2c  -c public 192.168.12.48 sysname

 

你可能感兴趣的:(zabbix,zabbux-snmp监控,centos8)