SNMP 监控方式的配置

由于某些设备并不能安装 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.conf
com2sec notConfigUser  default       public
group   notConfigGroup v1           notConfigUser
group   notConfigGroup v2c           notConfigUser
view    systemview    included   .1.3.6.1.2.1.1
view    systemview    included   .1.3.6.1.2.1.25.1.1
access  notConfigGroup ""      any       noauth    exact  systemview none none
syslocation Unknown (edit /etc/snmp/snmpd.conf)
syscontact Root <root@localhost> (configure /etc/snmp/snmp.local.conf)
dontLogTCPWrappersConnects yes
# 修改后的配置文件
[root@crazy-acong ~]# cat /etc/snmp/snmpd.conf
com2sec mynetwork 192.168.1.105 public_monitor
com2sec mynetwork 127.0.0.1 public
group MyROGroup v2c mynetwork
access MyROGroup "" any noauth prefix all none none
view all included .1 80

 

3、启动 snmp 服务

[root@crazy-acong ~]# /etc/init.d/snmpd  start
[root@crazy-acong ~]# netstat -lnpt | grep snmp
tcp        0      0 127.0.0.1:199               0.0.0.0:*                   LISTEN      1550/snmpd  

[root@crazy-acong ~]# chkconfig snmpd on

 

posted on 2017-03-17 11:26  奋斗中的码农  阅读(1387)  评论(0编辑  收藏  举报

导航