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

[dev.icinga.com #13451] Sync object created via API #4843

Closed
icinga-migration opened this issue Dec 7, 2016 · 1 comment
Closed

[dev.icinga.com #13451] Sync object created via API #4843

icinga-migration opened this issue Dec 7, 2016 · 1 comment
Labels
bug Something isn't working

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/13451

Created by bsheqa on 2016-12-07 09:55:53 +00:00

Assignee: (none)
Status: Closed (closed on 2017-01-03 07:55:01 +00:00)
Target Version: (none)
Last Update: 2017-01-03 07:55:01 +00:00 (in Redmine)

Icinga Version: 2.5.4+snapshot2016.12.04+1~trusty
Backport?: Not yet backported
Include in Changelog: 1

I have the following scenario:

  • master zone with two endpoints (bls-master1, bls-master2)
  • satellite zone with one endpoint (bls-satellite1)

When I create an object via API on bls-master1 it gets replicated to the satellite, but not to bls-master2.

API request

Method: PUT
URL: https://bls-master1.test.netways.de:5665/v1/objects/checkcommands/graphite_test
Body:
{
  "templates": [ "plugin-check-command" ],
  "attrs": {
    "command": [ "/usr/lib/nagios/plugins/check_graphite_test" ],
    "arguments": {
      "-I": "$graphite_test_param$"
    },
    "zone": "global"
  }
}

Response:
{
  "results": [
    {
      "code": 200,
      "status": "Object was created"
    }
  ]
}

debug.log on bls-master1

[2016-12-07 10:36:11 +0100] notice/WorkQueue: #6 (ApiListener, SyncQueue) tasks: 0
[2016-12-07 10:36:11 +0100] debug/InfluxdbWriter: Timer expired writing 27 data points
[2016-12-07 10:36:11 +0100] notice/InfluxdbWriter: Reconnecting to InfluxDB on host '127.0.0.1' port '8086'.
[2016-12-07 10:36:11 +0100] debug/HttpRequest: line: HTTP/1.1 204 No Content, tokens: 4
[2016-12-07 10:36:11 +0100] information/ApiListener: New client connection from [10.0.10.131]:62037 (no client certificate)
[2016-12-07 10:36:11 +0100] warning/TlsStream: TLS stream was disconnected.
[2016-12-07 10:36:11 +0100] warning/ApiListener: No data received on new API connection for identity ''. Ensure that the remote endpoints are properly configured in a cluster setup.
Context:
        (0) Handling new API client connection

[2016-12-07 10:36:11 +0100] information/ApiListener: New client connection from [10.0.10.131]:62038 (no client certificate)
[2016-12-07 10:36:11 +0100] notice/ApiListener: New HTTP client
[2016-12-07 10:36:11 +0100] debug/HttpRequest: line: PUT /v1/objects/checkcommands/graphite_test HTTP/1.1, tokens: 3
[2016-12-07 10:36:11 +0100] notice/WorkQueue: Spawning WorkQueue threads for 'HttpServerConnection'
[2016-12-07 10:36:11 +0100] information/HttpServerConnection: Request: PUT /v1/objects/checkcommands/graphite_test (from [10.0.10.131]:62038, user: root)
[2016-12-07 10:36:11 +0100] notice/ConfigCompiler: Compiling config file: /var/lib/icinga2/api/packages/_api/bls-master1-1480950131-0/conf.d/checkcommands/graphite_test.conf
[2016-12-07 10:36:11 +0100] information/ConfigItem: Committing config item(s).
[2016-12-07 10:36:11 +0100] notice/WorkQueue: Spawning WorkQueue threads for ''
[2016-12-07 10:36:11 +0100] information/ConfigItem: Instantiated 1 CheckCommand.
[2016-12-07 10:36:11 +0100] information/ConfigItem: Triggering Start signal for config items
[2016-12-07 10:36:11 +0100] notice/ApiListener: Relaying 'config::UpdateObject' message
[2016-12-07 10:36:11 +0100] notice/ApiListener: Sending message 'config::UpdateObject' to 'bls-satellite1.test.netways.de'
[2016-12-07 10:36:11 +0100] information/ConfigItem: Activated all objects.
[2016-12-07 10:36:11 +0100] notice/WorkQueue: Stopped WorkQueue threads for ''
[2016-12-07 10:36:11 +0100] notice/WorkQueue: #5 (ApiListener, RelayQueue) tasks: 0
[2016-12-07 10:36:11 +0100] notice/ThreadPool: Pool #1: Pending tasks: 0; Average latency: 0ms; Threads: 4; Pool utilization: 0.0823931%
[2016-12-07 10:36:11 +0100] notice/JsonRpcConnection: Received 'log::SetLogPosition' message from 'bls-master2.test.netways.de'
[2016-12-07 10:36:12 +0100] notice/WorkQueue: #7 (IdoMysqlConnection, ido-mysql) tasks: 0
[2016-12-07 10:36:12 +0100] notice/WorkQueue: #11 (JsonRpcConnection, #1) tasks: 0
[2016-12-07 10:36:12 +0100] notice/CheckerComponent: Pending checkables: 0; Idle checkables: 4; Checks/s: 0.866667

debug.log on bls-master2

[2016-12-07 10:36:10 +0100] notice/ApiListener: Sending message 'event::CheckResult' to 'bls-master1.test.netways.de'
[2016-12-07 10:36:10 +0100] debug/IdoMysqlConnection: Query: UPDATE icinga_hoststatus SET acknowledgement_type = '0',  active_checks_enabled = '1',  check_command = 'hostalive',  check_source = 'bls-master2.test.netways.de',  check_type = '0',  current_check_attempt = '1',  current_notification_number = '0',  current_state = '0',  endpoint_object_id = 205,  event_handler = '',  event_handler_enabled = '1',  execution_time = '4.016285',  flap_detection_enabled = '0',  has_been_checked = '1',  host_object_id = 206,  instance_id = 1,  is_flapping = '0',  is_reachable = '1',  last_check = FROM_UNIXTIME(1481103370),  last_hard_state = '0',  last_hard_state_change = FROM_UNIXTIME(1480937403),  last_state_change = FROM_UNIXTIME(1480937403),  last_time_up = FROM_UNIXTIME(1481103370),  latency = '0.000458',  long_output = '',  max_check_attempts = '3',  next_check = FROM_UNIXTIME(1481103380),  normal_check_interval = '0.166667',  notifications_enabled = '1',  original_attributes = 'null',  output = 'PING OK - Packet loss = 0%, RTA = 0.56 ms',  passive_checks_enabled = '1',  percent_state_change = '0',  perfdata = 'rta=0.558000ms;3000.000000;5000.000000;0.000000 pl=0%;80;100;0',  problem_has_been_acknowledged = '0',  process_performance_data = '1',  retry_check_interval = '0.166667',  scheduled_downtime_depth = '0',  should_be_scheduled = '1',  state_type = '1',  status_update_time = FROM_UNIXTIME(1481103370) WHERE host_object_id = 206
[2016-12-07 10:36:10 +0100] debug/IdoMysqlConnection: Query: COMMIT
[2016-12-07 10:36:10 +0100] debug/IdoMysqlConnection: Query: BEGIN
[2016-12-07 10:36:11 +0100] notice/JsonRpcConnection: Received 'event::Heartbeat' message from 'bls-master1.test.netways.de'
[2016-12-07 10:36:11 +0100] notice/ApiListener: Setting log position for identity 'bls-master1.test.netways.de': 2016/12/07 10:36:09
[2016-12-07 10:36:11 +0100] notice/ApiListener: Setting log position for identity 'bls-satellite1.test.netways.de': 2016/12/07 10:08:51
[2016-12-07 10:36:11 +0100] notice/CheckerComponent: Pending checkables: 0; Idle checkables: 5; Checks/s: 0.866667
[2016-12-07 10:36:12 +0100] notice/JsonRpcConnection: Received 'log::SetLogPosition' message from 'bls-master1.test.netways.de'
[2016-12-07 10:36:12 +0100] information/IdoMysqlConnection: Query queue items: 0, query rate: 3.73333/s (224/min 1088/5min 3252/15min);
[2016-12-07 10:36:12 +0100] notice/JsonRpcConnection: Received 'event::SetNextCheck' message from 'bls-master1.test.netways.de'
[2016-12-07 10:36:12 +0100] notice/ApiListener: Relaying 'event::SetNextCheck' message
[2016-12-07 10:36:12 +0100] debug/IdoMysqlConnection: Query: COMMIT
[2016-12-07 10:36:12 +0100] debug/IdoMysqlConnection: Query: BEGIN

debug.log on bls-satellite1

[2016-12-07 10:36:09 +0100] notice/WorkQueue: #4 (ApiListener, RelayQueue) tasks: 0
[2016-12-07 10:36:09 +0100] notice/WorkQueue: #9 (JsonRpcConnection, #1) tasks: 0
[2016-12-07 10:36:09 +0100] notice/WorkQueue: #8 (JsonRpcConnection, #0) tasks: 0
[2016-12-07 10:36:11 +0100] notice/JsonRpcConnection: Received 'event::Heartbeat' message from 'bls-master1.test.netways.de'
[2016-12-07 10:36:11 +0100] notice/JsonRpcConnection: Received 'config::UpdateObject' message from 'bls-master1.test.netways.de'
[2016-12-07 10:36:11 +0100] notice/ApiListener: Received update for object: {"config":"object CheckCommand \"graphite_test\" {\n\timport \"plugin-check-command\"\n\n\targuments = {\n\t\t\"-I\" = \"$graphite_test_param$\"\n\t}\n\tcommand = [ \"/usr/lib/nagios/plugins/check_graphite_test\" ]\n\tversion = 1481103371.428983\n\tzone = \"global\"\n}\n","modified_attributes":{},"name":"graphite_test","original_attributes":[],"type":"CheckCommand","version":1481103371.4289829731}
[2016-12-07 10:36:11 +0100] notice/ConfigCompiler: Compiling config file: /var/lib/icinga2/api/packages/_api/bls-satellite1-1480933273-1/conf.d/checkcommands/graphite_test.conf
[2016-12-07 10:36:11 +0100] information/ConfigItem: Committing config item(s).
[2016-12-07 10:36:11 +0100] notice/WorkQueue: Spawning WorkQueue threads for ''
[2016-12-07 10:36:11 +0100] information/ConfigItem: Instantiated 1 CheckCommand.
[2016-12-07 10:36:11 +0100] information/ConfigItem: Triggering Start signal for config items
[2016-12-07 10:36:11 +0100] information/ConfigItem: Activated all objects.
[2016-12-07 10:36:11 +0100] notice/ApiListener: Relaying 'config::UpdateObject' message
[2016-12-07 10:36:11 +0100] notice/WorkQueue: Stopped WorkQueue threads for ''
[2016-12-07 10:36:11 +0100] notice/ApiListener: Discarding config update for object 'graphite_test': Object version 1481103371.428983 is more recent than the received version 1481103371.428983.
[2016-12-07 10:36:11 +0100] notice/ApiListener: Relaying 'config::UpdateObject' message
[2016-12-07 10:36:11 +0100] notice/JsonRpcConnection: Received 'log::SetLogPosition' message from 'bls-master2.test.netways.de'
[2016-12-07 10:36:12 +0100] notice/JsonRpcConnection: Received 'log::SetLogPosition' message from 'bls-master1.test.netways.de'
@icinga-migration
Copy link
Author

Updated by bsheqa on 2017-01-03 07:55:01 +00:00

  • Status changed from New to Closed

I think this is resolved with 2.6

@icinga-migration icinga-migration added the bug Something isn't working label Jan 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant