|
|
@@ -125,14 +125,58 @@ values (1, 1, '服务器111'),
|
|
|
;
|
|
|
|
|
|
delete
|
|
|
-from `it_monitor_data`;
|
|
|
-INSERT INTO `it_monitor_data` (`resource_id`, `item_id`, `record_time`, `data`)
|
|
|
-VALUES (1, 1, '2023-08-04 14:54:25', '1234');
|
|
|
-INSERT INTO `it_monitor_data` (`resource_id`, `item_id`, `record_time`, `data`)
|
|
|
-VALUES (1, 1, '2023-08-05 14:54:36', '4321');
|
|
|
-INSERT INTO `it_monitor_data` (`resource_id`, `item_id`, `record_time`, `data`)
|
|
|
-VALUES (1, 2, '2023-08-04 15:00:32', '1111');
|
|
|
-INSERT INTO `it_monitor_data` (`resource_id`, `item_id`, `record_time`, `data`)
|
|
|
-VALUES (1, 2, '2023-08-05 15:00:48', '2222');
|
|
|
-INSERT INTO `it_monitor_data` (`resource_id`, `item_id`, `record_time`, `data`)
|
|
|
-VALUES (3, 3, '2023-08-05 15:04:29', '3333');
|
|
|
+from `it_monitor_template`;
|
|
|
+INSERT INTO `it_monitor_template` (`template_id`, `template_name`)
|
|
|
+VALUES (1, '模板1');
|
|
|
+INSERT INTO `it_monitor_template` (`template_id`, `template_name`)
|
|
|
+VALUES (2, '模板2');
|
|
|
+INSERT INTO `it_monitor_template` (`template_id`, `template_name`)
|
|
|
+VALUES (3, '模板3');
|
|
|
+INSERT INTO `it_monitor_template` (`template_id`, `template_name`)
|
|
|
+VALUES (4, '模板4');
|
|
|
+
|
|
|
+delete
|
|
|
+from `it_monitor_resource_group`;
|
|
|
+INSERT INTO `it_monitor_resource_group` (`group_id`, `group_name`)
|
|
|
+VALUES (1, '资源组1');
|
|
|
+INSERT INTO `it_monitor_resource_group` (`group_id`, `group_name`)
|
|
|
+VALUES (2, '资源组2');
|
|
|
+INSERT INTO `it_monitor_resource_group` (`group_id`, `group_name`)
|
|
|
+VALUES (3, '资源组3');
|
|
|
+
|
|
|
+delete
|
|
|
+from `it_monitor_resource`;
|
|
|
+INSERT INTO `it_monitor_resource` (`resource_id`, `template_id`, `agent_id`, `resource_group_id`, `resource_name`)
|
|
|
+VALUES (1, 1, 1, 1, '资源1');
|
|
|
+INSERT INTO `it_monitor_resource` (`resource_id`, `template_id`, `agent_id`, `resource_group_id`, `resource_name`)
|
|
|
+VALUES (2, 1, 2, 2, '资源2');
|
|
|
+
|
|
|
+
|
|
|
+delete
|
|
|
+from `it_monitor_agent_key`;
|
|
|
+INSERT INTO `it_monitor_agent_key` (`agent_key_id`, `key`, `remark`)
|
|
|
+VALUES (1, '123456', '备注1');
|
|
|
+INSERT INTO `it_monitor_agent_key` (`agent_key_id`, `key`, `remark`)
|
|
|
+VALUES (2, '654321', '');
|
|
|
+
|
|
|
+delete
|
|
|
+from `it_monitor_agent`;
|
|
|
+INSERT INTO `it_monitor_agent` (`agent_id`, `agent_name`, `agent_ip`, `agent_key_id`)
|
|
|
+VALUES (1, 'agent1_local', '127.0.0.1', 1);
|
|
|
+
|
|
|
+delete
|
|
|
+from `it_monitor_item_group`;
|
|
|
+INSERT INTO `it_monitor_item_group` (`group_id`, `group_name`, `template_id`, `interval`, `top_item_id`)
|
|
|
+VALUES (1, '指标组1', 1, 5, -1);
|
|
|
+
|
|
|
+delete
|
|
|
+from `it_monitor_item`;
|
|
|
+INSERT INTO `it_monitor_item` (`item_id`, `item_name`, `item_key_name`, `item_group_id`, `item_type`)
|
|
|
+VALUES (1, 'item1', 'group1.item1', 1, 1);
|
|
|
+INSERT INTO `it_monitor_item` (`item_id`, `item_name`, `item_key_name`, `item_group_id`, `item_type`)
|
|
|
+VALUES (2, 'item2', 'group1.item2', 1, 2);
|
|
|
+
|
|
|
+delete
|
|
|
+from `it_monitor_threshold`;
|
|
|
+INSERT INTO `it_monitor_threshold` (`item_id`, `resource_id`, `alarm_type`, `threshold_type`, `threshold`, `times`)
|
|
|
+VALUES (1, 1, 0, 2, '50', 5);
|