Zabbix的SNMP监控

server端安装 
        yum install net-snmp-util
        yum install net-snmp
 
被监控端安装
        yum install net-snmp
 
 
被监控端编辑配置文件
####
# First, map the community name "public" into a "security name"

#       sec.name  source          community
com2sec notConfigUser  default       public

####
# Second, map the security name into a group name:

#       groupName      securityModel securityName
group   notConfigGroup v1           notConfigUser
group   notConfigGroup v2c           notConfigUser

####
# Third, create a view for us to let the group have rights to:

# Make at least  snmpwalk -v 1 localhost -c public system fast again.
#       name           incl/excl     subtree         mask(optional)
view    systemview    included   .1.3.6.1.2.1.1
view    systemview    included   .1.3.6.1.2.1.25.1.1
view    systemview    included   .1.3.6.1.2.1.2
view    systemview    included   .1.3.6.1.4.1.2021

####
# Finally, grant the group read-only access to the systemview view.

#       group          context sec.model sec.level prefix read   write  notif
access  notConfigGroup ""      any       noauth    exact  systemview none none
.1.3.6.1.4.1.2021树状数据查看对照表
 
被监控端启动服务
[root@be-controlled ~]# systemctl start snmpd
 
查看端口监听
[root@be-controlled ~]# ss -unl
State      Recv-Q Send-Q                                    Local Address:Port                                                   Peer Address:Port              
UNCONN     0      0                                             127.0.0.1:323                                                               *:*                  
UNCONN     0      0                                                     *:161                                                               *:*                  
UNCONN     0      0                                                   ::1:323                                                              :::*
 
 
 
服务端测试
[root@zabbix-server zabbix]# snmpget -v 2c -c public be-controlled .1.3.6.1.2.1.1.1.0
SNMPv2-MIB::sysDescr.0 = STRING: Linux be-controlled 3.10.0-862.el7.x86_64 #1 SMP Fri Apr 20 16:44:24 UTC 2018 x86_64
 
成功!
posted @ 2020-09-23 11:50  Edward_han  阅读(109)  评论(0编辑  收藏  举报