共计 3526 个字符,预计需要花费 9 分钟才能阅读完成。
SNMP(简单网络管理协议), 由一组网络管理的标准组成,包含一个 应用层 协议(application layer protocol)、数据库模型(database schema)和一组资源对象. 在开源监控系统中主要针对硬件的监控, 比如: 交换机, 路由器, 打印机以及网络流量.
1. 安装 SNMP 协议(zabbix 已安装好)
[root@db02 ~]# yum install net-snmp -y
[root@db02 ~]# vim /etc/snmp/snmpd.conf
view systemview included . #添加这行
proc mountd #去掉前面注释
proc ntalkd 4 # 去掉前面注释
proc sendmail 10 1 #去掉前面注释
disk / 10000 #去掉前面注释
load 12 14 14 #去掉前面注释
[root@db02 ~]# /etc/init.d/snmpd restart
Stopping snmpd: [OK]
Starting snmpd: [OK]
[root@db02 ~]# netstat -antulp | grep 161
udp 0 0 0.0.0.0:161 0.0.0.0:* 26382/snmpd
[root@db02 ~]# snmpwalk -v 2c -c public localhost . #查看所有的对像
SNMPv2-MIB::sysDescr.0 = STRING: Linux db02 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64
SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (2587) 0:00:25.87
SNMPv2-MIB::sysContact.0 = STRING: Root <root@localhost> (configure /etc/snmp/snmp.local.conf)
SNMPv2-MIB::sysName.0 = STRING: db02
SNMPv2-MIB::sysLocation.0 = STRING: Unknown (edit /etc/snmp/snmpd.conf)
SNMPv2-MIB::sysORLastChange.0 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORID.1 = OID: SNMP-MPD-MIB::snmpMPDMIBObjects.3.1.1
SNMPv2-MIB::sysORID.2 = OID: SNMP-USER-BASED-SM-MIB::usmMIBCompliance
SNMPv2-MIB::sysORID.3 = OID: SNMP-FRAMEWORK-MIB::snmpFrameworkMIBCompliance
SNMPv2-MIB::sysORID.4 = OID: SNMPv2-MIB::snmpMIB
SNMPv2-MIB::sysORID.5 = OID: TCP-MIB::tcpMIB
SNMPv2-MIB::sysORID.6 = OID: IP-MIB::ip
SNMPv2-MIB::sysORID.7 = OID: UDP-MIB::udpMIB
SNMPv2-MIB::sysORID.8 = OID: SNMP-VIEW-BASED-ACM-MIB::vacmBasicGroup
SNMPv2-MIB::sysORDescr.1 = STRING: The MIB for Message Processing and Dispatching.
SNMPv2-MIB::sysORDescr.2 = STRING: The MIB for Message Processing and Dispatching.
SNMPv2-MIB::sysORDescr.3 = STRING: The SNMP Management Architecture MIB.
SNMPv2-MIB::sysORDescr.4 = STRING: The MIB module for SNMPv2 entities
SNMPv2-MIB::sysORDescr.5 = STRING: The MIB module for managing TCP implementations
SNMPv2-MIB::sysORDescr.6 = STRING: The MIB module for managing IP and ICMP implementations
SNMPv2-MIB::sysORDescr.7 = STRING: The MIB module for managing UDP implementations
SNMPv2-MIB::sysORDescr.8 = STRING: View-based Access Control Model for SNMP.
SNMPv2-MIB::sysORUpTime.1 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.2 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.3 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.4 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.5 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.6 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.7 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.8 = Timeticks: (0) 0:00:00.00
HOST-RESOURCES-MIB::hrSystemUptime.0 = Timeticks: (888406334) 102 days, 19:47:43.34
HOST-RESOURCES-MIB::hrSystemUptime.0 = No more variables left in this MIB View (It is past the end of the MIB tree)
[root@db02 ~]# snmpwalk -v 2c -c public localhost -On . #以 OID 形势显示
2. 在 zabbix 添加 snmp 监控
(1). 添加 snmp 协议
(2)观察 snmp 协议图标是否变亮
(3). 添加项目和触发器
(4)绘图
3. 查看监控状态
Ubuntu 安装 snmp 报 Unlinked OID in IPATM-IPMC-MIB: marsMIB ::= {mib-2 57}错误 http://www.linuxidc.com/Linux/2015-08/122508.htm
使用 SNMP 和 Cacti 监控 Linux 服务器 http://www.linuxidc.com/Linux/2015-07/119471.htm
在 Ubuntu 14.04 上配置 SNMPv3 http://www.linuxidc.com/Linux/2014-10/108511.htm
Zabbix 之 SNMP 配置 http://www.linuxidc.com/Linux/2013-09/90263.htm
SNMP 实现网络动态分析 http://www.linuxidc.com/Linux/2013-04/83514.htm
SNMP 实现网络状态监控 http://www.linuxidc.com/Linux/2013-04/83187.htm
CentOS 6.3 下搭建 SNMP 测试环境 http://www.linuxidc.com/Linux/2013-02/79233.htm
Linux (Ubuntu/CentOS) SNMP 配置 http://www.linuxidc.com/Linux/2012-12/76837.htm
开启并配置 Citrix Xenserver 的 SNMP 服务 http://www.linuxidc.com/Linux/2013-01/78487.htm
本文永久更新链接地址:http://www.linuxidc.com/Linux/2016-04/130746.htm