我们在同一台机器上有一个带有machine和InfluxDB的测试环境。在我们添加Python收藏品插件之前,一切都很好。当plugin发送值时,我们从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。
:
<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>“随机检验”的来源
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我只想澄清一下:如果我在again python配置中评论导入“随机测试”,一切似乎都正常了。我们还查看了tcpdumps,但是我们没有注意到Python插件和其他收藏品插件之间的区别。
发布于 2017-03-22 14:56:37
我也有类似的问题,并且已经在GitHub上打开了一个问题,但是使用了curl_xml和snmp插件。
https://github.com/influxdata/influxdb/issues/8184
将InfluxDB降级到1.1.1似乎可以恢复功能。
https://stackoverflow.com/questions/41870270
复制相似问题