Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce InfluxdbWriter#enable_single_record #8177

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Al2Klimov
Copy link
Member

@Al2Klimov Al2Klimov commented Aug 13, 2020

... for enabling an alternative schema.

fixes #7060

@Al2Klimov Al2Klimov added enhancement New feature or request area/influxdb Metrics to InfluxDB labels Aug 13, 2020
@Al2Klimov Al2Klimov added this to the 2.13.0 milestone Aug 13, 2020
@Al2Klimov Al2Klimov self-assigned this Aug 13, 2020
@Al2Klimov
Copy link
Member Author

Before

➜  icinga2 git:(master) cat isr.conf
object CheckerComponent "checker" { }

object InfluxdbWriter "influxdb" {
  host = "127.0.0.1"
  port = 8086
  database = "icinga2"
  flush_threshold = 1024 * 1024
  flush_interval = 10h
  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
}

object CheckCommand "dummy" {
  import "dummy-check-command"
}

object Host "h" {
  check_command = "dummy"
  vars.dummy_state = 0
  vars.dummy_text = " |lolcat=1 grumpycat=2"
}
➜  icinga2 git:(master) prefix/sbin/icinga2 daemon -c isr.conf -x debug
[2020-08-14 11:25:51 +0200] information/cli: Icinga application loader (version: v2.12.0)
[2020-08-14 11:25:51 +0200] notice/cli: Spawning seemless worker process doing the actual work
[2020-08-14 11:25:51 +0200] notice/cli: Spawned worker process (PID 77688), waiting for it to load its config
[2020-08-14 11:25:51 +0200] information/cli: Loading configuration file(s).
[2020-08-14 11:25:51 +0200] notice/ConfigCompiler: Compiling config file: isr.conf
[2020-08-14 11:25:51 +0200] notice/ConfigCompiler: Compiling config file: /Users/aklimov/NET/WS/icinga2/prefix/var/lib/icinga2/api/packages/_api/include.conf
[2020-08-14 11:25:51 +0200] notice/ConfigCompiler: Compiling config file: /Users/aklimov/NET/WS/icinga2/prefix/var/lib/icinga2/api/packages/_api/bb287378-c1f5-4d35-81b6-6d58fac99480/include.conf
[2020-08-14 11:25:51 +0200] notice/ConfigCompiler: Compiling config file: /Users/aklimov/NET/WS/icinga2/prefix/var/lib/icinga2/api/packages/_api/bb287378-c1f5-4d35-81b6-6d58fac99480/../active.conf
[2020-08-14 11:25:51 +0200] information/ConfigItem: Committing config item(s).
[2020-08-14 11:25:51 +0200] debug/Timer: TimerThreadProc started.
[2020-08-14 11:25:51 +0200] notice/WorkQueue: Spawning WorkQueue threads for 'DaemonUtility::LoadConfigFiles'
[2020-08-14 11:25:51 +0200] debug/InfluxdbWriter: HA functionality disabled. Won't pause connection: influxdb
[2020-08-14 11:25:51 +0200] information/ConfigItem: Instantiated 1 CheckCommand.
[2020-08-14 11:25:51 +0200] information/ConfigItem: Instantiated 1 Host.
[2020-08-14 11:25:51 +0200] information/ConfigItem: Instantiated 1 IcingaApplication.
[2020-08-14 11:25:51 +0200] information/ConfigItem: Instantiated 1 CheckerComponent.
[2020-08-14 11:25:51 +0200] information/ConfigItem: Instantiated 1 InfluxdbWriter.
[2020-08-14 11:25:51 +0200] information/ScriptGlobal: Dumping variables to file '/Users/aklimov/NET/WS/icinga2/prefix/var/cache/icinga2/icinga2.vars'
[2020-08-14 11:25:51 +0200] notice/WorkQueue: Stopped WorkQueue threads for 'DaemonUtility::LoadConfigFiles'
[2020-08-14 11:25:51 +0200] notice/cli: Notifying umbrella process (PID 77674) about the config loading success
[2020-08-14 11:25:51 +0200] notice/cli: Worker process successfully loaded its config
[2020-08-14 11:25:51 +0200] notice/cli: Waiting for the umbrella process to let us doing the actual work
[2020-08-14 11:25:51 +0200] notice/cli: The umbrella process let us continuing
[2020-08-14 11:25:51 +0200] information/ConfigObject: Restoring program state from file '/Users/aklimov/NET/WS/icinga2/prefix/var/lib/icinga2/icinga2.state'
[2020-08-14 11:25:51 +0200] notice/WorkQueue: Spawning WorkQueue threads for 'ConfigObject::RestoreObjects'
[2020-08-14 11:25:51 +0200] information/ConfigObject: Restored 5 objects. Loaded 1 new objects without state.
[2020-08-14 11:25:51 +0200] notice/WorkQueue: Stopped WorkQueue threads for 'ConfigObject::RestoreObjects'
[2020-08-14 11:25:51 +0200] notice/ConfigCompiler: Compiling config file: /Users/aklimov/NET/WS/icinga2/prefix/var/lib/icinga2/modified-attributes.conf
[2020-08-14 11:25:51 +0200] information/ConfigItem: Triggering Start signal for config items
[2020-08-14 11:25:51 +0200] information/InfluxdbWriter: 'influxdb' resumed.
[2020-08-14 11:25:51 +0200] notice/WorkQueue: Spawning WorkQueue threads for 'InfluxdbWriter, influxdb'
[2020-08-14 11:25:51 +0200] information/CheckerComponent: 'checker' started.
[2020-08-14 11:25:51 +0200] debug/InfluxdbWriter: Timer expired writing 0 data points
[2020-08-14 11:25:51 +0200] information/ConfigItem: Activated all objects.
[2020-08-14 11:25:51 +0200] notice/WorkQueue: Stopped WorkQueue threads for 'DaemonCommand::Run'
[2020-08-14 11:25:51 +0200] notice/ApiListener: Updating object authority for local objects.
[2020-08-14 11:25:51 +0200] debug/IcingaApplication: In IcingaApplication::Main()
[2020-08-14 11:25:51 +0200] debug/CheckerComponent: Scheduling info for checkable 'h' (2020-08-14 11:25:51 +0200): Object 'h', Next Check: 2020-08-14 11:25:51 +0200(1.5974e+09).
[2020-08-14 11:25:51 +0200] debug/CheckerComponent: Executing check for 'h'
[2020-08-14 11:25:51 +0200] debug/Checkable: Update checkable 'h' with check interval '300' from last check time at 1970-01-01 01:00:00 +0100 (-1) to next check time at 2020-08-14 11:30:48 +0200 (1.5974e+09).
[2020-08-14 11:25:51 +0200] debug/Checkable: Update checkable 'h' with check interval '300' from last check time at 2020-08-14 11:25:51 +0200 (1.5974e+09) to next check time at 2020-08-14 11:30:48 +0200 (1.5974e+09).
[2020-08-14 11:25:51 +0200] debug/InfluxdbWriter: Checkable 'h' adds to metric list:'dummy,hostname=h,metric=lolcat value=1 1597397151'.
[2020-08-14 11:25:51 +0200] debug/InfluxdbWriter: Checkable 'h' adds to metric list:'dummy,hostname=h,metric=grumpycat value=2 1597397151'.
[2020-08-14 11:25:51 +0200] debug/InfluxdbWriter: Checkable 'h' adds to metric list:'dummy,hostname=h acknowledgement=0i,current_attempt=1i,downtime_depth=0i,execution_time=0,latency=0.003361,max_check_attempts=3i,reachable=true,state=0i,state_type=1i 1597397151'.
[2020-08-14 11:25:51 +0200] notice/Checkable: State Change: Checkable 'h' hard state change from DOWN to UP detected.
[2020-08-14 11:25:51 +0200] debug/CheckerComponent: Check finished for object 'h'
[2020-08-14 11:25:56 +0200] notice/CheckerComponent: Pending checkables: 0; Idle checkables: 1; Checks/s: 0.0166667
^C[2020-08-14 11:25:57 +0200] notice/cli: Got signal 2, forwarding to seemless worker (PID 77688)
[2020-08-14 11:25:57 +0200] information/Application: Received request to shut down.
[2020-08-14 11:25:57 +0200] information/Application: Shutting down...
[2020-08-14 11:25:57 +0200] information/CheckerComponent: 'checker' stopped.
[2020-08-14 11:25:57 +0200] debug/InfluxdbWriter: Flushing pending data buffers.
[2020-08-14 11:25:57 +0200] debug/InfluxdbWriter: Flushing data buffer to InfluxDB.
[2020-08-14 11:25:57 +0200] notice/InfluxdbWriter: Reconnecting to InfluxDB on host '127.0.0.1' port '8086'.
[2020-08-14 11:25:57 +0200] debug/InfluxdbWriter: Joining existing WQ tasks.
[2020-08-14 11:25:57 +0200] debug/InfluxdbWriter: Flushing data buffers from WQ tasks.
[2020-08-14 11:25:57 +0200] information/InfluxdbWriter: 'influxdb' paused.
[2020-08-14 11:25:57 +0200] information/ConfigObject: Dumping program state to file '/Users/aklimov/NET/WS/icinga2/prefix/var/lib/icinga2/icinga2.state'
[2020-08-14 11:25:57 +0200] information/IcingaApplication: Icinga has shut down.
[2020-08-14 11:25:57 +0200] notice/cli: Seemless worker (PID 77688) stopped, stopping as well
➜  icinga2 git:(master)

