diff --git a/pom.xml b/pom.xml index a763419..22552dd 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ com.loafle.overflow commons-java - 1.0.47-SNAPSHOT + 1.0.51-SNAPSHOT diff --git a/src/main/resources/local/init.sql b/src/main/resources/local/init.sql index e15a164..fdf15b0 100644 --- a/src/main/resources/local/init.sql +++ b/src/main/resources/local/init.sql @@ -225,97 +225,97 @@ INSERT INTO public.meta_target_type ( id , meta_infra_type_id , key , "name" , i INSERT INTO public.meta_target_type ( id , meta_infra_type_id , key , "name" , is_supported ) VALUES ( 1053 , 3 , 'WMI' , 'WMI' , 'true' ); INSERT INTO public.meta_target_type ( id , meta_infra_type_id , key , "name" , is_supported ) VALUES ( 1054 , 3 , 'ZIMBRA' , 'Zimbra' , 'false' ); -INSERT INTO public.meta_target_zone_type ( id ) VALUES ( 1 ); -INSERT INTO public.meta_target_zone_type ( id ) VALUES ( 2 ); +-- INSERT INTO public.meta_target_zone_type ( id ) VALUES ( 1 ); +-- INSERT INTO public.meta_target_zone_type ( id ) VALUES ( 2 ); -INSERT INTO public.meta_target_host_type ( id ) VALUES ( 100 ); -INSERT INTO public.meta_target_host_type ( id ) VALUES ( 101 ); -INSERT INTO public.meta_target_host_type ( id ) VALUES ( 102 ); -INSERT INTO public.meta_target_host_type ( id ) VALUES ( 103 ); -INSERT INTO public.meta_target_host_type ( id ) VALUES ( 104 ); -INSERT INTO public.meta_target_host_type ( id ) VALUES ( 105 ); -INSERT INTO public.meta_target_host_type ( id ) VALUES ( 106 ); -INSERT INTO public.meta_target_host_type ( id ) VALUES ( 107 ); -INSERT INTO public.meta_target_host_type ( id ) VALUES ( 108 ); -INSERT INTO public.meta_target_host_type ( id ) VALUES ( 109 ); -INSERT INTO public.meta_target_host_type ( id ) VALUES ( 110 ); -INSERT INTO public.meta_target_host_type ( id ) VALUES ( 111 ); -INSERT INTO public.meta_target_host_type ( id ) VALUES ( 112 ); -INSERT INTO public.meta_target_host_type ( id ) VALUES ( 113 ); -INSERT INTO public.meta_target_host_type ( id ) VALUES ( 114 ); -INSERT INTO public.meta_target_host_type ( id ) VALUES ( 115 ); -INSERT INTO public.meta_target_host_type ( id ) VALUES ( 116 ); -INSERT INTO public.meta_target_host_type ( id ) VALUES ( 117 ); -INSERT INTO public.meta_target_host_type ( id ) VALUES ( 118 ); -INSERT INTO public.meta_target_host_type ( id ) VALUES ( 119 ); -INSERT INTO public.meta_target_host_type ( id ) VALUES ( 120 ); -INSERT INTO public.meta_target_host_type ( id ) VALUES ( 121 ); -INSERT INTO public.meta_target_host_type ( id ) VALUES ( 122 ); -INSERT INTO public.meta_target_host_type ( id ) VALUES ( 123 ); -INSERT INTO public.meta_target_host_type ( id ) VALUES ( 124 ); -INSERT INTO public.meta_target_host_type ( id ) VALUES ( 125 ); -INSERT INTO public.meta_target_host_type ( id ) VALUES ( 126 ); -INSERT INTO public.meta_target_host_type ( id ) VALUES ( 127 ); -INSERT INTO public.meta_target_host_type ( id ) VALUES ( 128 ); -INSERT INTO public.meta_target_host_type ( id ) VALUES ( 129 ); -INSERT INTO public.meta_target_host_type ( id ) VALUES ( 130 ); +-- INSERT INTO public.meta_target_host_type ( id ) VALUES ( 100 ); +-- INSERT INTO public.meta_target_host_type ( id ) VALUES ( 101 ); +-- INSERT INTO public.meta_target_host_type ( id ) VALUES ( 102 ); +-- INSERT INTO public.meta_target_host_type ( id ) VALUES ( 103 ); +-- INSERT INTO public.meta_target_host_type ( id ) VALUES ( 104 ); +-- INSERT INTO public.meta_target_host_type ( id ) VALUES ( 105 ); +-- INSERT INTO public.meta_target_host_type ( id ) VALUES ( 106 ); +-- INSERT INTO public.meta_target_host_type ( id ) VALUES ( 107 ); +-- INSERT INTO public.meta_target_host_type ( id ) VALUES ( 108 ); +-- INSERT INTO public.meta_target_host_type ( id ) VALUES ( 109 ); +-- INSERT INTO public.meta_target_host_type ( id ) VALUES ( 110 ); +-- INSERT INTO public.meta_target_host_type ( id ) VALUES ( 111 ); +-- INSERT INTO public.meta_target_host_type ( id ) VALUES ( 112 ); +-- INSERT INTO public.meta_target_host_type ( id ) VALUES ( 113 ); +-- INSERT INTO public.meta_target_host_type ( id ) VALUES ( 114 ); +-- INSERT INTO public.meta_target_host_type ( id ) VALUES ( 115 ); +-- INSERT INTO public.meta_target_host_type ( id ) VALUES ( 116 ); +-- INSERT INTO public.meta_target_host_type ( id ) VALUES ( 117 ); +-- INSERT INTO public.meta_target_host_type ( id ) VALUES ( 118 ); +-- INSERT INTO public.meta_target_host_type ( id ) VALUES ( 119 ); +-- INSERT INTO public.meta_target_host_type ( id ) VALUES ( 120 ); +-- INSERT INTO public.meta_target_host_type ( id ) VALUES ( 121 ); +-- INSERT INTO public.meta_target_host_type ( id ) VALUES ( 122 ); +-- INSERT INTO public.meta_target_host_type ( id ) VALUES ( 123 ); +-- INSERT INTO public.meta_target_host_type ( id ) VALUES ( 124 ); +-- INSERT INTO public.meta_target_host_type ( id ) VALUES ( 125 ); +-- INSERT INTO public.meta_target_host_type ( id ) VALUES ( 126 ); +-- INSERT INTO public.meta_target_host_type ( id ) VALUES ( 127 ); +-- INSERT INTO public.meta_target_host_type ( id ) VALUES ( 128 ); +-- INSERT INTO public.meta_target_host_type ( id ) VALUES ( 129 ); +-- INSERT INTO public.meta_target_host_type ( id ) VALUES ( 130 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1000 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1001 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1002 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1003 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1004 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1005 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1006 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1007 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1008 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1009 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1010 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1011 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1012 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1013 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1014 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1015 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1016 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1017 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1018 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1019 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1020 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1021 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1022 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1023 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1024 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1025 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1026 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1027 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1028 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1029 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1030 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1031 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1032 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1033 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1034 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1035 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1036 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1037 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1038 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1039 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1040 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1041 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1042 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1043 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1044 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1045 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1046 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1047 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1048 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1049 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1050 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1051 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1052 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1053 ); -INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1054 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1000 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1001 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1002 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1003 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1004 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1005 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1006 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1007 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1008 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1009 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1010 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1011 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1012 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1013 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1014 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1015 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1016 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1017 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1018 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1019 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1020 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1021 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1022 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1023 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1024 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1025 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1026 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1027 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1028 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1029 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1030 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1031 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1032 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1033 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1034 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1035 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1036 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1037 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1038 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1039 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1040 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1041 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1042 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1043 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1044 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1045 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1046 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1047 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1048 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1049 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1050 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1051 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1052 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1053 ); +-- INSERT INTO public.meta_target_service_type ( id ) VALUES ( 1054 ); INSERT INTO public.meta_probe_status ( id , key , "name" ) VALUES ( 1 , 'INITIAL' , 'Initial' ); @@ -973,13 +973,13 @@ INSERT INTO public.sensor (target_id, "name", description, meta_sensor_status_id 3, 'PostgreSQL Sensor', 'PostgreSQL', 1, 35, 0); -INSERT INTO public.noauth_probe (api_key,temp_probe_key,domain_id,probe_id,meta_noauth_probe_status_id,description) VALUES ( +INSERT INTO public.noauth_probe (api_key,temp_probe_key,domain_id,probe_id,meta_noauth_probe_status_id,infra_host_meta) VALUES ( '52abd6fd57e511e7ac52080027658d13','1cf2555c57d511e79714080027658d13',1,NULL,3,'{"host":{"name":"geek-ubuntu","os":"linux","paltform":"ubuntu","platformFamily":"debian","platformVersion":"","kernelVersion":"4.4.0-93-generic","hostID":"03000200-0400-0500-0006-000700080009"},"network":{"name":"enp3s0","address":"192.168.1.103/24|fe80::36c0:6c3e:6006:dd23/64","gateway":"192.168.1.254","macAddress":"44:8a:5b:f1:f1:f3"}}'); -INSERT INTO public.noauth_probe (api_key,temp_probe_key,domain_id,probe_id,meta_noauth_probe_status_id,description) VALUES ( +INSERT INTO public.noauth_probe (api_key,temp_probe_key,domain_id,probe_id,meta_noauth_probe_status_id,infra_host_meta) VALUES ( '52abd6fd57e511e7ac52080027658d13','1cf2555c57d511e79714080027658d14',1,NULL,3,'{"host":{"name":"insanity-ubuntu","os":"linux","paltform":"ubuntu","platformFamily":"debian","platformVersion":"","kernelVersion":"4.4.0-93-generic","hostID":"4C4C4544-0044-4A10-8039-C7C04F595031"},"network":{"name":"enp3s0","address":"192.168.1.105/24|fe80::36c0:6c3e:6006:dd23/64","gateway":"192.168.1.254","macAddress":"44:8a:5b:f1:f1:f3"}}'); -INSERT INTO public.noauth_probe (api_key,temp_probe_key,domain_id,probe_id,meta_noauth_probe_status_id,description) VALUES ( +INSERT INTO public.noauth_probe (api_key,temp_probe_key,domain_id,probe_id,meta_noauth_probe_status_id,infra_host_meta) VALUES ( '52abd6fd57e511e7ac52080027658d13','1cf2555c57d511e79714080027658d15',1,NULL,3,'{"host":{"name":"snoop-ubuntu","os":"linux","paltform":"ubuntu","platformFamily":"debian","platformVersion":"","kernelVersion":"4.4.0-93-generic","hostID":"DE60E4C3-347A-4D38-AEAB-1760471665EA"},"network":{"name":"enp3s0","address":"192.168.1.106/24|fe80::36c0:6c3e:6006:dd23/64","gateway":"192.168.1.254","macAddress":"44:8a:5b:f1:f1:f3"}}'); diff --git a/src/test/java/com/loafle/overflow/central/module/noauthprobe/service/NoAuthProbeServiceTest.java b/src/test/java/com/loafle/overflow/central/module/noauthprobe/service/NoAuthProbeServiceTest.java index b7126e9..7abf50f 100644 --- a/src/test/java/com/loafle/overflow/central/module/noauthprobe/service/NoAuthProbeServiceTest.java +++ b/src/test/java/com/loafle/overflow/central/module/noauthprobe/service/NoAuthProbeServiceTest.java @@ -40,7 +40,7 @@ public class NoAuthProbeServiceTest { // noAuthProbe.setHostName("snoop"); // noAuthProbe.setIpAddress(3232235980L); // noAuthProbe.setMacAddress(8796753988883L); - noAuthProbe.setDescription( + noAuthProbe.setInfraHostMeta( "{\"host\":{\"name\":\"snoop-ubuntu\",\"os\":\"linux\",\"paltform\":\"ubuntu\",\"platformFamily\":\"debian\",\"platformVersion\":\"\",\"kernelVersion\":\"4.4.0-93-generic\",\"hostID\":\"DE60E4C3-347A-4D38-AEAB-1760471665EA\"},\"network\":{\"name\":\"enp3s0\",\"address\":\"192.168.1.106/24|fe80::36c0:6c3e:6006:dd23/64\",\"gateway\":\"192.168.1.254\",\"macAddress\":\"44:8a:5b:f1:f1:f3\"}}"); noAuthProbe.setApiKey("52abd6fd57e511e7ac52080027658d13"); @@ -70,7 +70,7 @@ public class NoAuthProbeServiceTest { // noAuthProbe.setHostName("geek"); // noAuthProbe.setIpAddress(3232235980L); // noAuthProbe.setMacAddress(8796753988883L); - noAuthProbe.setDescription( + noAuthProbe.setInfraHostMeta( "{\"host\":{\"name\":\"geek-ubuntu\",\"os\":\"linux\",\"paltform\":\"ubuntu\",\"platformFamily\":\"debian\",\"platformVersion\":\"\",\"kernelVersion\":\"4.4.0-93-generic\",\"hostID\":\"03000200-0400-0500-0006-000700080009\"},\"network\":{\"name\":\"enp3s0\",\"address\":\"192.168.1.103/24|fe80::36c0:6c3e:6006:dd23/64\",\"gateway\":\"192.168.1.254\",\"macAddress\":\"44:8a:5b:f1:f1:f3\"}}"); noAuthProbe.setApiKey("521abd6fd57e511e7ac52080027658d13"); @@ -117,7 +117,7 @@ public class NoAuthProbeServiceTest { @Test public void acceptProbe() throws Exception { - this.noAuthProbeService.acceptNoAuthProbe(Long.valueOf(1)); + this.noAuthProbeService.acceptNoAuthProbe(Long.valueOf(1), "192.168.1.0/24"); }