diff --git a/pom.xml b/pom.xml index ff0c095..6acbb3c 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ com.loafle.overflow commons-java - 1.0.93-SNAPSHOT + 1.0.100-SNAPSHOT diff --git a/src/main/java/com/loafle/overflow/central/module/target/service/CentralTargetService.java b/src/main/java/com/loafle/overflow/central/module/target/service/CentralTargetService.java index 2f61c6d..8e79282 100644 --- a/src/main/java/com/loafle/overflow/central/module/target/service/CentralTargetService.java +++ b/src/main/java/com/loafle/overflow/central/module/target/service/CentralTargetService.java @@ -10,6 +10,7 @@ import com.loafle.overflow.model.infra.Infra; import com.loafle.overflow.model.infra.InfraHost; import com.loafle.overflow.model.meta.MetaInfraType; import com.loafle.overflow.model.meta.MetaTargetHostType; +import com.loafle.overflow.model.meta.MetaTargetStatus; import com.loafle.overflow.model.probe.Probe; import com.loafle.overflow.model.target.Target; import com.loafle.overflow.service.central.infra.InfraService; @@ -83,6 +84,7 @@ public class CentralTargetService implements TargetService { Target target = new Target(); target.setInfra(infra); target.setSensorCount(0); + target.setMetaTargetStatus(MetaTargetStatus.Enum.UP.to()); if (metaInfraTypeKey.equals("HOST")) { InfraHost infraHost = (InfraHost) infra; target.setMetaTargetType(MetaTargetHostType.Enum.UNKNOWN.to()); diff --git a/src/main/resources/profiles/local/init.sample.sql b/src/main/resources/profiles/local/init.sample.sql index 829c244..c8f66a3 100644 --- a/src/main/resources/profiles/local/init.sample.sql +++ b/src/main/resources/profiles/local/init.sample.sql @@ -214,22 +214,22 @@ INSERT INTO public.infra_service (id, description, infra_host_port_id, meta_cryp -INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id) VALUES (1, 'Zone', 'Zone Target', 1, 2); -INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id) VALUES (2, 'Host', 'Host Target', 1, 127); -INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id) VALUES (3, 'Service', 'Service Target', 1, 1035); -INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id) VALUES (2, 'Host', 'Alpine Linux Host Target', 1, 101); -INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id) VALUES (2, 'Host', 'Alpine Linux Host Target', 1, 101); -INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id) VALUES (2, 'Host', 'CentOS Host Target', 1, 104); -INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id) VALUES (2, 'Host', 'Mac OS X Host Target', 1, 117); -INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id) VALUES (3, 'Service', 'Service Target', 1, 1036); -INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id) VALUES (3, 'Service', 'Service Target', 1, 1053); -INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id) VALUES (3, 'Service', 'Service Target', 1, 1050); -INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id) VALUES (3, 'Service', 'Service Target', 1, 1027); -INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id) VALUES (3, 'Service', 'Service Target', 1, 1030); -INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id) VALUES (3, 'Service', 'Service Target', 1, 1032); -INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id) VALUES (3, 'Service', 'Service Target', 1, 1023); -INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id) VALUES (3, 'Service', 'Service Target', 1, 1020); -INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id) VALUES (3, 'Service', 'Service Target', 1, 1019); +INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id, meta_target_status_id) VALUES (1, 'Zone', 'Zone Target', 1, 2, 1); +INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id, meta_target_status_id) VALUES (2, 'Host', 'Host Target', 1, 127, 1); +INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id, meta_target_status_id) VALUES (3, 'Service', 'Service Target', 1, 1035, 1); +INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id, meta_target_status_id) VALUES (2, 'Host', 'Alpine Linux Host Target', 1, 101, 1); +INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id, meta_target_status_id) VALUES (2, 'Host', 'Alpine Linux Host Target', 1, 101, 1); +INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id, meta_target_status_id) VALUES (2, 'Host', 'CentOS Host Target', 1, 104, 1); +INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id, meta_target_status_id) VALUES (2, 'Host', 'Mac OS X Host Target', 1, 117, 1); +INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id, meta_target_status_id) VALUES (3, 'Service', 'Service Target', 1, 1036, 1); +INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id, meta_target_status_id) VALUES (3, 'Service', 'Service Target', 1, 1053, 1); +INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id, meta_target_status_id) VALUES (3, 'Service', 'Service Target', 1, 1050, 1); +INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id, meta_target_status_id) VALUES (3, 'Service', 'Service Target', 1, 1027, 1); +INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id, meta_target_status_id) VALUES (3, 'Service', 'Service Target', 1, 1030, 1); +INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id, meta_target_status_id) VALUES (3, 'Service', 'Service Target', 1, 1032, 1); +INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id, meta_target_status_id) VALUES (3, 'Service', 'Service Target', 1, 1023, 1); +INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id, meta_target_status_id) VALUES (3, 'Service', 'Service Target', 1, 1020, 1); +INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id, meta_target_status_id) VALUES (3, 'Service', 'Service Target', 1, 1019, 1); INSERT INTO public.sensor (target_id, "name", description, meta_sensor_status_id, meta_crawler_id, item_count) VALUES ( 1, 'Zone Sensor', 'Network Change Detection', 1, 1, 0);