Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
fix(broker) use final input name. (#6042)
Browse files Browse the repository at this point in the history
  • Loading branch information
loiclau committed Feb 5, 2018
1 parent 84ac457 commit c259171
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
8 changes: 4 additions & 4 deletions www/install/insertBaseConf.sql
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ INSERT INTO `cb_module` (`cb_module_id`, `name`, `libname`, `loading_pos`, `is_b
(18, 'Graphite', 'graphite.so', 21, 0, 1),
(19, 'InfluxDB', 'influxdb.so', 22, 0, 1),
(20, 'Correlation', 'correlation.so', 30, 0, 1),
(21, 'Lua', 'lua.so', 40, 0, 1);
(21, 'Generic', 'lua.so', 40, 0, 1);


--
Expand All @@ -470,7 +470,7 @@ INSERT INTO `cb_type` (`cb_type_id`, `type_name`, `type_shortname`, `cb_module_i
(30, 'Storage - Graphite', 'graphite', 18),
(31, 'Storage - InfluxDB', 'influxdb', 19),
(32, 'Correlation', 'correlation', 20),
(33, 'Lua script', 'custom', 21);
(33, 'Stream connector', 'lua', 21);

--
-- Contenu de la table `cb_field`
Expand Down Expand Up @@ -542,7 +542,7 @@ INSERT INTO `cb_fieldgroup` (`cb_fieldgroup_id`, `groupname`, `displayname`, `mu
(1, 'filters', '', 0, NULL),
(2, 'metrics_column', 'Metrics column', 1, NULL),
(3, 'status_column', 'Status column', 1, NULL),
(4, 'metrics_lua', 'metrics Lua', 1, NULL);
(4, 'lua_parameters', 'lua parameters', 1, NULL);

INSERT INTO `cb_field` (`cb_field_id`, `fieldname`, `displayname`, `description`, `fieldtype`, `external`, `cb_fieldgroup_id`) VALUES
(47, "category", "Filter category", "Category filter for flux in output", "multiselect", NULL, 1),
Expand Down Expand Up @@ -811,7 +811,7 @@ INSERT INTO `cb_type_field_relation` (`cb_type_id`, `cb_field_id`, `is_required`
-- Contenu de la table `cb_type_field_relation`
--
INSERT INTO `cb_type_field_relation` (`cb_type_id`, `cb_field_id`, `is_required`, `order_display`, `jshook_name`, `jshook_arguments`) VALUES
(33, 73, 0, 5, 'luaArguments', '{"target": "metrics_lua__value_%d"}');
(33, 73, 0, 5, 'luaArguments', '{"target": "lua_parameters__value_%d"}');

--
-- Contenu de la table `widget_parameters_field_type`
Expand Down
26 changes: 13 additions & 13 deletions www/install/sql/centreon/Update-DB-2.8.17_to_2.8.18.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,36 @@ ALTER TABLE `cb_type_field_relation` ADD COLUMN `jshook_name` VARCHAR(255) DEFAU
ALTER TABLE `cb_type_field_relation` ADD COLUMN `jshook_arguments` VARCHAR(255) DEFAULT NULL;


INSERT INTO `cb_module` (`name`, `libname`, `loading_pos`, `is_activated`) VALUES ('Lua', 'lua.so', 40,1);
INSERT INTO `cb_module` (`name`, `libname`, `loading_pos`, `is_activated`) VALUES ('Generic', 'lua.so', 40,1);

INSERT INTO `cb_type` (`type_name`, `type_shortname`, `cb_module_id`)
VALUES ('Lua script', 'custom', (SELECT `cb_module_id` FROM `cb_module` WHERE `libname` = 'Lua.so'));
VALUES ('Stream connector', 'lua', (SELECT `cb_module_id` FROM `cb_module` WHERE `libname` = 'lua.so'));

INSERT INTO `cb_fieldgroup` (`groupname`, `displayname`, `multiple`, `group_parent_id`)
VALUES ('metrics_lua', 'metrics Lua', 1, NULL);
VALUES ('lua_parameters', 'lua parameters', 1, NULL);

INSERT INTO `cb_field` (`fieldname`, `displayname`, `description`, `fieldtype`, `external`, `cb_fieldgroup_id`)
VALUES
('path', 'Path', 'Path of the lua script.', 'text', NULL, NULL),
('type', 'Type', 'Type of the metric.', 'select', NULL, (SELECT `cb_fieldgroup_id` FROM `cb_fieldgroup` WHERE `groupname` = 'metrics_lua')),
('name', 'Name', 'Name of the metric.', 'text', NULL, (SELECT `cb_fieldgroup_id` FROM `cb_fieldgroup` WHERE `groupname` = 'metrics_lua')),
('value', 'Value', 'Value of the metric.', 'text', NULL, (SELECT `cb_fieldgroup_id` FROM `cb_fieldgroup` WHERE `groupname` = 'metrics_lua'));
('type', 'Type', 'Type of the metric.', 'select', NULL, (SELECT `cb_fieldgroup_id` FROM `cb_fieldgroup` WHERE `groupname` = 'lua_parameters')),
('name', 'Name', 'Name of the metric.', 'text', NULL, (SELECT `cb_fieldgroup_id` FROM `cb_fieldgroup` WHERE `groupname` = 'lua_parameters')),
('value', 'Value', 'Value of the metric.', 'text', NULL, (SELECT `cb_fieldgroup_id` FROM `cb_fieldgroup` WHERE `groupname` = 'lua_parameters'));

INSERT INTO `cb_type_field_relation` (`cb_type_id`, `cb_field_id`, `is_required`, `order_display`, `jshook_name`, `jshook_arguments`)
VALUES (
(SELECT `cb_type_id` FROM `cb_type` WHERE `type_shortname` = 'custom'),
(SELECT `cb_type_id` FROM `cb_type` WHERE `type_shortname` = 'lua'),
(SELECT `cb_field_id` FROM `cb_field` WHERE `description` = 'Path of the lua script.'),
1, 1, NULL, NULL),
((SELECT `cb_type_id` FROM `cb_type` WHERE `type_shortname` = 'custom'),
((SELECT `cb_type_id` FROM `cb_type` WHERE `type_shortname` = 'lua'),
(SELECT `cb_field_id` FROM `cb_field` WHERE `description` = 'Category filter for flux in output'),
0, 2, NULL, NULL),
((SELECT `cb_type_id` FROM `cb_type` WHERE `type_shortname` = 'custom'),
((SELECT `cb_type_id` FROM `cb_type` WHERE `type_shortname` = 'lua'),
(SELECT `cb_field_id` FROM `cb_field` WHERE `description` = 'Type of the metric.'),
0, 5, 'luaArguments', '{"target": "metrics_lua__value_%d"}'),
((SELECT `cb_type_id` FROM `cb_type` WHERE `type_shortname` = 'custom'),
0, 5, 'luaArguments', '{"target": "lua_parameters__value_%d"}'),
((SELECT `cb_type_id` FROM `cb_type` WHERE `type_shortname` = 'lua'),
(SELECT `cb_field_id` FROM `cb_field` WHERE `description` = 'Name of the metric.'),
0, 4, NULL, NULL),
((SELECT `cb_type_id` FROM `cb_type` WHERE `type_shortname` = 'custom'),
((SELECT `cb_type_id` FROM `cb_type` WHERE `type_shortname` = 'lua'),
(SELECT `cb_field_id` FROM `cb_field` WHERE `description` = 'Value of the metric.'),
0, 3, NULL, NULL);

Expand All @@ -56,4 +56,4 @@ VALUES
);

INSERT INTO `cb_tag_type_relation` (`cb_tag_id`, `cb_type_id`, `cb_type_uniq`)
VALUES (1, (SELECT `cb_type_id` FROM `cb_type` WHERE `type_shortname` = 'custom'), 0);
VALUES (1, (SELECT `cb_type_id` FROM `cb_type` WHERE `type_shortname` = 'lua'), 0);

0 comments on commit c259171

Please sign in to comment.