ubuntu SNMP通信失败

jhkqcmku  于 2023-04-11  发布在  其他
关注(0)|答案(1)|浏览(202)

我刚刚在ubuntu服务器[12.04.4 LTS]上安装了SNMP进行监控,我已经连续8天与此斗争,没有运气!我确信我已经正确安装和配置了SNMP,但是当试图从另一台机器上SNMP行走此服务器时,我得到一个超时响应。我在snmpwalk命令中使用的是2c版本,并且我知道我使用的是正确的字符串'public'。在两者之间没有防火墙或防火墙规则。下面是我的snmpd.conf文件[出于安全原因,我已经用X的IP替换了我的原始IP]

####### sec.name source               community
com2sec permitted 127.0.0.1             public     # Localhost
com2sec permitted xx xx.xx.xxxx         public     # Home Insight Connection
############### sec.model sec.name
group   roGroup v1      permitted
group   roGroup v2c     permitted

############### incl/excl subtree
view    all     included  .1

############### ctx sec.model sec.level   prefix read write notify

access  roGroup ""  any       noauth      exact  all  none  none

下面是我的/etc/default/snmpd文件

# This file controls the activity of snmpd and snmptrapd

# Don't load any MIBs by default.
# You might comment this lines once you have the MIBs downloaded.
export MIBS=

# snmpd control (yes means start daemon).
SNMPDRUN=yes

# snmpd options (use syslog, close stdin/out/err).

SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -g snmp -I -smux -p /var/run/snmpd.pid'

# snmptrapd control (yes means start daemon).  As of net-snmp version
# 5.0, master agentx support must be enabled in snmpd before snmptrapd
# can be run.  See snmpd.conf(5) for how to do this.
TRAPDRUN=no

# snmptrapd options (use syslog).
TRAPDOPTS='-Lsd -p /var/run/snmptrapd.pid'

# create symlink on Debian legacy location to official RFC path
SNMPDCOMPAT=yes

我的IPTABLE规则是空的。我甚至停止了服务,但运气不好

root@dws411:/etc/default# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

我检查了/etc/目录下的host.allow和host.deny文件。这两个文件也是空的。我真的希望有人能帮我解决这个问题。我已经没有办法了。

sd2nnvve

sd2nnvve1#

agentaddress udp:161在snmpd.conf中添加此内容

相关问题