Ubuntu版本:Ubuntu 14.04.1 LTS
SNMP版本:5.7.2
简短问题:“默认”配置文件中的许多条目已损坏。其实并不重要,因为我什至无法启动SNMP。
期望的结果:我想要一个工作正常的SNMP实例,其中包含尽可能多的默认功能。
注意:从很多来源,包括Canonical拥有的Ubuntu网站,据说我必须修改export
和SNMPDOPTS
才能具有基本功能。
/etc/default/snmpd
export MIBS=UCD-SNMP-MIB
SNMPDRUN=yes
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -g snmp -I -smux -p /var/run/snmpd.pid -c /etc/snmp/snmpd.conf'
TRAPDRUN=no
TRAPDOPTS='-Lsd -p /var/run/snmptrapd.pid'
SNMPDCOMPAT=yes
/etc/snmp/snmpd.conf
view systemonly included .1.3.6.1.2.1.1
view systemonly included .1.3.6.1.2.1.25.1
rocommunity public
rwcommunity nanana
sysLocation vm1-ryd-wlo
sysContact Paul Adams <pauladams@nanana.com>
sysServices 72
disk / 10000
disk /var 5%
load 12 10 5
trapsink localhost public
iquerySecName internalUser
rouser internalUser
master agentx
/var/log/syslog
Oct 3 13:59:51 mdnsreflector-ryd-wlo snmpd[9120]: Server Exiting with code 1
Oct 3 14:00:09 mdnsreflector-ryd-wlo snmpd[9143]: Turning on AgentX master support.
Oct 3 14:00:09 mdnsreflector-ryd-wlo snmpd[9145]: NET-SNMP version 5.7.2
sudo service --status-all
[ + ] snmpd
sudo service ufw status
Status: inactive
即使此配置已加载并且显然正在运行。您实际上无法从远程设备从此SNMP实例查询任何内容。连接最终超时。
从服务器本身查询它不会产生任何结果。
snmpwalk -Os -c public -v 1本地主机系统
system: Unknown Object Identifier (Sub-id not found: (top) -> system)
- 我必须删除“ agentAddress”条目,因为该软件在每次尝试处理该命令时都会不断惊慌。(即使这是默认设置,也应该是它在配置中列出的方式。)
/etc/var/syslog
Oct 3 14:10:32 mdnsreflector-ryd-wlo snmpd[9292]: Turning on AgentX master support.
Oct 3 14:10:32 mdnsreflector-ryd-wlo snmpd[9292]: Turning on AgentX master support.
Oct 3 14:10:32 mdnsreflector-ryd-wlo snmpd[9292]: Error opening specified endpoint "udp:161"
Oct 3 14:10:32 mdnsreflector-ryd-wlo snmpd[9292]: Server Exiting with code 1
sudo服务-状态全部
[ - ] snmpd
- 我必须删除配置中的几个默认条目,因为它们在运行它们时也会引起错误。
/etc/snmp/snmpd.conf
proc mount
proc ntalkd 4
proc sendmail 10 1
includeAllDisks 10%
extend test1 /bin/echo Hello, world!
extend-sh test2 echo Hello, world! ; echo Hi there ; exit 35
/ var / log / syslog
Oct 3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: /etc/snmp/snmpd.conf: line 90: Error: Already have an entry for this process.
Oct 3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: /etc/snmp/snmpd.conf: line 92: Error: Already have an entry for this process.
Oct 3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: /etc/snmp/snmpd.conf: line 94: Error: Already have an entry for this process.
Oct 3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: /etc/snmp/snmpd.conf: line 106: Error: includeAllDisks already specified.
Oct 3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: /etc/snmp/snmpd.conf: line 106: Error: #011ignoring: includeAllDisks 10%
Oct 3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: /etc/snmp/snmpd.conf: line 146: Error: duplicate trigger name
Oct 3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: message repeated 6 times: [ /etc/snmp/snmpd.conf: line 146: Error: duplicate trigger name]
Oct 3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: /etc/snmp/snmpd.conf: line 148: Error: duplicate trigger name
Oct 3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: /etc/snmp/snmpd.conf: line 148: Error: duplicate trigger name
Oct 3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: duplicate table data attempted to be entered. row exists
Oct 3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: Failed to register extend entry 'test1' - possibly duplicate name.
Oct 3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: duplicate table data attempted to be entered. row exists
Oct 3 10:51:11 mdnsreflector-ryd-wlo snmpd[7575]: Failed to register extend entry 'test2' - possibly duplicate name.