After

➜  icinga2 git:(feature/influxwriter-all-perfdata-per-data-point-7060) cat isr.conf
object CheckerComponent "checker" { }

object InfluxdbWriter "influxdb" {
  host = "127.0.0.1"
  port = 8086
  database = "icinga2"
  flush_threshold = 1024 * 1024
  flush_interval = 10h
  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
}

object CheckCommand "dummy" {
  import "dummy-check-command"
}

object Host "h" {
  check_command = "dummy"
  vars.dummy_state = 0
  vars.dummy_text = " |lolcat=1 grumpycat=2"
}
➜  icinga2 git:(feature/influxwriter-all-perfdata-per-data-point-7060) prefix/sbin/icinga2 daemon -c isr.conf -x debug
[2020-08-14 11:39:25 +0200] information/cli: Icinga application loader (version: v2.12.0-1-g0b1a03982)
[2020-08-14 11:39:25 +0200] notice/cli: Spawning seemless worker process doing the actual work
[2020-08-14 11:39:25 +0200] notice/cli: Spawned worker process (PID 83252), waiting for it to load its config
[2020-08-14 11:39:25 +0200] information/cli: Loading configuration file(s).
[2020-08-14 11:39:25 +0200] notice/ConfigCompiler: Compiling config file: isr.conf
[2020-08-14 11:39:25 +0200] notice/ConfigCompiler: Compiling config file: /Users/aklimov/NET/WS/icinga2/prefix/var/lib/icinga2/api/packages/_api/include.conf
[2020-08-14 11:39:25 +0200] notice/ConfigCompiler: Compiling config file: /Users/aklimov/NET/WS/icinga2/prefix/var/lib/icinga2/api/packages/_api/bb287378-c1f5-4d35-81b6-6d58fac99480/include.conf
[2020-08-14 11:39:25 +0200] notice/ConfigCompiler: Compiling config file: /Users/aklimov/NET/WS/icinga2/prefix/var/lib/icinga2/api/packages/_api/bb287378-c1f5-4d35-81b6-6d58fac99480/../active.conf
[2020-08-14 11:39:25 +0200] information/ConfigItem: Committing config item(s).
[2020-08-14 11:39:25 +0200] debug/Timer: TimerThreadProc started.
[2020-08-14 11:39:25 +0200] notice/WorkQueue: Spawning WorkQueue threads for 'DaemonUtility::LoadConfigFiles'
[2020-08-14 11:39:25 +0200] debug/InfluxdbWriter: HA functionality disabled. Won't pause connection: influxdb
[2020-08-14 11:39:25 +0200] information/ConfigItem: Instantiated 1 Host.
[2020-08-14 11:39:25 +0200] information/ConfigItem: Instantiated 1 IcingaApplication.
[2020-08-14 11:39:25 +0200] information/ConfigItem: Instantiated 1 CheckerComponent.
[2020-08-14 11:39:25 +0200] information/ConfigItem: Instantiated 1 InfluxdbWriter.
[2020-08-14 11:39:25 +0200] information/ConfigItem: Instantiated 1 CheckCommand.
[2020-08-14 11:39:25 +0200] information/ScriptGlobal: Dumping variables to file '/Users/aklimov/NET/WS/icinga2/prefix/var/cache/icinga2/icinga2.vars'
[2020-08-14 11:39:25 +0200] notice/WorkQueue: Stopped WorkQueue threads for 'DaemonUtility::LoadConfigFiles'
[2020-08-14 11:39:25 +0200] notice/cli: Notifying umbrella process (PID 83238) about the config loading success
[2020-08-14 11:39:25 +0200] notice/cli: Worker process successfully loaded its config
[2020-08-14 11:39:25 +0200] notice/cli: Waiting for the umbrella process to let us doing the actual work
[2020-08-14 11:39:25 +0200] notice/cli: The umbrella process let us continuing
[2020-08-14 11:39:25 +0200] notice/ConfigCompiler: Compiling config file: /Users/aklimov/NET/WS/icinga2/prefix/var/lib/icinga2/modified-attributes.conf
[2020-08-14 11:39:25 +0200] information/ConfigItem: Triggering Start signal for config items
[2020-08-14 11:39:25 +0200] information/InfluxdbWriter: 'influxdb' resumed.
[2020-08-14 11:39:25 +0200] information/CheckerComponent: 'checker' started.
[2020-08-14 11:39:25 +0200] notice/WorkQueue: Spawning WorkQueue threads for 'InfluxdbWriter, influxdb'
[2020-08-14 11:39:25 +0200] information/ConfigItem: Activated all objects.
[2020-08-14 11:39:25 +0200] debug/InfluxdbWriter: Timer expired writing 0 data points
[2020-08-14 11:39:25 +0200] notice/WorkQueue: Stopped WorkQueue threads for 'DaemonCommand::Run'
[2020-08-14 11:39:25 +0200] notice/ApiListener: Updating object authority for local objects.
[2020-08-14 11:39:25 +0200] debug/IcingaApplication: In IcingaApplication::Main()
[2020-08-14 11:39:25 +0200] debug/CheckerComponent: Scheduling info for checkable 'h' (2020-08-14 11:39:25 +0200): Object 'h', Next Check: 2020-08-14 11:39:25 +0200(1.5974e+09).
[2020-08-14 11:39:25 +0200] debug/CheckerComponent: Executing check for 'h'
[2020-08-14 11:39:25 +0200] debug/Checkable: Update checkable 'h' with check interval '300' from last check time at 1970-01-01 01:00:00 +0100 (-1) to next check time at 2020-08-14 11:44:14 +0200 (1.5974e+09).
[2020-08-14 11:39:25 +0200] debug/Checkable: Update checkable 'h' with check interval '300' from last check time at 2020-08-14 11:39:25 +0200 (1.5974e+09) to next check time at 2020-08-14 11:44:14 +0200 (1.5974e+09).
[2020-08-14 11:39:25 +0200] notice/Checkable: State Change: Checkable 'h' hard state change from DOWN to UP detected.
[2020-08-14 11:39:25 +0200] debug/InfluxdbWriter: Checkable 'h' adds to metric list:'dummy,hostname=h,metric=lolcat value=1 1597397965'.
[2020-08-14 11:39:25 +0200] debug/CheckerComponent: Check finished for object 'h'
[2020-08-14 11:39:25 +0200] debug/InfluxdbWriter: Checkable 'h' adds to metric list:'dummy,hostname=h,metric=grumpycat value=2 1597397965'.
[2020-08-14 11:39:25 +0200] debug/InfluxdbWriter: Checkable 'h' adds to metric list:'dummy,hostname=h acknowledgement=0i,current_attempt=1i,downtime_depth=0i,execution_time=0,latency=0.005020,max_check_attempts=3i,reachable=true,state=0i,state_type=1i 1597397965'.
^C[2020-08-14 11:39:28 +0200] notice/cli: Got signal 2, forwarding to seemless worker (PID 83252)
[2020-08-14 11:39:28 +0200] information/Application: Received request to shut down.
[2020-08-14 11:39:28 +0200] information/Application: Shutting down...
[2020-08-14 11:39:28 +0200] information/CheckerComponent: 'checker' stopped.
[2020-08-14 11:39:28 +0200] debug/InfluxdbWriter: Flushing pending data buffers.
[2020-08-14 11:39:28 +0200] debug/InfluxdbWriter: Flushing data buffer to InfluxDB.
[2020-08-14 11:39:28 +0200] notice/InfluxdbWriter: Reconnecting to InfluxDB on host '127.0.0.1' port '8086'.
[2020-08-14 11:39:28 +0200] debug/InfluxdbWriter: Joining existing WQ tasks.
[2020-08-14 11:39:28 +0200] debug/InfluxdbWriter: Flushing data buffers from WQ tasks.
[2020-08-14 11:39:28 +0200] information/InfluxdbWriter: 'influxdb' paused.
[2020-08-14 11:39:28 +0200] information/ConfigObject: Dumping program state to file '/Users/aklimov/NET/WS/icinga2/prefix/var/lib/icinga2/icinga2.state'
[2020-08-14 11:39:28 +0200] information/IcingaApplication: Icinga has shut down.
[2020-08-14 11:39:28 +0200] notice/cli: Seemless worker (PID 83252) stopped, stopping as well
➜  icinga2 git:(feature/influxwriter-all-perfdata-per-data-point-7060)

