flapping: Migrate to Icinga 2.8.0 flapping properties

Existing property is dropped now, it never was used in director before.

refs #330
This commit is contained in:
Markus Frosch 2017-12-06 15:37:51 +01:00 committed by Thomas Gelf
parent b9190755a6
commit 4902f694c1
7 changed files with 120 additions and 75 deletions

View File

@ -14,40 +14,41 @@ class IcingaHost extends IcingaObject
protected $table = 'icinga_host';
protected $defaultProperties = array(
'id' => null,
'object_name' => null,
'object_type' => null,
'disabled' => 'n',
'display_name' => null,
'address' => null,
'address6' => null,
'check_command_id' => null,
'max_check_attempts' => null,
'check_period_id' => null,
'check_interval' => null,
'retry_interval' => null,
'check_timeout' => null,
'enable_notifications' => null,
'enable_active_checks' => null,
'enable_passive_checks' => null,
'enable_event_handler' => null,
'enable_flapping' => null,
'enable_perfdata' => null,
'event_command_id' => null,
'flapping_threshold' => null,
'volatile' => null,
'zone_id' => null,
'command_endpoint_id' => null,
'notes' => null,
'notes_url' => null,
'action_url' => null,
'icon_image' => null,
'icon_image_alt' => null,
'has_agent' => null,
'master_should_connect' => null,
'accept_config' => null,
'api_key' => null,
'template_choice_id' => null,
'id' => null,
'object_name' => null,
'object_type' => null,
'disabled' => 'n',
'display_name' => null,
'address' => null,
'address6' => null,
'check_command_id' => null,
'max_check_attempts' => null,
'check_period_id' => null,
'check_interval' => null,
'retry_interval' => null,
'check_timeout' => null,
'enable_notifications' => null,
'enable_active_checks' => null,
'enable_passive_checks' => null,
'enable_event_handler' => null,
'enable_flapping' => null,
'enable_perfdata' => null,
'event_command_id' => null,
'flapping_threshold_high' => null,
'flapping_threshold_low' => null,
'volatile' => null,
'zone_id' => null,
'command_endpoint_id' => null,
'notes' => null,
'notes_url' => null,
'action_url' => null,
'icon_image' => null,
'icon_image_alt' => null,
'has_agent' => null,
'master_should_connect' => null,
'accept_config' => null,
'api_key' => null,
'template_choice_id' => null,
);
protected $relations = array(
@ -78,6 +79,11 @@ class IcingaHost extends IcingaObject
'retry_interval' => 'retry_interval',
);
protected $numericProperties = array(
'flapping_threshold_high' => 'flapping_threshold_high',
'flapping_threshold_low' => 'flapping_threshold_low',
);
protected $supportsCustomVars = true;
protected $supportsGroups = true;

View File

@ -16,40 +16,41 @@ class IcingaService extends IcingaObject
protected $table = 'icinga_service';
protected $defaultProperties = array(
'id' => null,
'object_name' => null,
'object_type' => null,
'disabled' => 'n',
'display_name' => null,
'host_id' => null,
'service_set_id' => null,
'check_command_id' => null,
'max_check_attempts' => null,
'check_period_id' => null,
'check_interval' => null,
'retry_interval' => null,
'check_timeout' => null,
'enable_notifications' => null,
'enable_active_checks' => null,
'enable_passive_checks' => null,
'enable_event_handler' => null,
'enable_flapping' => null,
'enable_perfdata' => null,
'event_command_id' => null,
'flapping_threshold' => null,
'volatile' => null,
'zone_id' => null,
'command_endpoint_id' => null,
'notes' => null,
'notes_url' => null,
'action_url' => null,
'icon_image' => null,
'icon_image_alt' => null,
'use_agent' => null,
'apply_for' => null,
'use_var_overrides' => null,
'assign_filter' => null,
'template_choice_id' => null,
'id' => null,
'object_name' => null,
'object_type' => null,
'disabled' => 'n',
'display_name' => null,
'host_id' => null,
'service_set_id' => null,
'check_command_id' => null,
'max_check_attempts' => null,
'check_period_id' => null,
'check_interval' => null,
'retry_interval' => null,
'check_timeout' => null,
'enable_notifications' => null,
'enable_active_checks' => null,
'enable_passive_checks' => null,
'enable_event_handler' => null,
'enable_flapping' => null,
'enable_perfdata' => null,
'event_command_id' => null,
'flapping_threshold_high' => null,
'flapping_threshold_low' => null,
'volatile' => null,
'zone_id' => null,
'command_endpoint_id' => null,
'notes' => null,
'notes_url' => null,
'action_url' => null,
'icon_image' => null,
'icon_image_alt' => null,
'use_agent' => null,
'apply_for' => null,
'use_var_overrides' => null,
'assign_filter' => null,
'template_choice_id' => null,
);
protected $relations = array(
@ -81,6 +82,11 @@ class IcingaService extends IcingaObject
'retry_interval' => 'retry_interval',
);
protected $numericProperties = array(
'flapping_threshold_high' => 'flapping_threshold_high',
'flapping_threshold_low' => 'flapping_threshold_low',
);
protected $supportsGroups = true;
protected $supportsCustomVars = true;

