Collectd插件似乎不是

2024-10-01 07:48:27 发布

您现在位置:Python中文网/ 问答频道 /正文

问题是在syslog文件中看不到预期的输出。我编写了一个Python插件,位于“/home/my/collectd”/pyPlugin.py". /etc/Collectd中的collected配置/集合D.conf“(Python plugin在globals true下启用)具有以下块:

<Plugin python>
    ModulePath "/home/my/collectd/"
    LogTraces true
    Interactive false
    Import pyPlugin

    <Module pyPlugin>
        Test "arg1" "arg2"
    </Module>
</Plugin>

插件非常简单:

^{pr2}$

当我查看“/var/log/syslog”时,没有看到任何输出。在


Tags: 文件py插件truehomemyconfetc
1条回答
网友
1楼 · 发布于 2024-10-01 07:48:27

把这个放在你的集合D.conf文件:LoadPlugin "syslog"

FAQ

In order to get any output at all, you need to load a log plugin. The two main log plugins are the LogFile and SysLog plugins. We recommend that loading one of those plugins is the first thing you do in your config file, i.e. put the LoadPlugin line at the very top. If no log plugin is loaded, collectd will write to STDERR. After the daemon has forked to the background, you won't be able to see this output anymore, though.

默认情况下,syslog插件将显示info级别。还要确认Collectd正在运行,请查看进程列表或/etc/init.d/collectd status。在

相关问题 更多 >