enable_single_record = true

➜  icinga2 git:(feature/influxwriter-all-perfdata-per-data-point-7060) cat isr.conf
object CheckerComponent "checker" { }

object InfluxdbWriter "influxdb" {
  host = "127.0.0.1"
  port = 8086
  database = "icinga2"
  flush_threshold = 1024 * 1024
  flush_interval = 10h
  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
  enable_single_record = true
}

object CheckCommand "dummy" {
  import "dummy-check-command"
}

object Host "h" {
  check_command = "dummy"
  vars.dummy_state = 0
  vars.dummy_text = " |lolcat=1 grumpycat=2"
}
➜  icinga2 git:(feature/influxwriter-all-perfdata-per-data-point-7060) prefix/sbin/icinga2 daemon -c isr.conf -x debug
[2020-08-14 11:31:41 +0200] information/cli: Icinga application loader (version: v2.12.0-1-g0b1a03982)
[2020-08-14 11:31:41 +0200] notice/cli: Spawning seemless worker process doing the actual work
[2020-08-14 11:31:41 +0200] notice/cli: Spawned worker process (PID 82099), waiting for it to load its config
[2020-08-14 11:31:41 +0200] information/cli: Loading configuration file(s).
[2020-08-14 11:31:41 +0200] notice/ConfigCompiler: Compiling config file: isr.conf
[2020-08-14 11:31:41 +0200] notice/ConfigCompiler: Compiling config file: /Users/aklimov/NET/WS/icinga2/prefix/var/lib/icinga2/api/packages/_api/include.conf
[2020-08-14 11:31:41 +0200] notice/ConfigCompiler: Compiling config file: /Users/aklimov/NET/WS/icinga2/prefix/var/lib/icinga2/api/packages/_api/bb287378-c1f5-4d35-81b6-6d58fac99480/include.conf
[2020-08-14 11:31:41 +0200] notice/ConfigCompiler: Compiling config file: /Users/aklimov/NET/WS/icinga2/prefix/var/lib/icinga2/api/packages/_api/bb287378-c1f5-4d35-81b6-6d58fac99480/../active.conf
[2020-08-14 11:31:41 +0200] information/ConfigItem: Committing config item(s).
[2020-08-14 11:31:41 +0200] debug/Timer: TimerThreadProc started.
[2020-08-14 11:31:41 +0200] notice/WorkQueue: Spawning WorkQueue threads for 'DaemonUtility::LoadConfigFiles'
[2020-08-14 11:31:41 +0200] debug/InfluxdbWriter: HA functionality disabled. Won't pause connection: influxdb
[2020-08-14 11:31:41 +0200] information/ConfigItem: Instantiated 1 CheckCommand.
[2020-08-14 11:31:41 +0200] information/ConfigItem: Instantiated 1 Host.
[2020-08-14 11:31:41 +0200] information/ConfigItem: Instantiated 1 IcingaApplication.
[2020-08-14 11:31:41 +0200] information/ConfigItem: Instantiated 1 CheckerComponent.
[2020-08-14 11:31:41 +0200] information/ConfigItem: Instantiated 1 InfluxdbWriter.
[2020-08-14 11:31:41 +0200] information/ScriptGlobal: Dumping variables to file '/Users/aklimov/NET/WS/icinga2/prefix/var/cache/icinga2/icinga2.vars'
[2020-08-14 11:31:41 +0200] notice/WorkQueue: Stopped WorkQueue threads for 'DaemonUtility::LoadConfigFiles'
[2020-08-14 11:31:41 +0200] notice/cli: Notifying umbrella process (PID 82072) about the config loading success
[2020-08-14 11:31:41 +0200] notice/cli: Worker process successfully loaded its config
[2020-08-14 11:31:41 +0200] notice/cli: Waiting for the umbrella process to let us doing the actual work
[2020-08-14 11:31:41 +0200] notice/cli: The umbrella process let us continuing
[2020-08-14 11:31:41 +0200] notice/ConfigCompiler: Compiling config file: /Users/aklimov/NET/WS/icinga2/prefix/var/lib/icinga2/modified-attributes.conf
[2020-08-14 11:31:41 +0200] information/ConfigItem: Triggering Start signal for config items
[2020-08-14 11:31:41 +0200] information/InfluxdbWriter: 'influxdb' resumed.
[2020-08-14 11:31:41 +0200] information/CheckerComponent: 'checker' started.
[2020-08-14 11:31:41 +0200] notice/WorkQueue: Spawning WorkQueue threads for 'InfluxdbWriter, influxdb'
[2020-08-14 11:31:41 +0200] information/ConfigItem: Activated all objects.
[2020-08-14 11:31:41 +0200] debug/InfluxdbWriter: Timer expired writing 0 data points
[2020-08-14 11:31:41 +0200] notice/WorkQueue: Stopped WorkQueue threads for 'DaemonCommand::Run'
[2020-08-14 11:31:41 +0200] notice/ApiListener: Updating object authority for local objects.
[2020-08-14 11:31:41 +0200] debug/IcingaApplication: In IcingaApplication::Main()
[2020-08-14 11:31:41 +0200] debug/CheckerComponent: Scheduling info for checkable 'h' (2020-08-14 11:31:41 +0200): Object 'h', Next Check: 2020-08-14 11:31:41 +0200(1.5974e+09).
[2020-08-14 11:31:41 +0200] debug/CheckerComponent: Executing check for 'h'
[2020-08-14 11:31:41 +0200] debug/Checkable: Update checkable 'h' with check interval '300' from last check time at 1970-01-01 01:00:00 +0100 (-1) to next check time at 2020-08-14 11:36:29 +0200 (1.5974e+09).
[2020-08-14 11:31:41 +0200] debug/Checkable: Update checkable 'h' with check interval '300' from last check time at 2020-08-14 11:31:41 +0200 (1.5974e+09) to next check time at 2020-08-14 11:36:29 +0200 (1.5974e+09).
[2020-08-14 11:31:41 +0200] notice/Checkable: State Change: Checkable 'h' hard state change from DOWN to UP detected.
[2020-08-14 11:31:41 +0200] debug/InfluxdbWriter: Checkable 'h' adds to metric list:'dummy,hostname=h acknowledgement=0i,current_attempt=1i,downtime_depth=0i,execution_time=0,grumpycat\ value=2,latency=0.003878,lolcat\ value=1,max_check_attempts=3i,reachable=true,state=0i,state_type=1i 1597397501'.
[2020-08-14 11:31:41 +0200] debug/CheckerComponent: Check finished for object 'h'
^C[2020-08-14 11:31:43 +0200] notice/cli: Got signal 2, forwarding to seemless worker (PID 82099)
[2020-08-14 11:31:43 +0200] information/Application: Received request to shut down.
[2020-08-14 11:31:44 +0200] information/Application: Shutting down...
[2020-08-14 11:31:44 +0200] information/CheckerComponent: 'checker' stopped.
[2020-08-14 11:31:44 +0200] debug/InfluxdbWriter: Flushing pending data buffers.
[2020-08-14 11:31:44 +0200] debug/InfluxdbWriter: Flushing data buffer to InfluxDB.
[2020-08-14 11:31:44 +0200] notice/InfluxdbWriter: Reconnecting to InfluxDB on host '127.0.0.1' port '8086'.
[2020-08-14 11:31:44 +0200] debug/InfluxdbWriter: Joining existing WQ tasks.
[2020-08-14 11:31:44 +0200] debug/InfluxdbWriter: Flushing data buffers from WQ tasks.
[2020-08-14 11:31:44 +0200] information/InfluxdbWriter: 'influxdb' paused.
[2020-08-14 11:31:44 +0200] information/ConfigObject: Dumping program state to file '/Users/aklimov/NET/WS/icinga2/prefix/var/lib/icinga2/icinga2.state'
[2020-08-14 11:31:44 +0200] information/IcingaApplication: Icinga has shut down.
[2020-08-14 11:31:44 +0200] notice/cli: Seemless worker (PID 82099) stopped, stopping as well
➜  icinga2 git:(feature/influxwriter-all-perfdata-per-data-point-7060)

