Open dvzunderd opened 5 years ago
Icinga2 should be able to start after configuration of influxdb with send_thresholds and/or send_metadata enabled
Icinga2 cannot be started when send_thresholds and/or send_metadata are enabled with influxdb. When running:
icinga2 daemon -C
Will give the following result:
critical/config: Error: Error while evaluating expression: Can't convert 'true' to a floating point number. Location: in /etc/icinga2/objects.d/influxdbwriter.conf: 31:3-31:33 /etc/icinga2/objects.d/influxdbwriter.conf(29): } /etc/icinga2/objects.d/influxdbwriter.conf(30): } /etc/icinga2/objects.d/influxdbwriter.conf(31): enable_send_thresholds = "true" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /etc/icinga2/objects.d/influxdbwriter.conf(32): enable_send_metadata = "true" /etc/icinga2/objects.d/influxdbwriter.conf(33): flush_interval = 10s
We solved this by modifying the object.influxdbwrite.conf.rb template the following lines:
<% if @enable_send_thresholds -%> enable_send_thresholds = <%= @enable_send_thresholds.inspect %> <% end -%> <% if @enable_send_metadata -%> enable_send_metadata = <%= @enable_send_metadata.inspect %> <% end -%>
into (removed .inspect):
<% if @enable_send_thresholds -%> enable_send_thresholds = <%= @enable_send_thresholds %> <% end -%> <% if @enable_send_metadata -%> enable_send_metadata = <%= @enable_send_metadata %> <% end -%>
output influxdb after change (emptied fields due to security):
/** * This file is managed by Chef. * Do NOT modify this file directly. */ /** * InfluxdbWriter Object. */ library "perfdata" object InfluxdbWriter "influxdb" { host = "" port = 8086 database = "" username = "" password = "" host_template = { measurement = "$host.check_command$" tags = { hostname = "$host.name$" } } service_template = { measurement = "$service.check_command$" tags = { hostname = "$host.name$" service = "$service.name$" } } enable_send_thresholds = true enable_send_metadata = true flush_interval = 10s flush_threshold = 1024 }
Expected Behavior
Icinga2 should be able to start after configuration of influxdb with send_thresholds and/or send_metadata enabled
Current Behavior
Icinga2 cannot be started when send_thresholds and/or send_metadata are enabled with influxdb. When running:
Will give the following result:
Possible Solution
We solved this by modifying the object.influxdbwrite.conf.rb template the following lines:
into (removed .inspect):
output influxdb after change (emptied fields due to security):