centos里启用snmp的监控

    yum install net-snmp net-snmp-devel -y

    /etc/init.d/snmpd stop

    net-snmp-config –create-snmpv3-user -ro -A 密码 -a MD5 用户名

    /etc/init.d/snmpd start

    密码要超过8位



[root@zhudoubaby ~]# net-snmp-config --create-snmpv3-user -ro
Enter a SNMPv3 user name to create:
test
Enter authentication pass-phrase:
net-snmp-config
Enter encryption pass-phrase:
  [press return to reuse the authentication pass-phrase]
net-snmp-config
adding the following line to /var/net-snmp/snmpd.conf:
   createUser zhudou MD5 "netsnmp$#config" DES netsnmp$#config
adding the following line to /etc/snmp/snmpd.conf:
   rouser test
[root@zhudoubaby ~]# service snmpd start




有防火墙的情况下,得把udp 161 端口打开了


[root@zhudoubaby ~]# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
RH-Firewall-1-INPUT  all  --  anywhere             anywhere            

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
RH-Firewall-1-INPUT  all  --  anywhere             anywhere            

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

Chain RH-Firewall-1-INPUT (2 references)
target     prot opt source               destination         
 
ACCEPT     udp  --  anywhere             anywhere            state NEW udp dpt:snmp    (必须的
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:smtp  (不用)
 



/etc/sysconfig/iptables

转载于:https://www.cnblogs.com/peter9/archive/2011/11/02/2362148.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值