@Al2Klimov
Copy link
Member Author

➜  icinga2 git:(feature/influxwriter-all-perfdata-per-data-point-7060) cat isr.conf
object CheckerComponent "checker" { }

object InfluxdbWriter "influxdb" {
  host = "127.0.0.1"
  port = 8686
  username = "icinga2"
  password = "icinga2"
  database = "icinga2"
  flush_threshold = 1
  flush_interval = 1s
  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
  enable_single_record = true
}

object CheckCommand "dummy" {
  import "dummy-check-command"
}

object Host "h" {
  check_command = "dummy"
  check_interval = 1s
  vars.dummy_state = 0
  vars.dummy_text = " |lolcat=1 grumpycat=2"
}
➜  icinga2 git:(feature/influxwriter-all-perfdata-per-data-point-7060) prefix/sbin/icinga2 daemon -c isr.conf
[2020-08-14 12:02:38 +0200] information/cli: Icinga application loader (version: v2.12.0-1-g0b1a03982)
[2020-08-14 12:02:38 +0200] information/cli: Loading configuration file(s).
[2020-08-14 12:02:38 +0200] information/ConfigItem: Committing config item(s).
[2020-08-14 12:02:38 +0200] information/ConfigItem: Instantiated 1 CheckerComponent.
[2020-08-14 12:02:38 +0200] information/ConfigItem: Instantiated 1 InfluxdbWriter.
[2020-08-14 12:02:38 +0200] information/ConfigItem: Instantiated 1 CheckCommand.
[2020-08-14 12:02:38 +0200] information/ConfigItem: Instantiated 1 Host.
[2020-08-14 12:02:38 +0200] information/ConfigItem: Instantiated 1 IcingaApplication.
[2020-08-14 12:02:38 +0200] information/ScriptGlobal: Dumping variables to file '/Users/aklimov/NET/WS/icinga2/prefix/var/cache/icinga2/icinga2.vars'
[2020-08-14 12:02:38 +0200] information/ConfigObject: Restoring program state from file '/Users/aklimov/NET/WS/icinga2/prefix/var/lib/icinga2/icinga2.state'
[2020-08-14 12:02:38 +0200] information/ConfigObject: Restored 6 objects. Loaded 0 new objects without state.
[2020-08-14 12:02:38 +0200] information/ConfigItem: Triggering Start signal for config items
[2020-08-14 12:02:38 +0200] information/InfluxdbWriter: 'influxdb' resumed.
[2020-08-14 12:02:38 +0200] information/CheckerComponent: 'checker' started.
[2020-08-14 12:02:38 +0200] information/ConfigItem: Activated all objects.
[2020-08-14 12:02:48 +0200] information/WorkQueue: #5 (InfluxdbWriter, influxdb) items: 0, rate: 0.333333/s (20/min 20/5min 20/15min);
[2020-08-14 12:07:38 +0200] information/ConfigObject: Dumping program state to file '/Users/aklimov/NET/WS/icinga2/prefix/var/lib/icinga2/icinga2.state'
[2020-08-14 12:07:48 +0200] information/WorkQueue: #5 (InfluxdbWriter, influxdb) items: 0, rate: 1.96667/s (118/min 597/5min 619/15min);

Bildschirmfoto 2020-08-14 um 12 08 02

@Al2Klimov Al2Klimov removed their assignment Aug 14, 2020
@Al2Klimov Al2Klimov marked this pull request as ready for review August 14, 2020 10:10
@Al2Klimov Al2Klimov force-pushed the feature/influxwriter-all-perfdata-per-data-point-7060 branch from 0b1a039 to c5ec144 Compare December 14, 2020 15:09
@julianbrost julianbrost modified the milestones: 2.13.0, 2.14.0 Jun 1, 2021
@Al2Klimov
Copy link
Member Author

@cla-bot check

... for enabling an alternative schema.

refs #7060
@Al2Klimov Al2Klimov force-pushed the feature/influxwriter-all-perfdata-per-data-point-7060 branch from c5ec144 to 92ed702 Compare August 15, 2023 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/influxdb Metrics to InfluxDB cla/signed enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

InfluxWriter should store one record containing all perfdata per data point
2 participants