zabbix_SMNP监控

Linux环境信息

[root@linux-node1 ~]# cat /etc/redhat-release 
CentOS Linux release 7.2.1511 (Core) 

[root@linux-node1 ~]# cat /etc/hosts
192.168.56.11 linux-node1 linux-node1.example.com
192.168.56.12 linux-node2 linux-node2.example.com

[root@linux-node1 ~]# ip a | grep .11
    inet 192.168.56.11/24 brd 192.168.56.255 scope global eth0
    inet 172.16.0.11/24 brd 172.16.0.255 scope global eth1

安装:

yum install -y net-snmp net-snmp-libs net-snmp-utils

配置:

 40 #       sec.name  source          community
 41 com2sec notConfigUser  default       admin
 42 
 43 ####
 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
 56 view    systemview    included   .1.3.6.1.2.1.1
 57 view    systemview    included   .1.3.6.1.2.1.25.1.1
 58 
 59 ####
 60 # Finally, grant the group read-only access to the systemview view.
 61 
 62 #       group          context sec.model sec.level prefix read   write  notif
 63 access  notConfigGroup ""      any       noauth    exact  systemview none none
 64 
 65 # -----------------------------------------------------------------------------
强哥
com2sec admin  default       admin
group   admin v2c           admin
view    admin         included   .1 80
access  admin ""      any       noauth    exact  admin admin none
班长
[root@linux-node1 ~]# grep "^[a-Z]" /etc/snmp/snmpd.conf
com2sec admin  default      admin 
group   notConfigGroup v1           notConfigUser
group   admin v2c           admin
view    admin         included   .1 80
access  admin ""      any       noauth    exact  admin admin none
syslocation Unknown (edit /etc/snmp/snmpd.conf)
syscontact Root <root@localhost> (configure /etc/snmp/snmp.local.conf)
dontLogTCPWrappersConnects yes
可以实现

启动:

[root@linux-node1 snmp]#systemctl start snmpd

[root@linux-node1 snmp]# netstat -nulp | grep 161
udp        0      0 0.0.0.0:161             0.0.0.0:*                           71649/snmpd         

负载信息

[root@linux-node1 ~]# w
 07:17:04 up  1:53,  2 users,  load average: 0.06, 0.07, 0.05
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
root     pts/0    192.168.56.1     05:26    5:12   0.99s  0.99s -bash
root     pts/1    192.168.56.1     07:13    0.00s  0.17s  0.00s w
[root@linux-node1 ~]# snmpget -v2c -c admin 192.168.56.11 .1.3.6.1.4.1.2021.10.1.3.1
UCD-SNMP-MIB::laLoad.1 = STRING: 0.06
[root@linux-node1 ~]# snmpget -v2c -c admin 192.168.56.11 .1.3.6.1.4.1.2021.10.1.3.2
UCD-SNMP-MIB::laLoad.2 = STRING: 0.07
[root@linux-node1 ~]# snmpget -v2c -c admin 192.168.56.11 .1.3.6.1.4.1.2021.10.1.3.3
UCD-SNMP-MIB::laLoad.3 = STRING: 0.05
系统负载
[root@linux-node1 ~]# w
 07:24:33 up  2:00,  1 user,  load average: 0.13, 0.20, 0.13
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
root     pts/0    192.168.56.1     05:26    1.00s  1.01s  0.00s w
[root@linux-node1 ~]# snmpwalk -v2c -c admin 192.168.56.11 .1.3.6.1.4.1.2021.10.1.3
UCD-SNMP-MIB::laLoad.1 = STRING: 0.13
UCD-SNMP-MIB::laLoad.2 = STRING: 0.20
UCD-SNMP-MIB::laLoad.3 = STRING: 0.13
全部显示

SNMP常用负载

 

必须把描述写清楚方便管理

选择模版

 

posted @ 2017-10-29 13:12  reborn枪  阅读(617)  评论(0)    收藏  举报