问题是我在 syslog 文件中看不到预期的输出。我写了一个 Python 插件,位于“/home/my/collectd/pyPlugin.py”。“/etc/collectd/collectd.conf”中的 Collectd 配置(Python 插件启用了 globals true)有这个块:
<Plugin python>
ModulePath "/home/my/collectd/"
LogTraces true
Interactive false
Import pyPlugin
<Module pyPlugin>
Test "arg1" "arg2"
</Module>
</Plugin>
该插件非常简单:
import collectd
def configer(confObj):
collectd.info('config called')
def init_fun():
collectd.info('my py module init called')
def reader(input_data=None):
collectd.info('my py read called')
def writer(input_data=None)
collectd.info('my py write called')
collectd.register_config(configer)
collectd.register_init(init_fun)
collectd.register_read(reader)
collectd.register_write(writer)
当我查看“/var/log/syslog”时,我看不到任何输出。