使用 Collectd 通过 snmp 插件轮询 Cisco 设备。我将所需的 Cisco mib(CISCO-MEMORY-POOL-MIB 和 CISCO-PROCESS-MIB)加载到 net-snmp 中,并且 snmpwalk 可以很好地看到它们。
但是当我尝试将它们添加到 collectd 时,我在重新启动 collectd 服务时收到以下错误:
Cannot find module (CISCO-MEMORY-POOL-MIB): At line 0 in (none)
Cannot find module (CISCO-PROCESS-MIB): At line 0 in (none)
日志文件显示:
[2016-11-09 14:13:56] Exiting normally.
[2016-11-09 14:13:56] collectd: Stopping 5 read threads.
[2016-11-09 14:13:56] snmp plugin: read_objid (CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolName) failed.
[2016-11-09 14:13:56] snmp plugin: read_objid (CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolName) failed.
[2016-11-09 14:13:56] snmp plugin: snmp_parse_oid (CISCO-PROCESS-MIB::cpmCPUTotal5secRev) failed.
[2016-11-09 14:13:56] snmp plugin: No such data configured: `memory_free'
[2016-11-09 14:13:56] snmp plugin: No such data configured: `memory_used'
[2016-11-09 14:13:56] snmp plugin: No such data configured: `cisco_cpu'
[2016-11-09 14:13:56] snmp plugin: No such data configured: `memory_free'
[2016-11-09 14:13:56] snmp plugin: No such data configured: `memory_used'
[2016-11-09 14:13:56] snmp plugin: No such data configured: `cisco_cpu'
[2016-11-09 14:13:56] snmp plugin: No such data configured: `memory_free'
[2016-11-09 14:13:56] snmp plugin: No such data configured: `memory_used'
[2016-11-09 14:13:56] snmp plugin: No such data configured: `cisco_cpu'
[2016-11-09 14:13:56] Initialization complete, entering read-loop.
这是我的 collectd.conf 的 snmp 部分
<Plugin snmp>
<Data "SysInfo">
Type "counter"
Table false
Instance "sysName"
Values "SNMPv2-MIB::sysName"
</Data>
<Data "uptime">
Type "uptime"
Table false
Instance "Uptime"
scale 0.01
Values "DISMAN-EVENT-MIB::sysUpTimeInstance"
</Data>
<Data "if_octets">
Type "if_octets"
Table true
Instance "IF-MIB::ifAlias"
Values "IF-MIB::ifHCInOctets" "IF-MIB::ifHCOutOctets"
</Data>
<Data "if_errors">
Type "if_errors"
Table true
Instance "IF-MIB::ifAlias"
Values "IF-MIB::ifInErrors" "IF-MIB::ifOutErrors"
</Data>
<Data "memory_free">
Type "memory_free"
Table true
Instance "CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolName"
Values "CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolFree"
</Data>
<Data "memory_used">
Type "memory_used"
Table true
Instance "CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolName"
Values "CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolUsed"
</Data>
<Data "cisco_cpu">
Type "cisco_cpu"
Table true
Values "CISCO-PROCESS-MIB::cpmCPUTotal5secRev" "CISCO-PROCESS-MIB::cpmCPUTotal1minRev" "CISCO-PROCESS-MIB::cpmCPUTotal5minRev"
</Data>
我在这里想念什么?我也尝试过使用 OID 地址而不是名称,但我也一无所获。