发行商 ID:Ubuntu 描述:Ubuntu 16.04.2 LTS 版本:16.04 代号:xenial
安装了 snmpd snmptt snmp。
/etc/默认/snmpd
# This file controls the activity of snmpd
# 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,mteTrigger,mteTriggerConf -p /run/snmpd.pid'
/etc/snmp/snmptt.ini
mode =daemon
net_snmp_perl_enable = 1
log_file = /var/log/snmptt/snmptt.log
log_enable = 1
unknown_trap_log_enable = 1
unknown_trap_log_file = /var/log/snmptt/snmpttunknown.log
/etc/snmp/snmptrapd.conf
authCommunity log,execute,net public
traphandle default snmptthandler
陷阱根本没有记录,尽管它们来自 tcpdump。
如果手动运行:
sudo service snmpd stop
sudo snmptrapd -f -L o
然后一切都被记录下来。也在日志中:
16:45:03 2017/04/18 SNMPTT v1.4 shutdown
16:45:03 2017/04/18 Total traps received=0,Total traps translated=0,Total traps ignored=0,Total unknown traps=0
16:45:04 2017/04/18 SNMPTT v1.4 started
16:45:04 2017/04/18 Loading /etc/snmp/snmptt.conf
16:45:04 2017/04/18 Finished loading 66 lines from /etc/snmp/snmptt.conf
16:45:04 2017/04/18 Loading
16:45:04 2017/04/18 Could not open configuration file:
16:45:04 2017/04/18 Changing to UID: snmptt (117)
我究竟做错了什么?无法打开配置文件:- 试图谷歌,并没有真正找到任何东西。
更改为 UID:snmptt提示它正在作为用户 snmptt 运行。conf 文件 (/etc/snmp/snmptt.ini) 对他来说可读吗?/var/log/snmptt/ 是否可写?
就这样,你从根上试试,他的权利就多了。
从 snmptrapd -On 参数开始有帮助
你有 - /etc/snmp/snmptt.ini。并且程序会写信给您 - 加载 /etc/snmp/snmptt.conf。并且无法读取任何内容 - snmptt.conf 不存在,而是 snmptt.ini。将 .ini 更改为 .conf,所有内容都将被读取。