我们在同一台机器上有一个带有Collectd和InfluxDB的测试环境。 在我们添加Python Collectd插件之前,一切正常。 当Python插件调度值时,我们会从InfluxDB中获取错误日志:
Jan 26 10:00:24 influxdb influxd: [I] 2017-01-26T09:00:24Z Collectd parse error: invalid data service=collect
我们的设置: 收集5.6 InfluxDB 1.2。
Collectd Python插件配置:
<LoadPlugin python>
Globals true
</LoadPlugin>
<Plugin python>
ModulePath "/opt/python-collectd"
LogTraces true
Interactive false
Import "randomtest"
</Plugin>
收集网络配置:
LoadPlugin network
<Plugin network>
Server "localhost" "25826"
</Plugin>
“randomtest”的来源
import collectd
import random
def configer(confObj):
collectd.info('config called')
def init_fun():
collectd.info('init called')
def reader(input_data=None):
value = collectd.Values()
value.plugin = 'test_plugin'
value.host = 'test-host'
value.interval = 10
value.type = 'absolute'
value.type_instance = 'test'
value.values = [random.randint(0,10)]
value.dispatch()
collectd.register_config(configer)
collectd.register_init(init_fun)
collectd.register_read(reader)
InfluxDB收集配置:
[[collectd]]
enabled = true
bind-address = ":25826"
database = "collectd"
retention-policy = ""
typesdb = "/usr/share/collectd/types.db"
# These next lines control how batching works. You should have this enabled
# otherwise you could get dropped metrics or poor performance. Batching
# will buffer points in memory if you have many coming in.
# Flush if this many points get buffered
batch-size = 5000
# Number of batches that may be pending in memory
batch-pending = 10
# Flush at least this often even if we haven't hit buffer limit
batch-timeout = "10s"
# UDP Read buffer size, 0 means OS default. UDP listener will fail if set above OS max.
read-buffer = 0
只是为了澄清: 如果我评论在Collectd python配置中导入“randomtest”,一切似乎再次正常工作。 我们还查看了tcpdumps,但我们注意到Python Collectd插件和其他Collectd插件之间存在差异。
答案 0 :(得分:0)
我遇到了类似的问题并在GitHub上打开了一个问题,但是使用了curl_xml和snmp插件。
https://github.com/influxdata/influxdb/issues/8184
将InfluxDB降级为1.1.1似乎可以恢复功能。