SNMP(简单网络管理协议),由一组网络管理的标准组成,包含一个应用层协议(application layer protocol)、数据库模型(database schema)和一组资源对象. 在开源监控系统中主要针对硬件的监控,比如:交换机,路由器,打印机以及网络流量.是简单网络管理协议。
环境:
linux-node1.example.com CentOS release 6.7 zabbix-sender-3.0.31-1.el6.x86_64
linux-node1.example.com CentOS release 6.7
安装snmp
[[email protected] ~]# yum install -y net-snmp net-snmp-libs net-snmp-utils
[[email protected] ~]# cd /etc/snmp/
[[email protected] snmp]# ls
snmpd.conf snmptrapd.conf
修改snmp配置文件
[[email protected] snmp]# vim snmpd.conf
[[email protected] snmp]# grep ‘1’ /etc/snmp/snmpd.conf
com2sec admin default admin
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 [email protected] (configure /etc/snmp/snmp.local.conf)
dontLogTCPWrappersConnects yes
[[email protected] snmp]# service snmpd start
Starting snmpd: [ OK ]
确认下端口是否开启
[[email protected] snmp]# netstat -nulp | grep 161 —161 正确
udp 0 0 0.0.0.0:161 0.0.0.0:*
这条命令是看系统一分钟的负载
[[email protected] snmp]# snmpget -v2c -c admin 10.0.0.15 .1.3.6.1.4.1.2021.10.1.3.1
UCD-SNMP-MIB::laLoad.1 = STRING: 0.00
这条命令是看三个时间的负载 这里也只是举例
[[email protected] snmp]# snmpwalk -v2c -c admin 10.0.0.15 .1.3.6.1.4.1.2021.10.1.3
UCD-SNMP-MIB::laLoad.1 = STRING: 0.07
UCD-SNMP-MIB::laLoad.2 = STRING: 0.02
UCD-SNMP-MIB::laLoad.3 = STRING: 0.00
zabbix 图形配置SNMP
添加模版
制作宏
SNMP 绿色就代表成功。
-
a-Z ↩︎