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 #9142] Downtimes are always "fixed" #2951

Closed
icinga-migration opened this issue Apr 21, 2015 · 4 comments
Closed

[dev.icinga.com #9142] Downtimes are always "fixed" #2951

icinga-migration opened this issue Apr 21, 2015 · 4 comments
Labels
area/db-ido Database output bug Something isn't working
Milestone

Comments

@icinga-migration
Copy link

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

Created by mjentsch on 2015-04-21 14:17:24 +00:00

Assignee: mfriedrich
Status: Resolved (closed on 2015-04-25 13:08:40 +00:00)
Target Version: 2.3.5
Last Update: 2015-04-25 13:08:40 +00:00 (in Redmine)

Icinga Version: v2.2.0-587-g663fe5a
Backport?: Already backported
Include in Changelog: 1

Independently from whether is set the downtime as fixed or flexible, the value of the IDO table "is_fixed" will always be set to true.

The following Downtime was created as "flexible", the flag "is_fixed" in the command is set to 0, see log:

@ [2015-04-21 14:08:21 +0000] information/Checkable: Checking for configured notifications for object 'test-random-1!service-flapping-4'
[2015-04-21 14:08:21 +0000] information/Checkable: Checkable 'test-random-1!service-flapping-4' does not have any notifications.
[2015-04-21 14:08:22 +0000] information/Checkable: Checking for configured notifications for object 'test-flap-3!service-flapping-3'
[2015-04-21 14:08:22 +0000] information/Checkable: Checkable 'test-flap-3!service-flapping-3' does not have any notifications.
[2015-04-21 14:08:33 +0000] information/ExternalCommandListener: Executing external command: [1429625313] DISABLE_PASSIVE_SVC_CHECKS;test-flap-5;ping4
[2015-04-21 14:08:34 +0000] information/Checkable: Checking for configured notifications for object 'test-flap-2!service-flapping-3'
[2015-04-21 14:08:34 +0000] information/Checkable: Checkable 'test-flap-2!service-flapping-3' does not have any notifications.
[2015-04-21 14:08:38 +0000] information/Checkable: Checking for configured notifications for object 'test-random-3!service-flapping-2'
[2015-04-21 14:08:38 +0000] information/Checkable: Checkable 'test-random-3!service-flapping-2' does not have any notifications.
[2015-04-21 14:08:43 +0000] information/ExternalCommandListener: Executing external command: [1429625323] SCHEDULE_SVC_DOWNTIME;test-down-8;ping4;1429625318;1429628918;0;0;7200;icingaadmin;asdfasdf@

The corresponding object in the IDO-Database (MySQL):

*************************** 7. row *************************** scheduleddowntime_id: 198 instance_id: 1 downtime_type: 1 object_id: 141 entry_time: 2015-04-21 14:08:43 author_name: icingaadmin comment_data: asdfasdf internal_downtime_id: 33 triggered_by_id: 0 is_fixed: 1 duration: 7200 scheduled_start_time: 2015-04-21 14:08:38 scheduled_end_time: 2015-04-21 15:08:38 was_started: 0 actual_start_time: 0000-00-00 00:00:00 actual_start_time_usec: 0 is_in_effect: 0 trigger_time: 0000-00-00 00:00:00 endpoint_object_id: 1 7 rows in set (0.00 sec)

Changesets

2015-04-25 13:06:29 +00:00 by mfriedrich 7af41e9

Fix that downtimes are always "fixed" even if scheduled as "flexible"

fixes #9142

2015-04-25 13:07:58 +00:00 by mfriedrich c59a8c8

Fix that downtimes are always "fixed" even if scheduled as "flexible"

fixes #9142
@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-04-25 12:51:22 +00:00

  • Category set to DB IDO
  • Status changed from New to Assigned
  • Assigned to set to mfriedrich
  • Target Version set to 2.4.0
  • Estimated Hours set to 2

Apparently Convert::ToBool()'s behavior changed in the past months. The external command processor is passing a string token to ToBool() which always returns true.

test/base-convert.cpp:  BOOST_CHECK(Convert::ToBool("0") == true);
test/base-convert.cpp:  BOOST_CHECK(Convert::ToBool("1") == true);
test/base-convert.cpp:  BOOST_CHECK(Convert::ToBool("2") == true);

Investigating on a fix.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-04-25 13:05:53 +00:00

[2015-04-25 15:03:19 +0200] information/ExternalCommandListener: Executing external command: [1429966999] SCHEDULE_SVC_DOWNTIME;imagine.Speedport_W_921V_1_36_000;ldap;1429966995;1429970595;1;0;0;icingaadmin;fdfsfsdf
[2015-04-25 15:03:19 +0200] notice/ExternalCommandProcessor: Creating downtime for service imagine.Speedport_W_921V_1_36_000!ldap
[2015-04-25 15:03:19 +0200] notice/Checkable: Added downtime with ID '2' between '2015-04-25 15:03:15' and '2015-04-25 16:03:15'.
[2015-04-25 15:03:19 +0200] notice/ApiListener: Relaying 'event::AddDowntime' message
[2015-04-25 15:03:19 +0200] notice/Checkable: Checkable 'imagine.Speedport_W_921V_1_36_000!ldap' already in a NOT-OK state. Triggering downtime now.
[2015-04-25 15:03:19 +0200] notice/Checkable: Triggering downtime with ID '2'.

[2015-04-25 15:03:26 +0200] information/ExternalCommandListener: Executing external command: [1429967006] SCHEDULE_SVC_DOWNTIME;imagine.Speedport_W_921V_1_36_000;ldap;1429967001;1429970601;0;0;7200;icingaadmin;dfsdfsfsdfs
[2015-04-25 15:03:26 +0200] notice/ExternalCommandProcessor: Creating downtime for service imagine.Speedport_W_921V_1_36_000!ldap
[2015-04-25 15:03:26 +0200] notice/Checkable: Added downtime with ID '3' between '2015-04-25 15:03:21' and '2015-04-25 16:03:21'.
[2015-04-25 15:03:26 +0200] notice/Checkable: Checkable 'imagine.Speedport_W_921V_1_36_000!ldap' already in a NOT-OK state. Triggering downtime now.
[2015-04-25 15:03:26 +0200] notice/Checkable: Triggering downtime with ID '3'.

MariaDB [icinga]> select * from icinga_scheduleddowntime sd join icinga_objects sdo on sd.object_id=sdo.object_id where sdo.name2='ldap'\G
*************************** 1. row ***************************
  scheduleddowntime_id: 39
           instance_id: 1
         downtime_type: 1
             object_id: 188
            entry_time: 2015-04-25 15:03:19
           author_name: icingaadmin
          comment_data: fdfsfsdf
  internal_downtime_id: 2
       triggered_by_id: 0
              is_fixed: 1
              duration: 0
  scheduled_start_time: 2015-04-25 15:03:15
    scheduled_end_time: 2015-04-25 16:03:15
           was_started: 1
     actual_start_time: 2015-04-25 15:03:19
actual_start_time_usec: 291124
          is_in_effect: 1
          trigger_time: 2015-04-25 15:03:19
    endpoint_object_id: 1
             object_id: 188
           instance_id: 1
         objecttype_id: 2
                 name1: imagine.Speedport_W_921V_1_36_000
                 name2: ldap
             is_active: 1
*************************** 2. row ***************************
  scheduleddowntime_id: 40
           instance_id: 1
         downtime_type: 1
             object_id: 188
            entry_time: 2015-04-25 15:03:26
           author_name: icingaadmin
          comment_data: dfsdfsfsdfs
  internal_downtime_id: 3
       triggered_by_id: 0
              is_fixed: 0
              duration: 7200
  scheduled_start_time: 2015-04-25 15:03:21
    scheduled_end_time: 2015-04-25 16:03:21
           was_started: 1
     actual_start_time: 2015-04-25 15:05:30
actual_start_time_usec: 219873
          is_in_effect: 1
          trigger_time: 2015-04-25 15:03:26
    endpoint_object_id: 1
             object_id: 188
           instance_id: 1
         objecttype_id: 2
                 name1: imagine.Speedport_W_921V_1_36_000
                 name2: ldap
             is_active: 1
2 rows in set (0,00 sec)

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-04-25 13:07:44 +00:00

  • Target Version changed from 2.4.0 to 2.3.5
  • Backport? changed from TBD to Yes

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-04-25 13:08:40 +00:00

  • Status changed from Assigned to Resolved
  • Done % changed from 0 to 100

Applied in changeset 7af41e9.

@icinga-migration icinga-migration added bug Something isn't working area/db-ido Database output labels Jan 17, 2017
@icinga-migration icinga-migration added this to the 2.3.5 milestone Jan 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/db-ido Database output bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant