/usr/local/share/snmp/snmpd.conf:第 5 行:错误:未知的有效载荷 OID

/usr/local/share/snmp/snmpd.conf:第 5 行:错误:未知的有效载荷 OID

使用带有 net-snmp snmp 的 ubuntu 可以工作,但在 sys.log 中我看到很多有关 snmpd.conf 的错误

snmpd配置文件

rwcommunity community 10.0.0.1
rwcommunity community 10.0.0.2
agentAddress  udp:10.0.0.1:161

view   systemonly  included   .1.3.6.1.2.1.1
view   systemonly  included   .1.3.6.1.2.1.25.1


                                                 #  Default access to basic system info
rocommunity public  default    -V systemonly

rouser   authOnlyUser

sysLocation    Sitting on the Dock of the Bay
sysContact     Me <[email protected]>

sysServices    72

proc  mountd                          
proc  ntalkd    4                        
proc  sendmail 10 1

disk       /     10000
disk       /var  5%
includeAllDisks  10%

load   12 10 5

trapsink     localhost public

iquerySecName   internalUser       
rouser          internalUser

defaultMonitors          yes

linkUpDownNotifications  yes

master          agentx

错误

Sep 12 16:35:00 test snmpd[5485]: payload OID: prNames
Sep 12 16:35:00 test snmpd[5485]: /usr/local/share/snmp/snmpd.conf: line 5: Error: unknown payload OID
Sep 12 16:35:00 test snmpd[5485]: Unknown payload OID: prNames
Sep 12 16:35:00 test snmpd[5485]: /usr/local/share/snmp/snmpd.conf: line 5: Error: Unknown payload OID
Sep 12 16:35:00 test snmpd[5485]: payload OID: prErrMessage
Sep 12 16:35:00 test snmpd[5485]: /usr/local/share/snmp/snmpd.conf: line 5: Error: unknown payload OID
Sep 12 16:35:00 test snmpd[5485]: Unknown payload OID: prErrMessage
Sep 12 16:35:00 test snmpd[5485]: /usr/local/share/snmp/snmpd.conf: line 5: Error: Unknown payload OID
Sep 12 16:35:00 test snmpd[5485]: trigger OID: prErrorFlag
Sep 12 16:35:00 test snmpd[5485]: /usr/local/share/snmp/snmpd.conf: line 5: Error: unknown monitor OID
Sep 12 16:35:00 test snmpd[5485]: payload OID: memErrorName
Sep 12 16:35:00 test snmpd[5485]: /usr/local/share/snmp/snmpd.conf: line 5: Error: unknown payload OID
Sep 12 16:35:00 test snmpd[5485]: Unknown payload OID: memErrorName
Sep 12 16:35:00 test snmpd[5485]: /usr/local/share/snmp/snmpd.conf: line 5: Error: Unknown payload OID
Sep 12 16:35:00 test snmpd[5485]: payload OID: memSwapErrorMsg
Sep 12 16:35:00 test snmpd[5485]: /usr/local/share/snmp/snmpd.conf: line 5: Error: unknown payload OID
Sep 12 16:35:00 test snmpd[5485]: Unknown payload OID: memSwapErrorMsg
Sep 12 16:35:00 test snmpd[5485]: /usr/local/share/snmp/snmpd.conf: line 5: Error: Unknown payload OID
Sep 12 16:35:00 test snmpd[5485]: trigger OID: memSwapError
Sep 12 16:35:00 test snmpd[5485]: /usr/local/share/snmp/snmpd.conf: line 5: Error: unknown monitor OID
Sep 12 16:35:00 test snmpd[5485]: payload OID: extNames
Sep 12 16:35:00 test snmpd[5485]: /usr/local/share/snmp/snmpd.conf: line 5: Error: unknown payload OID
Sep 12 16:35:00 test snmpd[5485]: Unknown payload OID: extNames
Sep 12 16:35:00 test snmpd[5485]: /usr/local/share/snmp/snmpd.conf: line 5: Error: Unknown payload OID
Sep 12 16:35:00 test snmpd[5485]: payload OID: extOutput
Sep 12 16:35:00 test snmpd[5485]: /usr/local/share/snmp/snmpd.conf: line 5: Error: unknown payload OID
Sep 12 16:35:00 test snmpd[5485]: Unknown payload OID: extOutput
Sep 12 16:35:00 test snmpd[5485]: /usr/local/share/snmp/snmpd.conf: line 5: Error: Unknown payload OID
Sep 12 16:35:00 test snmpd[5485]: trigger OID: extResult
Sep 12 16:35:00 test snmpd[5485]: /usr/local/share/snmp/snmpd.conf: line 5: Error: unknown monitor OID
Sep 12 16:35:00 test snmpd[5485]: payload OID: dskPath
Sep 12 16:35:00 test snmpd[5485]: /usr/local/share/snmp/snmpd.conf: line 5: Error: unknown payload OID
Sep 12 16:35:00 test snmpd[5485]: Unknown payload OID: dskPath
Sep 12 16:35:00 test snmpd[5485]: /usr/local/share/snmp/snmpd.conf: line 5: Error: Unknown payload OID
Sep 12 16:35:00 test snmpd[5485]: payload OID: dskErrorMsg
Sep 12 16:35:00 test snmpd[5485]: /usr/local/share/snmp/snmpd.conf: line 5: Error: unknown payload OID
Sep 12 16:35:00 test snmpd[5485]: Unknown payload OID: dskErrorMsg
Sep 12 16:35:00 test snmpd[5485]: /usr/local/share/snmp/snmpd.conf: line 5: Error: Unknown payload OID
Sep 12 16:35:00 test snmpd[5485]: trigger OID: dskErrorFlag
Sep 12 16:35:00 test snmpd[5485]: /usr/local/share/snmp/snmpd.conf: line 5: Error: unknown monitor OID
Sep 12 16:35:00 test snmpd[5485]: payload OID: laNames
Sep 12 16:35:00 test snmpd[5485]: /usr/local/share/snmp/snmpd.conf: line 5: Error: unknown payload OID
Sep 12 16:35:00 test snmpd[5485]: Unknown payload OID: laNames
Sep 12 16:35:00 test snmpd[5485]: /usr/local/share/snmp/snmpd.conf: line 5: Error: Unknown payload OID
Sep 12 16:35:00 test snmpd[5485]: payload OID: laErrMessage
Sep 12 16:35:00 test snmpd[5485]: /usr/local/share/snmp/snmpd.conf: line 5: Error: unknown payload OID
Sep 12 16:35:00 test snmpd[5485]: Unknown payload OID: laErrMessage
Sep 12 16:35:00 test snmpd[5485]: /usr/local/share/snmp/snmpd.conf: line 5: Error: Unknown payload OID
Sep 12 16:35:00 test snmpd[5485]: trigger OID: laErrorFlag
Sep 12 16:35:00 test snmpd[5485]: /usr/local/share/snmp/snmpd.conf: line 5: Error: unknown monitor OID
Sep 12 16:35:00 test snmpd[5485]: payload OID: fileName
Sep 12 16:35:00 test snmpd[5485]: /usr/local/share/snmp/snmpd.conf: line 5: Error: unknown payload OID
Sep 12 16:35:00 test snmpd[5485]: Unknown payload OID: fileName
Sep 12 16:35:00 test snmpd[5485]: /usr/local/share/snmp/snmpd.conf: line 5: Error: Unknown payload OID
Sep 12 16:35:00 test snmpd[5485]: payload OID: fileErrorMsg
Sep 12 16:35:00 test snmpd[5485]: /usr/local/share/snmp/snmpd.conf: line 5: Error: unknown payload OID
Sep 12 16:35:00 test snmpd[5485]: Unknown payload OID: fileErrorMsg
Sep 12 16:35:00 test snmpd[5485]: /usr/local/share/snmp/snmpd.conf: line 5: Error: Unknown payload OID
Sep 12 16:35:00 test snmpd[5485]: trigger OID: fileErrorFlag
Sep 12 16:35:00 test snmpd[5485]: /usr/local/share/snmp/snmpd.conf: line 5: Error: unknown monitor OID
Sep 12 16:35:00 test snmpd[5485]: payload OID: snmperrErrMessage
Sep 12 16:35:00 test snmpd[5485]: /usr/local/share/snmp/snmpd.conf: line 5: Error: unknown payload OID
Sep 12 16:35:00 test snmpd[5485]: Unknown payload OID: snmperrErrMessage
Sep 12 16:35:00 test snmpd[5485]: /usr/local/share/snmp/snmpd.conf: line 5: Error: Unknown payload OID
Sep 12 16:35:00 test snmpd[5485]: trigger OID: snmperrErrorFlag
Sep 12 16:35:00 test snmpd[5485]: /usr/local/share/snmp/snmpd.conf: line 5: Error: unknown monitor OID
Sep 12 16:35:00 test snmpd[5485]: Turning on AgentX master support.
Sep 12 16:35:00 test snmpd[5485]: net-snmp: 33 error(s) in config file(s)

答案1

对于 Ubuntu 12.04(它给我带来了同样的消息),使 SNMP 工作的完整步骤如下:

  1. 安装 snmpd:apt-get install snmpd
  2. 确保多元宇宙存储库已启用:

    apt-get install python-software-properties
    add-apt-repository 'deb http://archive.ubuntu.com/ubuntu precise multiverse'
    apt-get update
    
  3. 安装 snmp-mibs-downloader:apt-get install snmp-mibs-downloader

  4. 编辑/etc/default/snmpd/并设置MIBS=UCD-SNMP-MIB(这是关键修复)

  5. 重新启动 snmpd:/etc/init.d/snmpd restart

答案2

根据Debian 文档,请尝试注释掉以下行/etc/default/snmpd

export MIBS=/usr/share/snmp/mibs

来源:http://ubuntuforums.org/showpost.php?p=12087748&postcount=2

相关内容