From a50164bec1297beca6ce256a40f501d6fd00c280 Mon Sep 17 00:00:00 2001 From: snoop Date: Wed, 6 Sep 2017 15:41:50 +0900 Subject: [PATCH] added item_key option --- .../module/meta/model/MetaSensorItemKey.java | 10 + .../service/MetaSensorItemKeyService.java | 6 +- .../module/sensor/service/SensorService.java | 193 ++++++-- src/main/resources/init.sql | 442 +++++++++--------- .../service/MetaSensorItemKeyServiceTest.java | 3 +- .../sensor/service/SensorServiceTest.java | 14 +- 6 files changed, 419 insertions(+), 249 deletions(-) diff --git a/src/main/java/com/loafle/overflow/module/meta/model/MetaSensorItemKey.java b/src/main/java/com/loafle/overflow/module/meta/model/MetaSensorItemKey.java index 7da12b4..ccd80cd 100644 --- a/src/main/java/com/loafle/overflow/module/meta/model/MetaSensorItemKey.java +++ b/src/main/java/com/loafle/overflow/module/meta/model/MetaSensorItemKey.java @@ -13,6 +13,7 @@ public class MetaSensorItemKey { private MetaSensorItem item; private String key; private String froms; + private String option; private MetaCrawler crawler; private Date createDate; @@ -54,6 +55,15 @@ public class MetaSensorItemKey { this.froms = froms; } + @Column(name = "OPTION_JSON", nullable = true) + public String getOption() { + return option; + } + + public void setOption(String option) { + this.option = option; + } + @ManyToOne @JoinColumn(name = "CRAWLER_ID", nullable = false) public MetaCrawler getCrawler() { diff --git a/src/main/java/com/loafle/overflow/module/meta/service/MetaSensorItemKeyService.java b/src/main/java/com/loafle/overflow/module/meta/service/MetaSensorItemKeyService.java index 7db37d0..3e3bb44 100644 --- a/src/main/java/com/loafle/overflow/module/meta/service/MetaSensorItemKeyService.java +++ b/src/main/java/com/loafle/overflow/module/meta/service/MetaSensorItemKeyService.java @@ -21,14 +21,14 @@ public class MetaSensorItemKeyService { - public Map readAllByCrawler(MetaCrawler metaCrawler) { + public Map readAllByCrawler(MetaCrawler metaCrawler) { - Map resultMap = new HashMap<>(); + Map resultMap = new HashMap<>(); List resultList = this.metaSensorItemKeyDAO.findAllByCrawler(metaCrawler); for(MetaSensorItemKey oa : resultList) { - resultMap.put(oa.getItem().getId(), oa.getKey()); + resultMap.put(oa.getItem().getId(), oa); } return resultMap; diff --git a/src/main/java/com/loafle/overflow/module/sensor/service/SensorService.java b/src/main/java/com/loafle/overflow/module/sensor/service/SensorService.java index 0803d17..fd5971a 100644 --- a/src/main/java/com/loafle/overflow/module/sensor/service/SensorService.java +++ b/src/main/java/com/loafle/overflow/module/sensor/service/SensorService.java @@ -5,9 +5,11 @@ import com.loafle.overflow.commons.utils.PageUtil; import com.loafle.overflow.commons.utils.StringConvertor; import com.loafle.overflow.crawler.config.*; import com.loafle.overflow.module.domain.model.Domain; -import com.loafle.overflow.module.infra.model.*; +import com.loafle.overflow.module.infra.model.Infra; +import com.loafle.overflow.module.infra.model.InfraHost; import com.loafle.overflow.module.infra.service.InfraService; import com.loafle.overflow.module.meta.model.MetaCrawler; +import com.loafle.overflow.module.meta.model.MetaSensorItemKey; import com.loafle.overflow.module.meta.model.MetaSensorStatus; import com.loafle.overflow.module.meta.service.MetaSensorItemKeyService; import com.loafle.overflow.module.probe.model.Probe; @@ -49,7 +51,7 @@ public class SensorService { @Autowired private MetaSensorItemKeyService metaSensorItemKeyService; - private Map> mappingMap = null; + private Map> mappingMap = null; public Sensor regist(Sensor sensor) { return this.sensorDAO.save(sensor); @@ -133,9 +135,74 @@ public class SensorService { if(infra.getInfraType().getId() == 7) { return this.processService(dbSensor, sensorItems, infra); } + if(infra.getInfraType().getId() == 2) { + return this.processHost(dbSensor, sensorItems, infra); + } return null; + } + private String processHost(Sensor dbSensor, List sensorItems, Infra infra) throws IOException { + + InfraHost infraHost = (InfraHost)infra; + + Config config = new Config(); + config.setId(String.valueOf(dbSensor.getId())); + + com.loafle.overflow.crawler.config.Target target = this.createTarget(infraHost, dbSensor); + + config.setTarget(target); + + // FIXME: Interval + Schedule schedule = new Schedule(); + schedule.setInterval("5"); + config.setSchedule(schedule); + + Crawler crawler = this.getCrawler(dbSensor.getCrawler()); + config.setCrawler(crawler); + + Map keyMap = this.initMappingMap(dbSensor.getCrawler()); + + switch (dbSensor.getCrawler().getId()) { + case 23: + processWMI(sensorItems, keyMap, dbSensor, config); + default: + break; + } + + ObjectMapper objectMapper = new ObjectMapper(); + return objectMapper.writeValueAsString(config); + } + + private com.loafle.overflow.crawler.config.Target createTarget(InfraHost infraHost, Sensor dbSensor) { + + com.loafle.overflow.crawler.config.Target target = new com.loafle.overflow.crawler.config.Target(); + Connection connection = new Connection(); + connection.setIp(StringConvertor.intToIp(infraHost.getIp())); + + + switch (dbSensor.getCrawler().getId()) { + case 23: + { + connection.setPort("135"); + connection.setPortType("tcp"); + connection.setSsl(false); + + target.setConnection(connection); + + // FIXME: load crawler Auth Info + Map auth = new HashMap<>(); + auth.put("id", "administrator"); + auth.put("pw", "dbseogns18"); + + target.setAuth(auth); + + } + break; + } + + + return target; } private String processService(Sensor dbSensor, List sensorItems, Infra infra) throws IOException { @@ -167,15 +234,29 @@ public class SensorService { Crawler crawler = this.getCrawler(dbSensor.getCrawler()); config.setCrawler(crawler); - Map KeyMap = this.initMappingMap(dbSensor.getCrawler()); + Map keyMap = this.initMappingMap(dbSensor.getCrawler()); + switch (dbSensor.getCrawler().getId()) { + case 11: + processMysql(sensorItems, keyMap, dbSensor, config); + case 23: + processWMI(sensorItems, keyMap, dbSensor, config); + default: + break; + } + + ObjectMapper objectMapper = new ObjectMapper(); + return objectMapper.writeValueAsString(config); + } + + private void processMysql(List sensorItems, Map KeyMap, Sensor dbSensor, Config config) throws IOException { Item item = new Item(); Keys keys = null; List keysList = new ArrayList<>(); for(SensorItem sItem : sensorItems) { keys = new Keys(); keys.setMetric(sItem.getItem().getKey()); - keys.setKey(KeyMap.get(sItem.getItem().getId())); + keys.setKey(KeyMap.get(sItem.getItem().getId()).getKey()); keysList.add(keys); } item.setKeys(keysList); @@ -194,9 +275,79 @@ public class SensorService { config.setItems(itemList); - ObjectMapper objectMapper = new ObjectMapper(); +// ObjectMapper objectMapper = new ObjectMapper(); +// +// return objectMapper.writeValueAsString(config); + } + private void processWMI(List sensorItems, Map keyMap, Sensor dbSensor, Config config) throws IOException { + + List keysList = new ArrayList<>(); + + Map> metricMap = new HashMap<>(); + + MetaSensorItemKey itemKey = null; + Keys keys = null; + for(SensorItem sItem : sensorItems) { + + itemKey = keyMap.get(sItem.getItem().getId()); + + if(metricMap.containsKey(itemKey.getFroms()) == false) { + metricMap.put(itemKey.getFroms(), new ArrayList<>()); + } + keys = new Keys(); + keys.setKey(itemKey.getKey()); + keys.setMetric(itemKey.getItem().getKey()); + + metricMap.get(itemKey.getFroms()).add(keys); + } + + List itemList = new ArrayList<>(); + Item item = null; + QueryInfo queryInfo = null; + MappingInfo mappingInfo = null; + String query = null; + StringBuffer stringBuffer = new StringBuffer(); + + Map extendMap = new HashMap<>(); + extendMap.put("nameSpace", "root/cimv2"); + extendMap.put("wmicPath", "/home/snoop/temp/wmic"); + + for(Map.Entry> elems : metricMap.entrySet()) { + item = new Item(); + stringBuffer.setLength(0); + + stringBuffer.append("SELECT "); + + for(int indexI = 0; indexI < elems.getValue().size(); ++indexI) { + stringBuffer.append(elems.getValue().get(indexI).getKey()); + if(indexI + 1 < elems.getValue().size()) { + stringBuffer.append(", "); + } + } + + stringBuffer.append(" FROM "); + stringBuffer.append(elems.getKey()); + + queryInfo = new QueryInfo(); + queryInfo.setQuery(stringBuffer.toString()); + queryInfo.setExtend(extendMap); + + mappingInfo = new MappingInfo(); + mappingInfo.setParseDirection("col"); + List arrayColumns = new ArrayList<>(); + arrayColumns.add("Caption"); + mappingInfo.setArrayColumns(arrayColumns); + + item.setMappingInfo(mappingInfo); + item.setQueryInfo(queryInfo); + item.setKeys(elems.getValue()); + + itemList.add(item); + + } + + config.setItems(itemList); - return objectMapper.writeValueAsString(config); } private void setQueryAndMapping(MetaCrawler metaCrawler, List keysList, QueryInfo queryInfo, MappingInfo mappingInfo) { @@ -233,13 +384,13 @@ public class SensorService { } - private Map initMappingMap(MetaCrawler metaCrawler) { + private Map initMappingMap(MetaCrawler metaCrawler) { if(this.mappingMap == null) { this.mappingMap = new HashMap<>(); } - Map resultMap = this.mappingMap.get(metaCrawler.getId()); + Map resultMap = this.mappingMap.get(metaCrawler.getId()); if(resultMap != null) { return resultMap; @@ -297,30 +448,4 @@ public class SensorService { return crawler; } - private InfraHost getInfraHost(Infra infra) { - - switch (infra.getInfraType().getId()) { - case 1: - InfraMachine infraMachine = (InfraMachine)infra; - break; - case 2: - InfraHost infraHost = (InfraHost)infra; - return infraHost; - case 3: - InfraOS infraOS = (InfraOS)infra; - break; - case 4: - InfraOSApplication infraOSApplication = (InfraOSApplication)infra; - break; - case 5: - InfraOSDaemon infraOSDaemon = (InfraOSDaemon)infra; - case 6: - InfraOSPort infraOSPort = (InfraOSPort)infra; - break; - case 7: - com.loafle.overflow.module.infra.model.InfraService infraOSService = (com.loafle.overflow.module.infra.model.InfraService)infra; - return infraOSService.getHost(); - } - return null; - } } diff --git a/src/main/resources/init.sql b/src/main/resources/init.sql index 5a23153..27d5b0e 100644 --- a/src/main/resources/init.sql +++ b/src/main/resources/init.sql @@ -521,218 +521,215 @@ INSERT INTO meta_sensor_item (create_date,"key",name,type_id) VALUES ( INSERT INTO meta_sensor_item (create_date,"key",name,type_id) VALUES ( '2017-06-26 20:10','mem.usage.free.paging','FreeSpaceInPagingFiles','2'); INSERT INTO meta_sensor_item (create_date,"key",name,type_id) VALUES ( -'2017-06-26 20:10','disk.usage.caption[$0]','Caption','3'); -INSERT INTO meta_sensor_item (create_date,"key",name,type_id) VALUES ( '2017-06-26 20:10','disk.usage.total[$0]','Size','3'); INSERT INTO meta_sensor_item (create_date,"key",name,type_id) VALUES ( '2017-06-26 20:10','disk.usage.free[$0]','FreeSpace','3'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_buffer_pool_dump_status','show status','11','5'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_buffer_pool_load_status','show status','11','6'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_buffer_pool_resize_status','show status','11','7'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_buffer_pool_pages_data','show status','11','8'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_buffer_pool_bytes_data','show status','11','9'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_buffer_pool_pages_dirty','show status','11','10'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_buffer_pool_bytes_dirty','show status','11','11'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_buffer_pool_pages_flushed','show status','11','12'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_buffer_pool_pages_free','show status','11','13'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_buffer_pool_pages_misc','show status','11','14'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_buffer_pool_pages_total','show status','11','15'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_buffer_pool_read_ahead_rnd','show status','11','16'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_buffer_pool_read_ahead','show status','11','17'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_buffer_pool_read_ahead_evicted','show status','11','18'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_buffer_pool_read_requests','show status','11','19'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_buffer_pool_reads','show status','11','20'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_buffer_pool_wait_free','show status','11','21'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_buffer_pool_write_requests','show status','11','22'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_data_fsyncs','show status','11','23'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_data_pending_fsyncs','show status','11','24'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_data_pending_reads','show status','11','25'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_data_pending_writes','show status','11','26'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_data_read','show status','11','27'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_data_reads','show status','11','28'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_data_writes','show status','11','29'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_data_written','show status','11','30'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_dblwr_pages_written','show status','11','31'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_dblwr_writes','show status','11','32'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_log_waits','show status','11','33'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_log_write_requests','show status','11','34'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_log_writes','show status','11','35'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_os_log_fsyncs','show status','11','36'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_os_log_pending_fsyncs','show status','11','37'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_os_log_pending_writes','show status','11','38'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_os_log_written','show status','11','39'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_page_size','show status','11','40'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_pages_created','show status','11','41'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_pages_read','show status','11','42'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_pages_written','show status','11','43'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_row_lock_current_waits','show status','11','44'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_row_lock_time','show status','11','45'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_row_lock_time_avg','show status','11','46'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_row_lock_time_max','show status','11','47'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_row_lock_waits','show status','11','48'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_rows_deleted','show status','11','49'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_rows_inserted','show status','11','50'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_rows_read','show status','11','51'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_rows_updated','show status','11','52'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_num_open_files','show status','11','53'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_truncated_status_writes','show status','11','54'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Innodb_available_undo_logs','show status','11','55'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Connection_errors_accept','show status','11','56'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Connection_errors_internal','show status','11','57'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Connection_errors_max_connections','show status','11','58'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Connection_errors_peer_address','show status','11','59'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Connection_errors_select','show status','11','60'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Connection_errors_tcpwrap','show status','11','61'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Connections','show status','11','62'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Max_used_connections','show status','11','63'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Max_used_connections_time','show status','11','64'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Performance_schema_accounts_lost','show status','11','65'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Performance_schema_cond_classes_lost','show status','11','66'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Performance_schema_cond_instances_lost','show status','11','67'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Performance_schema_digest_lost','show status','11','68'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Performance_schema_file_classes_lost','show status','11','69'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Performance_schema_file_handles_lost','show status','11','70'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Performance_schema_file_instances_lost','show status','11','71'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Performance_schema_hosts_lost','show status','11','72'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Performance_schema_index_stat_lost','show status','11','73'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Performance_schema_locker_lost','show status','11','74'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Performance_schema_memory_classes_lost','show status','11','75'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Performance_schema_metadata_lock_lost','show status','11','76'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Performance_schema_mutex_classes_lost','show status','11','77'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Performance_schema_mutex_instances_lost','show status','11','78'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Performance_schema_nested_statement_lost','show status','11','79'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Performance_schema_prepared_statements_lost','show status','11','80'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Performance_schema_program_lost','show status','11','81'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Performance_schema_rwlock_classes_lost','show status','11','82'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Performance_schema_rwlock_instances_lost','show status','11','83'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Performance_schema_session_connect_attrs_lost','show status','11','84'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Performance_schema_socket_classes_lost','show status','11','85'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Performance_schema_socket_instances_lost','show status','11','86'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Performance_schema_stage_classes_lost','show status','11','87'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Performance_schema_statement_classes_lost','show status','11','88'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Performance_schema_table_handles_lost','show status','11','89'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Performance_schema_table_instances_lost','show status','11','90'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Performance_schema_table_lock_stat_lost','show status','11','91'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Performance_schema_thread_classes_lost','show status','11','92'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Performance_schema_thread_instances_lost','show status','11','93'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Performance_schema_users_lost','show status','11','94'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','PercentIdleTime','Win32_PerfFormattedData_PerfOS_Processor where Name=''_Total''','23','95'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','PercentProcessorTime','Win32_PerfFormattedData_PerfOS_Processor where Name=''_Total''','23','96'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','PercentUserTime','Win32_PerfFormattedData_PerfOS_Processor where Name=''_Total''','23','97'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','PercentPrivilegedTime','Win32_PerfFormattedData_PerfOS_Processor where Name=''_Total''','23','98'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','TotalVirtualMemorySize','Win32_OperatingSystem','23','99'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','TotalVisibleMemorySize','Win32_OperatingSystem','23','100'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','SizeStoredInPagingFiles','Win32_OperatingSystem','23','101'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','FreeVirtualMemory','Win32_OperatingSystem','23','102'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','FreePhysicalMemory','Win32_OperatingSystem','23','103'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','FreeSpaceInPagingFiles','Win32_OperatingSystem ','23','104'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Caption','Win32_LogicalDisk','23','105'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','Size','Win32_LogicalDisk','23','106'); -INSERT INTO meta_sensor_item_key (create_date,"key","froms",crawler_id,item_id) VALUES ( -'2017-06-26 19:49','FreeSpace','Win32_LogicalDisk','23','107'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_buffer_pool_dump_status','show status','','11','5'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_buffer_pool_load_status','show status','','11','6'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_buffer_pool_resize_status','show status','','11','7'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_buffer_pool_pages_data','show status','','11','8'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_buffer_pool_bytes_data','show status','','11','9'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_buffer_pool_pages_dirty','show status','','11','10'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_buffer_pool_bytes_dirty','show status','','11','11'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_buffer_pool_pages_flushed','show status','','11','12'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_buffer_pool_pages_free','show status','','11','13'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_buffer_pool_pages_misc','show status','','11','14'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_buffer_pool_pages_total','show status','','11','15'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_buffer_pool_read_ahead_rnd','show status','','11','16'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_buffer_pool_read_ahead','show status','','11','17'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_buffer_pool_read_ahead_evicted','show status','','11','18'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_buffer_pool_read_requests','show status','','11','19'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_buffer_pool_reads','show status','','11','20'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_buffer_pool_wait_free','show status','','11','21'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_buffer_pool_write_requests','show status','','11','22'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_data_fsyncs','show status','','11','23'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_data_pending_fsyncs','show status','','11','24'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_data_pending_reads','show status','','11','25'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_data_pending_writes','show status','','11','26'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_data_read','show status','','11','27'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_data_reads','show status','','11','28'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_data_writes','show status','','11','29'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_data_written','show status','','11','30'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_dblwr_pages_written','show status','','11','31'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_dblwr_writes','show status','','11','32'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_log_waits','show status','','11','33'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_log_write_requests','show status','','11','34'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_log_writes','show status','','11','35'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_os_log_fsyncs','show status','','11','36'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_os_log_pending_fsyncs','show status','','11','37'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_os_log_pending_writes','show status','','11','38'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_os_log_written','show status','','11','39'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_page_size','show status','','11','40'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_pages_created','show status','','11','41'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_pages_read','show status','','11','42'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_pages_written','show status','','11','43'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_row_lock_current_waits','show status','','11','44'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_row_lock_time','show status','','11','45'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_row_lock_time_avg','show status','','11','46'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_row_lock_time_max','show status','','11','47'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_row_lock_waits','show status','','11','48'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_rows_deleted','show status','','11','49'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_rows_inserted','show status','','11','50'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_rows_read','show status','','11','51'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_rows_updated','show status','','11','52'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_num_open_files','show status','','11','53'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_truncated_status_writes','show status','','11','54'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Innodb_available_undo_logs','show status','','11','55'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Connection_errors_accept','show status','','11','56'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Connection_errors_internal','show status','','11','57'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Connection_errors_max_connections','show status','','11','58'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Connection_errors_peer_address','show status','','11','59'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Connection_errors_select','show status','','11','60'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Connection_errors_tcpwrap','show status','','11','61'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Connections','show status','','11','62'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Max_used_connections','show status','','11','63'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Max_used_connections_time','show status','','11','64'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Performance_schema_accounts_lost','show status','','11','65'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Performance_schema_cond_classes_lost','show status','','11','66'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Performance_schema_cond_instances_lost','show status','','11','67'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Performance_schema_digest_lost','show status','','11','68'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Performance_schema_file_classes_lost','show status','','11','69'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Performance_schema_file_handles_lost','show status','','11','70'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Performance_schema_file_instances_lost','show status','','11','71'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Performance_schema_hosts_lost','show status','','11','72'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Performance_schema_index_stat_lost','show status','','11','73'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Performance_schema_locker_lost','show status','','11','74'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Performance_schema_memory_classes_lost','show status','','11','75'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Performance_schema_metadata_lock_lost','show status','','11','76'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Performance_schema_mutex_classes_lost','show status','','11','77'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Performance_schema_mutex_instances_lost','show status','','11','78'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Performance_schema_nested_statement_lost','show status','','11','79'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Performance_schema_prepared_statements_lost','show status','','11','80'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Performance_schema_program_lost','show status','','11','81'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Performance_schema_rwlock_classes_lost','show status','','11','82'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Performance_schema_rwlock_instances_lost','show status','','11','83'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Performance_schema_session_connect_attrs_lost','show status','','11','84'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Performance_schema_socket_classes_lost','show status','','11','85'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Performance_schema_socket_instances_lost','show status','','11','86'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Performance_schema_stage_classes_lost','show status','','11','87'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Performance_schema_statement_classes_lost','show status','','11','88'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Performance_schema_table_handles_lost','show status','','11','89'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Performance_schema_table_instances_lost','show status','','11','90'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Performance_schema_table_lock_stat_lost','show status','','11','91'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Performance_schema_thread_classes_lost','show status','','11','92'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Performance_schema_thread_instances_lost','show status','','11','93'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Performance_schema_users_lost','show status','','11','94'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','PercentIdleTime','Win32_PerfFormattedData_PerfOS_Processor','{"where": "Name=''_Total''"}','23','95'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','PercentProcessorTime','Win32_PerfFormattedData_PerfOS_Processor','{"where": "Name=''_Total''"}','23','96'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','PercentUserTime','Win32_PerfFormattedData_PerfOS_Processor','{"where": "Name=''_Total''"}','23','97'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','PercentPrivilegedTime','Win32_PerfFormattedData_PerfOS_Processor','{"where": "Name=''_Total''"}','23','98'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','TotalVirtualMemorySize','Win32_OperatingSystem','','23','99'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','TotalVisibleMemorySize','Win32_OperatingSystem','','23','100'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','SizeStoredInPagingFiles','Win32_OperatingSystem','','23','101'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','FreeVirtualMemory','Win32_OperatingSystem','','23','102'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','FreePhysicalMemory','Win32_OperatingSystem','','23','103'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','FreeSpaceInPagingFiles','Win32_OperatingSystem ','','23','104'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','Size','Win32_LogicalDisk','{"arrayColumns": ["Caption"],"appends": ["Caption"]}','23','105'); +INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES ( +'2017-06-26 19:49','FreeSpace','Win32_LogicalDisk','{"arrayColumns": ["Caption"],"appends": ["Caption"]}','23','106'); + INSERT INTO public.meta_vendor_crawler (id,create_date,crawler_id,vendor_id) VALUES ( 1,'2017-07-27 15:29:48.634',23,26); @@ -819,7 +816,7 @@ INSERT INTO public."member" (company_name,create_date,email,"name",phone,pw,stat 'loafle','2017-06-26 11:07:27.625','overflow@loafle.com','overFlow','000-000-0000','$2a$10$G2bbjoX9.fOnxJx/8DZqPujFYrEQtIEB.f98/8K20XiGWEhwPakZ.',2); INSERT INTO public."member" (company_name,create_date,email,"name",phone,pw,status_id) VALUES ( -'loafle','2017-06-26 11:07:27.625','geekdev@naver.com','geek','000-000-0000','$2a$10$G2bbjoX9.fOnxJx/8DZqPujFYrEQtIEB.f98/8K20XiGWEhwPakZ.',1); +'loafle','2017-06-26 11:07:27.625','geek@loafle.com','geek','000-000-0000','$2a$10$G2bbjoX9.fOnxJx/8DZqPujFYrEQtIEB.f98/8K20XiGWEhwPakZ.',1); INSERT INTO public.email_auth (auth_confirm_date,create_date,email_auth_key,member_id) VALUES ( NULL,'2017-06-26 15:28:48.895','dbseogns1234',1); @@ -893,6 +890,8 @@ INSERT INTO public.sensor (crawler_input_items,create_date,description,crawler_i NULL,'2017-06-26 20:19:07.074','My sensor 22222',1,2,1); INSERT INTO public.sensor (crawler_input_items,create_date,description,crawler_id,status,target_id) VALUES ( NULL,'2017-08-28 16:17:05.506','OS_SERVICE-MYSQL_CRAWLER',11,1,4); +INSERT INTO public.sensor (crawler_input_items,create_date,description,crawler_id,status,target_id) VALUES ( +NULL,'2017-09-05 12:26:02.738','HOST-WMI_CRAWLER',23,1,3); INSERT INTO public.sensor_item (create_date,item_id,sensor_id) VALUES ( '2017-06-26 20:21:16.626',1,1); @@ -1079,6 +1078,30 @@ INSERT INTO public.sensor_item (create_date,item_id,sensor_id) VALUES ( '2017-08-28 16:17:05.506',93,3); INSERT INTO public.sensor_item (create_date,item_id,sensor_id) VALUES ( '2017-08-28 16:17:05.506',94,3); +INSERT INTO public.sensor_item (create_date,item_id,sensor_id) VALUES ( +'2017-09-05 12:26:02.738',95,4); +INSERT INTO public.sensor_item (create_date,item_id,sensor_id) VALUES ( +'2017-09-05 12:26:02.738',96,4); +INSERT INTO public.sensor_item (create_date,item_id,sensor_id) VALUES ( +'2017-09-05 12:26:02.738',97,4); +INSERT INTO public.sensor_item (create_date,item_id,sensor_id) VALUES ( +'2017-09-05 12:26:02.738',98,4); +INSERT INTO public.sensor_item (create_date,item_id,sensor_id) VALUES ( +'2017-09-05 12:26:02.738',99,4); +INSERT INTO public.sensor_item (create_date,item_id,sensor_id) VALUES ( +'2017-09-05 12:26:02.738',100,4); +INSERT INTO public.sensor_item (create_date,item_id,sensor_id) VALUES ( +'2017-09-05 12:26:02.738',101,4); +INSERT INTO public.sensor_item (create_date,item_id,sensor_id) VALUES ( +'2017-09-05 12:26:02.738',102,4); +INSERT INTO public.sensor_item (create_date,item_id,sensor_id) VALUES ( +'2017-09-05 12:26:02.738',103,4); +INSERT INTO public.sensor_item (create_date,item_id,sensor_id) VALUES ( +'2017-09-05 12:26:02.738',104,4); +INSERT INTO public.sensor_item (create_date,item_id,sensor_id) VALUES ( +'2017-09-05 12:26:02.738',105,4); +INSERT INTO public.sensor_item (create_date,item_id,sensor_id) VALUES ( +'2017-09-05 12:26:02.738',106,4); INSERT INTO public.noauth_probe (api_key,create_date,host_name,ip_address,mac_address,temp_probe_key,domain_id,probe_id,status) VALUES ( '52abd6fd57e511e7ac52080027658d13','2017-06-26 12:43:46.877','snoop',3232235980,8796753988883,'1cf2555c57d511e79714080027658d13',1,NULL,3); @@ -1297,7 +1320,6 @@ INSERT INTO public.history (id,create_date,message,domain_id,member_id,probe_id, INSERT INTO public.history (id,create_date,message,domain_id,member_id,probe_id,type_id) VALUES ( 100,'2017-08-24 18:33:27.217','Test History 99',1,1,1,3); - INSERT INTO public.notification (id,confirm_date,create_date,message,title,member_id) VALUES ( 1,'2017-08-29 16:39:16.198','2017-08-29 16:39:17.756','Message0','Title0',1); INSERT INTO public.notification (id,confirm_date,create_date,message,title,member_id) VALUES ( diff --git a/src/test/java/com/loafle/overflow/module/meta/service/MetaSensorItemKeyServiceTest.java b/src/test/java/com/loafle/overflow/module/meta/service/MetaSensorItemKeyServiceTest.java index af4067a..948f3e7 100644 --- a/src/test/java/com/loafle/overflow/module/meta/service/MetaSensorItemKeyServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/meta/service/MetaSensorItemKeyServiceTest.java @@ -1,6 +1,7 @@ package com.loafle.overflow.module.meta.service; import com.loafle.overflow.module.meta.model.MetaCrawler; +import com.loafle.overflow.module.meta.model.MetaSensorItemKey; import com.loafle.overflow.spring.AppConfigTest; import org.junit.Assert; import org.junit.Test; @@ -27,7 +28,7 @@ public class MetaSensorItemKeyServiceTest { MetaCrawler metaCrawler = new MetaCrawler(); metaCrawler.setId((short)11); - Map resultMap = this.metaSensorItemKeyService.readAllByCrawler(metaCrawler); + Map resultMap = this.metaSensorItemKeyService.readAllByCrawler(metaCrawler); Assert.assertNotEquals(resultMap.size(), 0); diff --git a/src/test/java/com/loafle/overflow/module/sensor/service/SensorServiceTest.java b/src/test/java/com/loafle/overflow/module/sensor/service/SensorServiceTest.java index d0f8fbf..f504da9 100644 --- a/src/test/java/com/loafle/overflow/module/sensor/service/SensorServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/sensor/service/SensorServiceTest.java @@ -65,7 +65,7 @@ public class SensorServiceTest { public void generateSensorConfig() throws IOException { Sensor sensor = new Sensor(); - sensor.setId(3); + sensor.setId(4); String result = this.sensorService.generateSensorConfig(sensor); System.out.println(result); @@ -87,6 +87,18 @@ public class SensorServiceTest { } + @Test + public void stringbbb() { + StringBuffer stringBuffer = new StringBuffer(); + + stringBuffer.append("222222222222222222222222222"); + System.out.println(stringBuffer.toString()); + stringBuffer.setLength(0); + System.out.println(stringBuffer.toString()); + stringBuffer.append("3333333333"); + System.out.println(stringBuffer.toString()); + } + // @Test // public void readAllByTarget() throws Exception { // Target target = new Target();