由于某些设备并不能安装 Agent,或者不方便安装 Agent 等因素,将采用 SNMP 方式进行监控
1、Linux 配置 SNMP
[root@crazy-acong ~]# yum -y install net-snmp
2、配置 snmp 配置文件
# snmp 原配置文件[root@crazy-acong ~]# egrep -v "^#|^$" /etc/snmp/snmpd.confcom2sec notConfigUser default publicgroup notConfigGroup v1 notConfigUsergroup notConfigGroup v2c notConfigUserview systemview included .1.3.6.1.2.1.1view systemview included .1.3.6.1.2.1.25.1.1access notConfigGroup "" any noauth exact systemview none nonesyslocation Unknown (edit /etc/snmp/snmpd.conf)syscontact Root(configure /etc/snmp/snmp.local.conf)dontLogTCPWrappersConnects yes
# 修改后的配置文件[root@crazy-acong ~]# cat /etc/snmp/snmpd.confcom2sec mynetwork 192.168.1.105 public_monitorcom2sec mynetwork 127.0.0.1 publicgroup MyROGroup v2c mynetworkaccess MyROGroup "" any noauth prefix all none noneview all included .1 80
3、启动 snmp 服务
[root@crazy-acong ~]# /etc/init.d/snmpd start[root@crazy-acong ~]# netstat -lnpt | grep snmptcp 0 0 127.0.0.1:199 0.0.0.0:* LISTEN 1550/snmpd [root@crazy-acong ~]# chkconfig snmpd on