Skip to content
This repository has been archived by the owner on Nov 6, 2024. It is now read-only.

Influxdbwriter prevents icinga2 from starting #334

Open
dvzunderd opened this issue Jan 30, 2019 · 0 comments
Open

Influxdbwriter prevents icinga2 from starting #334

dvzunderd opened this issue Jan 30, 2019 · 0 comments

Comments

@dvzunderd
Copy link

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:

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

Possible Solution

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
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant