- 论坛徽章:
- 0
|
本帖最后由 haitianguyan102 于 2014-06-20 16:05 编辑
简述:一台机器上配置了net-snmp,却无法远程采集数据,日志显示有远程主机的连接记录,网络连接没有问题,防火墙设置没有问题。但在 snmp agent 端执行完全相同的命令却可以获取到数据。
因为要配置监控宝监控,在一台机器(__机器A__)上配置net-snmp,配置如下-
- com2sec notConfigUser default ibccdg
- 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)
- pass .1.3.6.1.4.1.4413.4.1 /usr/bin/ucd5820stat
- rouser jkb
复制代码 其实要求的是使用 SNMPv3,所以前面5行配置应该可以去掉吧。我在该机器上执行-
- # snmpwalk -v 3 -l authNoPriv -a MD5 -u user -A password 124.211.X.X:161 sysDescr
- SNMPv2-MIB::sysDescr.0 = STRING: Linux localhost.localdomain 2.6.18-238.el5 #1 SMP Thu Jan 13 15:51:15 EST 2011 x86_64
复制代码 可以正常得到结果,但监控宝无法取得数据,使用自己手边的Linux机器执行上述相同命令(为了保持一致,上面的命令指定agent 地址时使用的是机器的公网IP),结果却返回-
- No log handling enabled - turning on stderr logging
- snmpwalk: Timeout (Sub-id not found: (top) -> sysDescr)
复制代码 的错误,监控宝的SNMP诊断工具返回的也是同样的错误。即使将防火墙关闭问题也依旧。SELinux 未启用。另外一台机器(__机器B__)上配置的net-snmp则没有这种问题,甚至我将机器B上的配置文件(/etc/snmp/snmpd.conf 和 /var/net-snmp 下的配置文件)都拷贝过来,确保两台机器使用的是相同的配置(包括用户),问题依旧,在机器A上执行可以获取结果,在其它机器上同样的命令则无法通过SNMP获取机器A数据,返回- "snmpwalk: Timeout (Sub-id not found: (top) -> sysDescr)"
复制代码 的错误,使用 SNMPv2 获取数据则返回的错误信息是- "snmp Timeout: No Response from X.X.X.X"
复制代码 其它信息,机器B上的软件信息是-
- -bash-3.2# rpm -qa | grep snmp
- net-snmp-5.3.2.2-17.el5_8.1
- net-snmp-devel-5.3.2.2-17.el5_8.1
- net-snmp-libs-5.3.2.2-17.el5_8.1
- net-snmp-devel-5.3.2.2-17.el5_8.1
- net-snmp-libs-5.3.2.2-17.el5_8.1
- net-snmp-utils-5.3.2.2-17.el5_8.1
- -bash-3.2# ls /var/net-snmp/
- snmpd.conf
- -bash-3.2# ls /var/net-snmp/ -a
- . .. snmpd.conf .snmp-exec-cache
- -bash-3.2# cat /etc/redhat-release
- CentOS release 5.6 (Final)
复制代码 机器A上软件信息是-
- [root@localhost snmp]# rpm -qa | grep snmp
- net-snmp-libs-5.3.2.2-20.el5
- net-snmp-libs-5.3.2.2-20.el5
- net-snmp-devel-5.3.2.2-20.el5
- net-snmp-utils-5.3.2.2-20.el5
- net-snmp-5.3.2.2-20.el5
- net-snmp-devel-5.3.2.2-20.el5
- [root@localhost snmp]# cat /etc/redhat-release
- CentOS release 5.10 (Final)
- [root@localhost snmp]#
复制代码 我使用 snmpd -f -Le 调试,也没看到异常信息,除了-
- Duplicate IP address detected, some interfaces may not be visible in IP-MIB
复制代码 我不太清楚这是什么意思,机器A上 eth0 上配置了一个子接口 eth0:1, 所以 eth0 上有两个IP。
Any help would be appreciated ! |
|