delete from `it_user`; insert into `it_user` (`user`, `display_name`, `password`, `phone_number`, `role_id`) values ('user01', '用户01', '123456', '13000000000', 1); insert into `it_user` (`user`, `display_name`, `password`, `phone_number`, `role_id`) values ('user02', '用户02', '123456', '13000000001', 1); insert into `it_user` (`user`, `display_name`, `password`, `phone_number`, `role_id`) values ('user03', '用户03', '123456', '13000000002', 1); insert into `it_user` (`user`, `display_name`, `password`, `phone_number`, `role_id`) values ('yw01', '运维01', '789456', '13000000003', 2); insert into `it_user` (`user`, `display_name`, `password`, `phone_number`, `role_id`) values ('yw02', '运维02', '789456', '13000000004', 2); insert into `it_user` (`user`, `display_name`, `password`, `phone_number`, `role_id`) values ('yw03', '运维03', '789456', '13000000005', 2); insert into `it_user` (`user`, `display_name`, `password`, `phone_number`, `role_id`) values ('yw04', '运维04', '789456', '13000000006', 2); insert into `it_user` (`user`, `display_name`, `password`, `phone_number`, `role_id`) values ('admin01', '管理员01', '456123', '13000000007', 3); insert into `it_user` (`user`, `display_name`, `password`, `phone_number`, `role_id`) values ('admin02', '管理员02', '456123', '13000000007', 3); delete from `it_role`; insert into `it_role` (`role_id`, `name`) values (1, '普通用户'), (2, 'IT运维人员'), (3, '系统管理员') ; delete from `it_sys`; insert into `it_sys` (`sys_id`, `name`) values (1, '工单'), (2, '监控'), (3, '资产'), (4, '管理') ; delete from `it_role_permission`; insert into `it_role_permission` (`role_id`, `sys_id`) values (1, 1), (2, 1), (2, 2), (2, 3), (3, 1), (3, 2), (3, 3), (3, 4) ; delete from `it_resource_group`; insert into `it_resource_group` (group_id, group_name) values (1, '服务器'), (2, '交换机'), (3, '存储') ; delete from `it_resource_attribute`; insert into `it_resource_attribute` (attribute_id, group_id, attribute_name, display_name, attribute_type, value_type, default_value, options) values (1, 1, 'name', '服务器名称', 0, 0, '', ''), (2, 1, 'model', '型号', 0, 0, '', ''), (3, 1, 'location', '服务器位置', 0, 0, '', ''), (4, 1, 'hostname', '主机名', 0, 0, '', ''), (5, 1, 'cpu', 'CPU型号', 1, 0, '', ''), (6, 1, 'cpu_cores', 'CPU核心数量', 0, 1, '', ''), (9, 2, 'name', '交换机名称', 0, 0, '', ''), (10, 2, 'model', '交换机型号', 0, 0, '', ''), (11, 2, 'port', '端口', 1, 0, '', ''), (12, 3, 'name', '存储名称', 0, 0, '', ''), (13, 3, 'company', '厂商', 2, 0, '', 'DELL,HP,HUAWEI'), (14, 3, 'expire', '是否过保', 2, 0, '否', '是,否'), (15, 3, 'disk', '磁盘', 1, 0, '', ''), (16, 1, 'company', '厂商', 2, 0, '', '戴尔,惠普,华为,浪潮'), (17, 1, 'memory', '内存', 1, 0, '', ''), (18, 1, 'room_location', '机房位置', 2, 0, '', '深圳,广州,北京,宁夏,香港') ; delete from `it_resource_type`; insert into `it_resource_type` (type_id, type_name, parent_type_id) values (1, '基础设备', -1), (2, '服务器', 1), (3, '交换机', 1), (4, '存储设备', -1), (5, '分布式存储', 4) ; delete from `it_resource`; insert into `it_resource` (resource_id, resource_name, type_id, group_id, remark) values (1, '服务器001', 2, 1, ''), (2, '服务器002', 2, 1, ''), (3, '服务器003', 2, 1, ''), (4, '交换机001', 3, 2, '全万兆交换机'), (5, '存储001', 5, 3, '1P'), (6, '存储002', 5, 3, '18T') ; delete from `it_resource_value`; insert into `it_resource_value` (resource_id, attribute_id, attribute_value) values (1, 1, '服务器111'), (1, 2, 'HP'), (1, 3, '北京'), (1, 4, 'server-001'), (2, 1, '服务器222'), (2, 2, 'DELL'), (2, 3, '北京'), (2, 4, 'server-002'), (2, 5, 'Intel'), (3, 9, '交换机111'), (3, 10, 'HUAWEI'), (3, 11, '{"column":["端口","可用"],"data":[["COM1","是"],["COM2","否"]]}'), (3, 12, '存储111'), (3, 13, 'H3C'), (1, 18, '北京'), (1, 17, '{"column":["插槽","品牌","规格","大小"],"data":[["1","三星","DDR4","128G"],["2","三星","DDR4","128G"],["3","三星","DDR4","128G"],["4","三星","DDR4","128G"],["5","三星","DDR4","128G"],["6","三星","DDR4","128G"],["7","三星","DDR4","128G"],["8","三星","DDR4","128G"]]}') ; delete 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);