View File

@ -0,0 +1,14 @@
ALTER TABLE icinga_host
DROP COLUMN flapping_threshold,
ADD COLUMN flapping_threshold_high SMALLINT UNSIGNED DEFAULT NULL,
ADD COLUMN flapping_threshold_low SMALLINT UNSIGNED DEFAULT NULL;
ALTER TABLE icinga_service
DROP COLUMN flapping_threshold,
ADD COLUMN flapping_threshold_high SMALLINT UNSIGNED DEFAULT NULL,
ADD COLUMN flapping_threshold_low SMALLINT UNSIGNED DEFAULT NULL;
INSERT INTO director_schema_migration
(schema_version, migration_time)
VALUES (146, NOW());

View File

@ -455,7 +455,8 @@ CREATE TABLE icinga_host (
enable_flapping ENUM('y', 'n') DEFAULT NULL,
enable_perfdata ENUM('y', 'n') DEFAULT NULL,
event_command_id INT(10) UNSIGNED DEFAULT NULL,
flapping_threshold SMALLINT UNSIGNED default null,
flapping_threshold_high SMALLINT UNSIGNED default null,
flapping_threshold_low SMALLINT UNSIGNED default null,
volatile ENUM('y', 'n') DEFAULT NULL,
zone_id INT(10) UNSIGNED DEFAULT NULL,
command_endpoint_id INT(10) UNSIGNED DEFAULT NULL,
@ -613,7 +614,8 @@ CREATE TABLE icinga_service (
enable_flapping ENUM('y', 'n') DEFAULT NULL,
enable_perfdata ENUM('y', 'n') DEFAULT NULL,
event_command_id INT(10) UNSIGNED DEFAULT NULL,
flapping_threshold SMALLINT UNSIGNED DEFAULT NULL,
flapping_threshold_high SMALLINT UNSIGNED DEFAULT NULL,
flapping_threshold_low SMALLINT UNSIGNED DEFAULT NULL,
volatile ENUM('y', 'n') DEFAULT NULL,
zone_id INT(10) UNSIGNED DEFAULT NULL,
command_endpoint_id INT(10) UNSIGNED DEFAULT NULL,
@ -1668,4 +1670,4 @@ CREATE TABLE icinga_dependency_states_set (
INSERT INTO director_schema_migration
(schema_version, migration_time)
VALUES (145, NOW());
VALUES (146, NOW());

View File

@ -0,0 +1,14 @@
ALTER TABLE icinga_host
DROP COLUMN flapping_threshold,
ADD COLUMN flapping_threshold_high smallint DEFAULT NULL,
ADD COLUMN flapping_threshold_low smallint DEFAULT NULL;
ALTER TABLE icinga_service
DROP COLUMN flapping_threshold,
ADD COLUMN flapping_threshold_high smallint DEFAULT NULL,
ADD COLUMN flapping_threshold_low smallint DEFAULT NULL;
INSERT INTO director_schema_migration
(schema_version, migration_time)
VALUES (146, NOW());

View File

@ -580,7 +580,8 @@ CREATE TABLE icinga_host (
enable_flapping enum_boolean DEFAULT NULL,
enable_perfdata enum_boolean DEFAULT NULL,
event_command_id integer DEFAULT NULL,
flapping_threshold smallint default null,
flapping_threshold_high smallint default null,
flapping_threshold_low smallint default null,
volatile enum_boolean DEFAULT NULL,
zone_id integer DEFAULT NULL,
command_endpoint_id integer DEFAULT NULL,
@ -766,7 +767,8 @@ CREATE TABLE icinga_service (
enable_flapping enum_boolean DEFAULT NULL,
enable_perfdata enum_boolean DEFAULT NULL,
event_command_id integer DEFAULT NULL,
flapping_threshold smallint DEFAULT NULL,
flapping_threshold_high smallint DEFAULT NULL,
flapping_threshold_low smallint DEFAULT NULL,
volatile enum_boolean DEFAULT NULL,
zone_id integer DEFAULT NULL,
command_endpoint_id integer DEFAULT NULL,
@ -1959,4 +1961,4 @@ COMMENT ON COLUMN icinga_dependency_states_set.merge_behaviour IS 'override: = [
INSERT INTO director_schema_migration
(schema_version, migration_time)
VALUES (144, NOW());
VALUES (146, NOW());

View File

@ -712,7 +712,8 @@ class IcingaHostTest extends BaseTestCase
"${prefix}enable_passive_checks" => "enable_passive_checks",
"${prefix}enable_perfdata" => "enable_perfdata",
"${prefix}event_command" => "event_command",
"${prefix}flapping_threshold" => "flapping_threshold",
"${prefix}flapping_threshold_high" => "flapping_threshold_high",
"${prefix}flapping_threshold_low" => "flapping_threshold_low",
"${prefix}icon_image" => "icon_image",
"${prefix}icon_image_alt" => "icon_image_alt",
"${prefix}max_check_attempts" => "max_check_attempts",