refactoring
This commit is contained in:
parent
297e94b21f
commit
800cc6f3b7
|
@ -0,0 +1,151 @@
|
||||||
|
package com.loafle.overflow.module.generator.service;
|
||||||
|
|
||||||
|
import com.loafle.overflow.commons.utils.StringConvertor;
|
||||||
|
import com.loafle.overflow.crawler.config.Connection;
|
||||||
|
import com.loafle.overflow.crawler.config.Crawler;
|
||||||
|
import com.loafle.overflow.crawler.config.Keys;
|
||||||
|
import com.loafle.overflow.module.infra.model.InfraHost;
|
||||||
|
import com.loafle.overflow.module.meta.model.MetaCrawler;
|
||||||
|
import com.loafle.overflow.module.meta.model.MetaSensorItemKey;
|
||||||
|
import com.loafle.overflow.module.meta.service.MetaSensorItemKeyService;
|
||||||
|
import com.loafle.overflow.module.sensor.model.Sensor;
|
||||||
|
import com.loafle.overflow.module.sensor.model.SensorItem;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by snoop on 17. 9. 6.
|
||||||
|
*/
|
||||||
|
@Service("GenerateUtil")
|
||||||
|
public class GenerateUtil {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MetaSensorItemKeyService metaSensorItemKeyService;
|
||||||
|
|
||||||
|
private Map<Short, Map<Integer, MetaSensorItemKey>> mappingMap = null;
|
||||||
|
|
||||||
|
public Map<Integer, MetaSensorItemKey> initMappingMap(MetaCrawler metaCrawler) {
|
||||||
|
|
||||||
|
if(this.mappingMap == null) {
|
||||||
|
this.mappingMap = new HashMap<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<Integer, MetaSensorItemKey> resultMap = this.mappingMap.get(metaCrawler.getId());
|
||||||
|
|
||||||
|
if(resultMap != null) {
|
||||||
|
return resultMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
resultMap = this.metaSensorItemKeyService.readAllByCrawler(metaCrawler);
|
||||||
|
this.mappingMap.put(metaCrawler.getId(), resultMap);
|
||||||
|
|
||||||
|
return resultMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, Object> getAuth(MetaCrawler metaCrawler, com.loafle.overflow.module.infra.model.InfraService infraService) {
|
||||||
|
|
||||||
|
Map<String, Object> auth = new HashMap<>();
|
||||||
|
|
||||||
|
switch (metaCrawler.getId()) {
|
||||||
|
case 11: // mysql
|
||||||
|
{
|
||||||
|
auth.put("url", "jdbc:mysql://"+ StringConvertor.intToIp(infraService.getHost().getIp())+":"+String.valueOf(infraService.getPort()));
|
||||||
|
auth.put("id", "docker"); // FIXME: Auth Info
|
||||||
|
auth.put("pw", "qwer5795QWER"); // FIXME: Auth Info
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return auth;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Crawler getCrawler(MetaCrawler metaCrawler) {
|
||||||
|
|
||||||
|
Crawler crawler = new Crawler();
|
||||||
|
crawler.setName(metaCrawler.getName());
|
||||||
|
|
||||||
|
String container = "";
|
||||||
|
|
||||||
|
switch (metaCrawler.getId()) {
|
||||||
|
case 1:
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
case 9:
|
||||||
|
case 10:
|
||||||
|
case 11:
|
||||||
|
case 13:
|
||||||
|
case 15:
|
||||||
|
container = "java_proxy";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
container = "java_proxy";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
crawler.setContainer(container);
|
||||||
|
|
||||||
|
return crawler;
|
||||||
|
}
|
||||||
|
|
||||||
|
public 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<String, Object> auth = new HashMap<>();
|
||||||
|
auth.put("id", "administrator");
|
||||||
|
auth.put("pw", "dbseogns18");
|
||||||
|
|
||||||
|
target.setAuth(auth);
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Map<String, List<MetaSensorItemKey>> sortItems(List<SensorItem> sensorItems, Map<Integer, MetaSensorItemKey> keyMap) {
|
||||||
|
|
||||||
|
Map<String, List<MetaSensorItemKey>> metricMap = new HashMap<>();
|
||||||
|
|
||||||
|
MetaSensorItemKey itemKey = null;
|
||||||
|
|
||||||
|
for(SensorItem sItem : sensorItems) {
|
||||||
|
itemKey = keyMap.get(sItem.getItem().getId());
|
||||||
|
if(metricMap.containsKey(itemKey.getFroms()) == false) {
|
||||||
|
metricMap.put(itemKey.getFroms(), new ArrayList<>());
|
||||||
|
}
|
||||||
|
metricMap.get(itemKey.getFroms()).add(itemKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
return metricMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Keys createKeys(MetaSensorItemKey itemKey) {
|
||||||
|
Keys keys = new Keys();
|
||||||
|
keys.setKey(itemKey.getKey());
|
||||||
|
keys.setMetric(itemKey.getItem().getKey());
|
||||||
|
return keys;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,62 @@
|
||||||
|
package com.loafle.overflow.module.generator.service;
|
||||||
|
|
||||||
|
import com.loafle.overflow.crawler.config.Config;
|
||||||
|
import com.loafle.overflow.crawler.config.Crawler;
|
||||||
|
import com.loafle.overflow.crawler.config.Schedule;
|
||||||
|
import com.loafle.overflow.module.infra.model.Infra;
|
||||||
|
import com.loafle.overflow.module.infra.model.InfraHost;
|
||||||
|
import com.loafle.overflow.module.meta.model.MetaSensorItemKey;
|
||||||
|
import com.loafle.overflow.module.sensor.model.Sensor;
|
||||||
|
import com.loafle.overflow.module.sensor.model.SensorItem;
|
||||||
|
import org.codehaus.jackson.map.ObjectMapper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by snoop on 17. 9. 6.
|
||||||
|
*/
|
||||||
|
@Service("InfraHostGenerator")
|
||||||
|
public class InfraHostGenerator {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private GenerateUtil generateUtil;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private InfraHostWMIGenerator infraHostWMIGenerator;
|
||||||
|
|
||||||
|
public String process(Sensor dbSensor, List<SensorItem> 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.generateUtil.createTarget(infraHost, dbSensor);
|
||||||
|
|
||||||
|
config.setTarget(target);
|
||||||
|
|
||||||
|
// FIXME: Interval
|
||||||
|
Schedule schedule = new Schedule();
|
||||||
|
schedule.setInterval("5");
|
||||||
|
config.setSchedule(schedule);
|
||||||
|
|
||||||
|
Crawler crawler = this.generateUtil.getCrawler(dbSensor.getCrawler());
|
||||||
|
config.setCrawler(crawler);
|
||||||
|
|
||||||
|
Map<Integer, MetaSensorItemKey> keyMap = this.generateUtil.initMappingMap(dbSensor.getCrawler());
|
||||||
|
|
||||||
|
switch (dbSensor.getCrawler().getId()) {
|
||||||
|
case 23:
|
||||||
|
this.infraHostWMIGenerator.process(sensorItems, keyMap, dbSensor, config);
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
return objectMapper.writeValueAsString(config);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,136 @@
|
||||||
|
package com.loafle.overflow.module.generator.service;
|
||||||
|
|
||||||
|
import com.loafle.overflow.crawler.config.*;
|
||||||
|
import com.loafle.overflow.module.meta.model.MetaSensorItemKey;
|
||||||
|
import com.loafle.overflow.module.sensor.model.Sensor;
|
||||||
|
import com.loafle.overflow.module.sensor.model.SensorItem;
|
||||||
|
import org.codehaus.jackson.map.ObjectMapper;
|
||||||
|
import org.codehaus.jackson.type.TypeReference;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by snoop on 17. 9. 6.
|
||||||
|
*/
|
||||||
|
@Service("InfraHostWMIGenerator")
|
||||||
|
public class InfraHostWMIGenerator {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private GenerateUtil generateUtil;
|
||||||
|
|
||||||
|
public void process(List<SensorItem> sensorItems, Map<Integer, MetaSensorItemKey> keyMap, Sensor dbSensor, Config config) throws IOException {
|
||||||
|
|
||||||
|
Map<String, List<MetaSensorItemKey>> metricMap = null;
|
||||||
|
metricMap = this.generateUtil.sortItems(sensorItems, keyMap);
|
||||||
|
|
||||||
|
// MetaSensorItemKey itemKey = null;
|
||||||
|
//
|
||||||
|
// for(SensorItem sItem : sensorItems) {
|
||||||
|
// itemKey = keyMap.get(sItem.getItem().getId());
|
||||||
|
// if(metricMap.containsKey(itemKey.getFroms()) == false) {
|
||||||
|
// metricMap.put(itemKey.getFroms(), new ArrayList<>());
|
||||||
|
// }
|
||||||
|
// metricMap.get(itemKey.getFroms()).add(itemKey);
|
||||||
|
// }
|
||||||
|
|
||||||
|
List<Item> itemList = new ArrayList<>();
|
||||||
|
Item item = null;
|
||||||
|
QueryInfo queryInfo = null;
|
||||||
|
MappingInfo mappingInfo = null;
|
||||||
|
|
||||||
|
StringBuffer stringBuffer = new StringBuffer();
|
||||||
|
|
||||||
|
Map<String, Object> extendMap = new HashMap<>();
|
||||||
|
extendMap.put("nameSpace", "root/cimv2");
|
||||||
|
extendMap.put("wmicPath", "/home/snoop/temp/wmic");
|
||||||
|
|
||||||
|
|
||||||
|
List<Keys> keysList = null;
|
||||||
|
MetaSensorItemKey tempItemKey = null;
|
||||||
|
Keys keys = null;
|
||||||
|
for(Map.Entry<String, List<MetaSensorItemKey>> elems : metricMap.entrySet()) {
|
||||||
|
keysList = new ArrayList<>();
|
||||||
|
item = new Item();
|
||||||
|
stringBuffer.setLength(0);
|
||||||
|
|
||||||
|
stringBuffer.append("SELECT ");
|
||||||
|
|
||||||
|
for(int indexI = 0; indexI < elems.getValue().size(); ++indexI) {
|
||||||
|
|
||||||
|
tempItemKey = elems.getValue().get(indexI);
|
||||||
|
stringBuffer.append(tempItemKey.getKey());
|
||||||
|
if(indexI + 1 < elems.getValue().size()) {
|
||||||
|
stringBuffer.append(", ");
|
||||||
|
}
|
||||||
|
|
||||||
|
// keys = new Keys();
|
||||||
|
// keys.setKey(tempItemKey.getKey());
|
||||||
|
// keys.setMetric(tempItemKey.getItem().getKey());
|
||||||
|
keysList.add(this.generateUtil.createKeys(tempItemKey));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
List<String> arrayColumns = null;
|
||||||
|
|
||||||
|
String json = tempItemKey.getOption();
|
||||||
|
if(json != null && json.length() > 0) {
|
||||||
|
HashMap<String,Object> optionMap;
|
||||||
|
optionMap = new ObjectMapper().readValue(json, new TypeReference<HashMap<String,Object>>() {});
|
||||||
|
|
||||||
|
Object obj = null;
|
||||||
|
obj = optionMap.get("appends");
|
||||||
|
if(obj != null) {
|
||||||
|
List<String> appendsList = (List<String>)obj;
|
||||||
|
for(String append : appendsList) {
|
||||||
|
stringBuffer.append(", ");
|
||||||
|
stringBuffer.append(append);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stringBuffer.append(" FROM ");
|
||||||
|
stringBuffer.append(elems.getKey());
|
||||||
|
|
||||||
|
obj = optionMap.get("where");
|
||||||
|
if(obj != null) {
|
||||||
|
String where = (String)obj;
|
||||||
|
stringBuffer.append(" WHERE ");
|
||||||
|
stringBuffer.append(where);
|
||||||
|
}
|
||||||
|
|
||||||
|
obj = optionMap.get("arrayColumns");
|
||||||
|
if(obj != null) {
|
||||||
|
arrayColumns = (List<String>)obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
stringBuffer.append(" FROM ");
|
||||||
|
stringBuffer.append(elems.getKey());
|
||||||
|
}
|
||||||
|
|
||||||
|
queryInfo = new QueryInfo();
|
||||||
|
queryInfo.setQuery(stringBuffer.toString());
|
||||||
|
queryInfo.setExtend(extendMap);
|
||||||
|
|
||||||
|
mappingInfo = new MappingInfo();
|
||||||
|
mappingInfo.setParseDirection("col");
|
||||||
|
mappingInfo.setArrayColumns(arrayColumns);
|
||||||
|
|
||||||
|
item.setMappingInfo(mappingInfo);
|
||||||
|
item.setQueryInfo(queryInfo);
|
||||||
|
item.setKeys(keysList);
|
||||||
|
|
||||||
|
itemList.add(item);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
config.setItems(itemList);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,75 @@
|
||||||
|
package com.loafle.overflow.module.generator.service;
|
||||||
|
|
||||||
|
import com.loafle.overflow.commons.utils.StringConvertor;
|
||||||
|
import com.loafle.overflow.crawler.config.Config;
|
||||||
|
import com.loafle.overflow.crawler.config.Connection;
|
||||||
|
import com.loafle.overflow.crawler.config.Crawler;
|
||||||
|
import com.loafle.overflow.crawler.config.Schedule;
|
||||||
|
import com.loafle.overflow.module.infra.model.Infra;
|
||||||
|
import com.loafle.overflow.module.meta.model.MetaSensorItemKey;
|
||||||
|
import com.loafle.overflow.module.sensor.model.Sensor;
|
||||||
|
import com.loafle.overflow.module.sensor.model.SensorItem;
|
||||||
|
import org.codehaus.jackson.map.ObjectMapper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by snoop on 17. 9. 6.
|
||||||
|
*/
|
||||||
|
@Service("InfraServiceGenerator")
|
||||||
|
public class InfraServiceGenerator {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private GenerateUtil generateUtil;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private InfraServiceMysqlGenerator infraServiceMysqlGenerator;
|
||||||
|
|
||||||
|
public String process(Sensor dbSensor, List<SensorItem> sensorItems, Infra infra) throws IOException {
|
||||||
|
com.loafle.overflow.module.infra.model.InfraService infraService = (com.loafle.overflow.module.infra.model.InfraService)infra;
|
||||||
|
|
||||||
|
Config config = new Config();
|
||||||
|
config.setId(String.valueOf(dbSensor.getId()));
|
||||||
|
|
||||||
|
com.loafle.overflow.crawler.config.Target target = new com.loafle.overflow.crawler.config.Target();
|
||||||
|
Connection connection = new Connection();
|
||||||
|
connection.setIp(StringConvertor.intToIp(infraService.getHost().getIp()));
|
||||||
|
connection.setPort(String.valueOf(infraService.getPort()));
|
||||||
|
connection.setPortType(infraService.getPortType());
|
||||||
|
connection.setSsl(infraService.isTlsType());
|
||||||
|
|
||||||
|
target.setConnection(connection);
|
||||||
|
|
||||||
|
Map<String, Object> auth = this.generateUtil.getAuth(dbSensor.getCrawler(), infraService);
|
||||||
|
|
||||||
|
target.setAuth(auth);
|
||||||
|
|
||||||
|
config.setTarget(target);
|
||||||
|
|
||||||
|
// FIXME: Interval
|
||||||
|
Schedule schedule = new Schedule();
|
||||||
|
schedule.setInterval("5");
|
||||||
|
config.setSchedule(schedule);
|
||||||
|
|
||||||
|
Crawler crawler = this.generateUtil.getCrawler(dbSensor.getCrawler());
|
||||||
|
config.setCrawler(crawler);
|
||||||
|
|
||||||
|
Map<Integer, MetaSensorItemKey> keyMap = this.generateUtil.initMappingMap(dbSensor.getCrawler());
|
||||||
|
|
||||||
|
switch (dbSensor.getCrawler().getId()) {
|
||||||
|
case 11:
|
||||||
|
this.infraServiceMysqlGenerator.process(sensorItems, keyMap, dbSensor, config);
|
||||||
|
// case 23:
|
||||||
|
// processWMI(sensorItems, keyMap, dbSensor, config);
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
return objectMapper.writeValueAsString(config);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,153 @@
|
||||||
|
package com.loafle.overflow.module.generator.service;
|
||||||
|
|
||||||
|
import com.loafle.overflow.crawler.config.*;
|
||||||
|
import com.loafle.overflow.module.meta.model.MetaCrawler;
|
||||||
|
import com.loafle.overflow.module.meta.model.MetaSensorItemKey;
|
||||||
|
import com.loafle.overflow.module.sensor.model.Sensor;
|
||||||
|
import com.loafle.overflow.module.sensor.model.SensorItem;
|
||||||
|
import org.codehaus.jackson.map.ObjectMapper;
|
||||||
|
import org.codehaus.jackson.type.TypeReference;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by snoop on 17. 9. 6.
|
||||||
|
*/
|
||||||
|
@Service("InfraServiceMysqlGenerator")
|
||||||
|
public class InfraServiceMysqlGenerator {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private GenerateUtil generateUtil;
|
||||||
|
|
||||||
|
public void process(List<SensorItem> sensorItems, Map<Integer, MetaSensorItemKey> keyMap, Sensor dbSensor, Config config) throws IOException {
|
||||||
|
|
||||||
|
|
||||||
|
// List<Keys> keysList = new ArrayList<>();
|
||||||
|
// for(SensorItem sItem : sensorItems) {
|
||||||
|
// keys = new Keys();
|
||||||
|
// keys.setMetric(sItem.getItem().getKey());
|
||||||
|
// keys.setKey(KeyMap.get(sItem.getItem().getId()).getKey());
|
||||||
|
// keysList.add(keys);
|
||||||
|
// }
|
||||||
|
// item.setKeys(keysList);
|
||||||
|
Map<String, List<MetaSensorItemKey>> metricMap = null;
|
||||||
|
metricMap = this.generateUtil.sortItems(sensorItems, keyMap);
|
||||||
|
|
||||||
|
List<Item> itemList = new ArrayList<>();
|
||||||
|
|
||||||
|
QueryInfo queryInfo = null;
|
||||||
|
MappingInfo mappingInfo = null;
|
||||||
|
|
||||||
|
List<Keys> keysList = null;
|
||||||
|
MetaSensorItemKey tempItemKey = null;
|
||||||
|
Keys keys = null;
|
||||||
|
Item item = null;
|
||||||
|
StringBuffer stringBuffer = new StringBuffer();
|
||||||
|
for(Map.Entry<String, List<MetaSensorItemKey>> elems : metricMap.entrySet()) {
|
||||||
|
|
||||||
|
keysList = new ArrayList<>();
|
||||||
|
item = new Item();
|
||||||
|
stringBuffer.setLength(0);
|
||||||
|
|
||||||
|
stringBuffer.append(elems.getKey());
|
||||||
|
|
||||||
|
stringBuffer.append(" where ");
|
||||||
|
for(int indexI = 0; indexI < elems.getValue().size(); ++indexI) {
|
||||||
|
tempItemKey = elems.getValue().get(indexI);
|
||||||
|
|
||||||
|
stringBuffer.append("variable_name = '");
|
||||||
|
stringBuffer.append(tempItemKey.getKey());
|
||||||
|
stringBuffer.append("'");
|
||||||
|
|
||||||
|
if(indexI + 1 < elems.getValue().size()) {
|
||||||
|
stringBuffer.append(" or ");
|
||||||
|
}
|
||||||
|
keysList.add(this.generateUtil.createKeys(tempItemKey));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
List<String> keyColumns = null;
|
||||||
|
String valueColumn = null;
|
||||||
|
|
||||||
|
String json = tempItemKey.getOption();
|
||||||
|
if(json != null && json.length() > 0) {
|
||||||
|
HashMap<String,Object> optionMap;
|
||||||
|
optionMap = new ObjectMapper().readValue(json, new TypeReference<HashMap<String,Object>>() {});
|
||||||
|
|
||||||
|
Object obj = null;
|
||||||
|
obj = optionMap.get("valueColumn");
|
||||||
|
if(obj != null) {
|
||||||
|
valueColumn = (String)obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
obj = optionMap.get("keyColumns");
|
||||||
|
if(obj != null) {
|
||||||
|
keyColumns = (List<String>)obj;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
queryInfo = new QueryInfo();
|
||||||
|
queryInfo.setQuery(stringBuffer.toString());
|
||||||
|
|
||||||
|
mappingInfo = new MappingInfo();
|
||||||
|
mappingInfo.setParseDirection("row");
|
||||||
|
mappingInfo.setValueColumn(valueColumn);
|
||||||
|
mappingInfo.setKeyColumns(keyColumns);
|
||||||
|
|
||||||
|
item.setMappingInfo(mappingInfo);
|
||||||
|
item.setQueryInfo(queryInfo);
|
||||||
|
item.setKeys(keysList);
|
||||||
|
|
||||||
|
itemList.add(item);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
config.setItems(itemList);
|
||||||
|
|
||||||
|
|
||||||
|
// ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
//
|
||||||
|
// return objectMapper.writeValueAsString(config);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQueryAndMapping(MetaCrawler metaCrawler, List<Keys> keysList, QueryInfo queryInfo, MappingInfo mappingInfo) {
|
||||||
|
|
||||||
|
switch (metaCrawler.getId()) {
|
||||||
|
case 11: // mysql
|
||||||
|
{
|
||||||
|
String query = "show status where ";
|
||||||
|
// queryInfo.setQuery("show status where ");
|
||||||
|
|
||||||
|
Keys keys = null;
|
||||||
|
for(int indexI = 0 ; indexI < keysList.size(); ++indexI) {
|
||||||
|
keys = keysList.get(indexI);
|
||||||
|
query += "variable_name = '";
|
||||||
|
query += keys.getKey();
|
||||||
|
query += "'";
|
||||||
|
if(indexI + 1 < keysList.size()) {
|
||||||
|
query += " or ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
queryInfo.setQuery(query);
|
||||||
|
|
||||||
|
mappingInfo.setParseDirection("row");
|
||||||
|
mappingInfo.setValueColumn("Value");
|
||||||
|
|
||||||
|
List<String> keyColumns = new ArrayList<>();
|
||||||
|
keyColumns.add("Variable_name");
|
||||||
|
|
||||||
|
mappingInfo.setKeyColumns(keyColumns);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,66 @@
|
||||||
|
package com.loafle.overflow.module.generator.service;
|
||||||
|
|
||||||
|
import com.loafle.overflow.commons.model.PageParams;
|
||||||
|
import com.loafle.overflow.module.infra.model.Infra;
|
||||||
|
import com.loafle.overflow.module.infra.service.InfraService;
|
||||||
|
import com.loafle.overflow.module.sensor.model.Sensor;
|
||||||
|
import com.loafle.overflow.module.sensor.model.SensorItem;
|
||||||
|
import com.loafle.overflow.module.sensor.service.SensorItemService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.domain.Page;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by snoop on 17. 9. 6.
|
||||||
|
*/
|
||||||
|
@Service("SensorConfigGenerator")
|
||||||
|
public class SensorConfigGenerator {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SensorItemService sensorItemService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private InfraService infraService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private InfraHostGenerator infraHostGenerator;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private InfraServiceGenerator infraServiceGenerator;
|
||||||
|
|
||||||
|
|
||||||
|
public String generate(Sensor sensor) throws IOException {
|
||||||
|
PageParams pageParams = new PageParams();
|
||||||
|
pageParams.setPageNo(0);
|
||||||
|
pageParams.setCountPerPage(Integer.MAX_VALUE);
|
||||||
|
pageParams.setSortCol("id");
|
||||||
|
pageParams.setSortDirection("descending");
|
||||||
|
Page<SensorItem> dbItemList = this.sensorItemService.readAllBySensor(sensor, pageParams);
|
||||||
|
|
||||||
|
List<SensorItem> sensorItems = dbItemList.getContent();
|
||||||
|
|
||||||
|
if(sensorItems.size() <= 0) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
Sensor dbSensor = sensorItems.get(0).getSensor();
|
||||||
|
|
||||||
|
Infra infra = this.infraService.readByTarget(dbSensor.getTarget());
|
||||||
|
|
||||||
|
// 7 = Infra OS Service
|
||||||
|
if(infra.getInfraType().getId() == 7) {
|
||||||
|
return this.infraServiceGenerator.process(dbSensor, sensorItems, infra);
|
||||||
|
}
|
||||||
|
if(infra.getInfraType().getId() == 2) {
|
||||||
|
return this.infraHostGenerator.process(dbSensor, sensorItems, infra);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -2,14 +2,10 @@ package com.loafle.overflow.module.sensor.service;
|
||||||
|
|
||||||
import com.loafle.overflow.commons.model.PageParams;
|
import com.loafle.overflow.commons.model.PageParams;
|
||||||
import com.loafle.overflow.commons.utils.PageUtil;
|
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.domain.model.Domain;
|
||||||
|
import com.loafle.overflow.module.generator.service.SensorConfigGenerator;
|
||||||
import com.loafle.overflow.module.infra.model.Infra;
|
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.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.model.MetaSensorStatus;
|
||||||
import com.loafle.overflow.module.meta.service.MetaSensorItemKeyService;
|
import com.loafle.overflow.module.meta.service.MetaSensorItemKeyService;
|
||||||
import com.loafle.overflow.module.probe.model.Probe;
|
import com.loafle.overflow.module.probe.model.Probe;
|
||||||
|
@ -18,18 +14,13 @@ import com.loafle.overflow.module.sensor.dao.SensorDAO;
|
||||||
import com.loafle.overflow.module.sensor.model.Sensor;
|
import com.loafle.overflow.module.sensor.model.Sensor;
|
||||||
import com.loafle.overflow.module.sensor.model.SensorItem;
|
import com.loafle.overflow.module.sensor.model.SensorItem;
|
||||||
import com.loafle.overflow.module.target.model.Target;
|
import com.loafle.overflow.module.target.model.Target;
|
||||||
import org.codehaus.jackson.map.ObjectMapper;
|
|
||||||
import org.codehaus.jackson.type.TypeReference;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.transaction.Transactional;
|
import javax.transaction.Transactional;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by insanity on 17. 6. 28.
|
* Created by insanity on 17. 6. 28.
|
||||||
|
@ -52,7 +43,10 @@ public class SensorService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private MetaSensorItemKeyService metaSensorItemKeyService;
|
private MetaSensorItemKeyService metaSensorItemKeyService;
|
||||||
|
|
||||||
private Map<Short, Map<Integer, MetaSensorItemKey>> mappingMap = null;
|
@Autowired
|
||||||
|
private SensorConfigGenerator sensorConfigGenerator;
|
||||||
|
|
||||||
|
// private Map<Short, Map<Integer, MetaSensorItemKey>> mappingMap = null;
|
||||||
|
|
||||||
public Sensor regist(Sensor sensor) {
|
public Sensor regist(Sensor sensor) {
|
||||||
return this.sensorDAO.save(sensor);
|
return this.sensorDAO.save(sensor);
|
||||||
|
@ -116,375 +110,377 @@ public class SensorService {
|
||||||
|
|
||||||
public String generateSensorConfig(Sensor sensor) throws IOException {
|
public String generateSensorConfig(Sensor sensor) throws IOException {
|
||||||
|
|
||||||
PageParams pageParams = new PageParams();
|
return this.sensorConfigGenerator.generate(sensor);
|
||||||
pageParams.setPageNo(0);
|
|
||||||
pageParams.setCountPerPage(Integer.MAX_VALUE);
|
|
||||||
pageParams.setSortCol("id");
|
|
||||||
pageParams.setSortDirection("descending");
|
|
||||||
Page<SensorItem> dbItemList = this.sensorItemService.readAllBySensor(sensor, pageParams);
|
|
||||||
|
|
||||||
List<SensorItem> sensorItems = dbItemList.getContent();
|
// PageParams pageParams = new PageParams();
|
||||||
|
// pageParams.setPageNo(0);
|
||||||
if(sensorItems.size() <= 0) {
|
// pageParams.setCountPerPage(Integer.MAX_VALUE);
|
||||||
return "";
|
// pageParams.setSortCol("id");
|
||||||
}
|
// pageParams.setSortDirection("descending");
|
||||||
Sensor dbSensor = sensorItems.get(0).getSensor();
|
// Page<SensorItem> dbItemList = this.sensorItemService.readAllBySensor(sensor, pageParams);
|
||||||
|
|
||||||
Infra infra = this.infraService.readByTarget(dbSensor.getTarget());
|
|
||||||
|
|
||||||
// 7 = Infra OS Service
|
|
||||||
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<SensorItem> 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<Integer, MetaSensorItemKey> 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<String, Object> auth = new HashMap<>();
|
|
||||||
auth.put("id", "administrator");
|
|
||||||
auth.put("pw", "dbseogns18");
|
|
||||||
|
|
||||||
target.setAuth(auth);
|
|
||||||
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return target;
|
|
||||||
}
|
|
||||||
|
|
||||||
private String processService(Sensor dbSensor, List<SensorItem> sensorItems, Infra infra) throws IOException {
|
|
||||||
com.loafle.overflow.module.infra.model.InfraService infraService = (com.loafle.overflow.module.infra.model.InfraService)infra;
|
|
||||||
|
|
||||||
Config config = new Config();
|
|
||||||
config.setId(String.valueOf(dbSensor.getId()));
|
|
||||||
|
|
||||||
com.loafle.overflow.crawler.config.Target target = new com.loafle.overflow.crawler.config.Target();
|
|
||||||
Connection connection = new Connection();
|
|
||||||
connection.setIp(StringConvertor.intToIp(infraService.getHost().getIp()));
|
|
||||||
connection.setPort(String.valueOf(infraService.getPort()));
|
|
||||||
connection.setPortType(infraService.getPortType());
|
|
||||||
connection.setSsl(infraService.isTlsType());
|
|
||||||
|
|
||||||
target.setConnection(connection);
|
|
||||||
|
|
||||||
Map<String, Object> auth = this.getAuth(dbSensor.getCrawler(), infraService);
|
|
||||||
|
|
||||||
target.setAuth(auth);
|
|
||||||
|
|
||||||
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<Integer, MetaSensorItemKey> 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<SensorItem> sensorItems, Map<Integer, MetaSensorItemKey> KeyMap, Sensor dbSensor, Config config) throws IOException {
|
|
||||||
Item item = new Item();
|
|
||||||
Keys keys = null;
|
|
||||||
List<Keys> keysList = new ArrayList<>();
|
|
||||||
for(SensorItem sItem : sensorItems) {
|
|
||||||
keys = new Keys();
|
|
||||||
keys.setMetric(sItem.getItem().getKey());
|
|
||||||
keys.setKey(KeyMap.get(sItem.getItem().getId()).getKey());
|
|
||||||
keysList.add(keys);
|
|
||||||
}
|
|
||||||
item.setKeys(keysList);
|
|
||||||
|
|
||||||
QueryInfo queryInfo = new QueryInfo();
|
|
||||||
MappingInfo mappingInfo = new MappingInfo();
|
|
||||||
|
|
||||||
this.setQueryAndMapping(dbSensor.getCrawler(), keysList, queryInfo, mappingInfo);
|
|
||||||
|
|
||||||
item.setQueryInfo(queryInfo);
|
|
||||||
item.setMappingInfo(mappingInfo);
|
|
||||||
|
|
||||||
List<Item> itemList = new ArrayList<>();
|
|
||||||
itemList.add(item);
|
|
||||||
|
|
||||||
config.setItems(itemList);
|
|
||||||
|
|
||||||
|
|
||||||
// ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
//
|
//
|
||||||
|
// List<SensorItem> sensorItems = dbItemList.getContent();
|
||||||
|
//
|
||||||
|
// if(sensorItems.size() <= 0) {
|
||||||
|
// return "";
|
||||||
|
// }
|
||||||
|
// Sensor dbSensor = sensorItems.get(0).getSensor();
|
||||||
|
//
|
||||||
|
// Infra infra = this.infraService.readByTarget(dbSensor.getTarget());
|
||||||
|
//
|
||||||
|
// // 7 = Infra OS Service
|
||||||
|
// 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<SensorItem> 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<Integer, MetaSensorItemKey> 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);
|
// return objectMapper.writeValueAsString(config);
|
||||||
}
|
// }
|
||||||
private void processWMI(List<SensorItem> sensorItems, Map<Integer, MetaSensorItemKey> keyMap, Sensor dbSensor, Config config) throws IOException {
|
|
||||||
|
|
||||||
Map<String, List<MetaSensorItemKey>> metricMap = new HashMap<>();
|
// 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<String, Object> auth = new HashMap<>();
|
||||||
|
// auth.put("id", "administrator");
|
||||||
|
// auth.put("pw", "dbseogns18");
|
||||||
|
//
|
||||||
|
// target.setAuth(auth);
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// return target;
|
||||||
|
// }
|
||||||
|
|
||||||
MetaSensorItemKey itemKey = null;
|
// private String processService(Sensor dbSensor, List<SensorItem> sensorItems, Infra infra) throws IOException {
|
||||||
|
// com.loafle.overflow.module.infra.model.InfraService infraService = (com.loafle.overflow.module.infra.model.InfraService)infra;
|
||||||
|
//
|
||||||
|
// Config config = new Config();
|
||||||
|
// config.setId(String.valueOf(dbSensor.getId()));
|
||||||
|
//
|
||||||
|
// com.loafle.overflow.crawler.config.Target target = new com.loafle.overflow.crawler.config.Target();
|
||||||
|
// Connection connection = new Connection();
|
||||||
|
// connection.setIp(StringConvertor.intToIp(infraService.getHost().getIp()));
|
||||||
|
// connection.setPort(String.valueOf(infraService.getPort()));
|
||||||
|
// connection.setPortType(infraService.getPortType());
|
||||||
|
// connection.setSsl(infraService.isTlsType());
|
||||||
|
//
|
||||||
|
// target.setConnection(connection);
|
||||||
|
//
|
||||||
|
// Map<String, Object> auth = this.getAuth(dbSensor.getCrawler(), infraService);
|
||||||
|
//
|
||||||
|
// target.setAuth(auth);
|
||||||
|
//
|
||||||
|
// 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<Integer, MetaSensorItemKey> 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);
|
||||||
|
// }
|
||||||
|
|
||||||
for(SensorItem sItem : sensorItems) {
|
// private void processMysql(List<SensorItem> sensorItems, Map<Integer, MetaSensorItemKey> KeyMap, Sensor dbSensor, Config config) throws IOException {
|
||||||
itemKey = keyMap.get(sItem.getItem().getId());
|
// Item item = new Item();
|
||||||
if(metricMap.containsKey(itemKey.getFroms()) == false) {
|
// Keys keys = null;
|
||||||
metricMap.put(itemKey.getFroms(), new ArrayList<>());
|
// List<Keys> keysList = new ArrayList<>();
|
||||||
}
|
// for(SensorItem sItem : sensorItems) {
|
||||||
metricMap.get(itemKey.getFroms()).add(itemKey);
|
// keys = new Keys();
|
||||||
}
|
// keys.setMetric(sItem.getItem().getKey());
|
||||||
|
// keys.setKey(KeyMap.get(sItem.getItem().getId()).getKey());
|
||||||
|
// keysList.add(keys);
|
||||||
|
// }
|
||||||
|
// item.setKeys(keysList);
|
||||||
|
//
|
||||||
|
// QueryInfo queryInfo = new QueryInfo();
|
||||||
|
// MappingInfo mappingInfo = new MappingInfo();
|
||||||
|
//
|
||||||
|
// this.setQueryAndMapping(dbSensor.getCrawler(), keysList, queryInfo, mappingInfo);
|
||||||
|
//
|
||||||
|
// item.setQueryInfo(queryInfo);
|
||||||
|
// item.setMappingInfo(mappingInfo);
|
||||||
|
//
|
||||||
|
// List<Item> itemList = new ArrayList<>();
|
||||||
|
// itemList.add(item);
|
||||||
|
//
|
||||||
|
// config.setItems(itemList);
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//// ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
////
|
||||||
|
//// return objectMapper.writeValueAsString(config);
|
||||||
|
// }
|
||||||
|
// private void processWMI(List<SensorItem> sensorItems, Map<Integer, MetaSensorItemKey> keyMap, Sensor dbSensor, Config config) throws IOException {
|
||||||
|
//
|
||||||
|
// Map<String, List<MetaSensorItemKey>> metricMap = new HashMap<>();
|
||||||
|
//
|
||||||
|
// MetaSensorItemKey itemKey = null;
|
||||||
|
//
|
||||||
|
// for(SensorItem sItem : sensorItems) {
|
||||||
|
// itemKey = keyMap.get(sItem.getItem().getId());
|
||||||
|
// if(metricMap.containsKey(itemKey.getFroms()) == false) {
|
||||||
|
// metricMap.put(itemKey.getFroms(), new ArrayList<>());
|
||||||
|
// }
|
||||||
|
// metricMap.get(itemKey.getFroms()).add(itemKey);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// List<Item> itemList = new ArrayList<>();
|
||||||
|
// Item item = null;
|
||||||
|
// QueryInfo queryInfo = null;
|
||||||
|
// MappingInfo mappingInfo = null;
|
||||||
|
//
|
||||||
|
// StringBuffer stringBuffer = new StringBuffer();
|
||||||
|
//
|
||||||
|
// Map<String, Object> extendMap = new HashMap<>();
|
||||||
|
// extendMap.put("nameSpace", "root/cimv2");
|
||||||
|
// extendMap.put("wmicPath", "/home/snoop/temp/wmic");
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// List<Keys> keysList = null;
|
||||||
|
// MetaSensorItemKey tempItemKey = null;
|
||||||
|
// Keys keys = null;
|
||||||
|
// for(Map.Entry<String, List<MetaSensorItemKey>> elems : metricMap.entrySet()) {
|
||||||
|
// keysList = new ArrayList<>();
|
||||||
|
// item = new Item();
|
||||||
|
// stringBuffer.setLength(0);
|
||||||
|
//
|
||||||
|
// stringBuffer.append("SELECT ");
|
||||||
|
//
|
||||||
|
// for(int indexI = 0; indexI < elems.getValue().size(); ++indexI) {
|
||||||
|
//
|
||||||
|
// tempItemKey = elems.getValue().get(indexI);
|
||||||
|
// stringBuffer.append(tempItemKey.getKey());
|
||||||
|
// if(indexI + 1 < elems.getValue().size()) {
|
||||||
|
// stringBuffer.append(", ");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// keys = new Keys();
|
||||||
|
// keys.setKey(tempItemKey.getKey());
|
||||||
|
// keys.setMetric(tempItemKey.getItem().getKey());
|
||||||
|
// keysList.add(keys);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// List<String> arrayColumns = null;
|
||||||
|
//
|
||||||
|
// String json = tempItemKey.getOption();
|
||||||
|
// if(json != null && json.length() > 0) {
|
||||||
|
// HashMap<String,Object> optionMap;
|
||||||
|
// optionMap = new ObjectMapper().readValue(json, new TypeReference<HashMap<String,Object>>() {});
|
||||||
|
//
|
||||||
|
// Object obj = null;
|
||||||
|
// obj = optionMap.get("appends");
|
||||||
|
// if(obj != null) {
|
||||||
|
// List<String> appendsList = (List<String>)obj;
|
||||||
|
// for(String append : appendsList) {
|
||||||
|
// stringBuffer.append(", ");
|
||||||
|
// stringBuffer.append(append);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// stringBuffer.append(" FROM ");
|
||||||
|
// stringBuffer.append(elems.getKey());
|
||||||
|
//
|
||||||
|
// obj = optionMap.get("where");
|
||||||
|
// if(obj != null) {
|
||||||
|
// String where = (String)obj;
|
||||||
|
// stringBuffer.append(" WHERE ");
|
||||||
|
// stringBuffer.append(where);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// obj = optionMap.get("arrayColumns");
|
||||||
|
// if(obj != null) {
|
||||||
|
// arrayColumns = (List<String>)obj;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// else {
|
||||||
|
// stringBuffer.append(" FROM ");
|
||||||
|
// stringBuffer.append(elems.getKey());
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// queryInfo = new QueryInfo();
|
||||||
|
// queryInfo.setQuery(stringBuffer.toString());
|
||||||
|
// queryInfo.setExtend(extendMap);
|
||||||
|
//
|
||||||
|
// mappingInfo = new MappingInfo();
|
||||||
|
// mappingInfo.setParseDirection("col");
|
||||||
|
// mappingInfo.setArrayColumns(arrayColumns);
|
||||||
|
//
|
||||||
|
// item.setMappingInfo(mappingInfo);
|
||||||
|
// item.setQueryInfo(queryInfo);
|
||||||
|
// item.setKeys(keysList);
|
||||||
|
//
|
||||||
|
// itemList.add(item);
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// config.setItems(itemList);
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
List<Item> itemList = new ArrayList<>();
|
// private void setQueryAndMapping(MetaCrawler metaCrawler, List<Keys> keysList, QueryInfo queryInfo, MappingInfo mappingInfo) {
|
||||||
Item item = null;
|
//
|
||||||
QueryInfo queryInfo = null;
|
// switch (metaCrawler.getId()) {
|
||||||
MappingInfo mappingInfo = null;
|
// case 11: // mysql
|
||||||
|
// {
|
||||||
|
// String query = "show status where ";
|
||||||
|
//// queryInfo.setQuery("show status where ");
|
||||||
|
//
|
||||||
|
// Keys keys = null;
|
||||||
|
// for(int indexI = 0 ; indexI < keysList.size(); ++indexI) {
|
||||||
|
// keys = keysList.get(indexI);
|
||||||
|
// query += "variable_name = '";
|
||||||
|
// query += keys.getKey();
|
||||||
|
// query += "'";
|
||||||
|
// if(indexI + 1 < keysList.size()) {
|
||||||
|
// query += " or ";
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// queryInfo.setQuery(query);
|
||||||
|
//
|
||||||
|
// mappingInfo.setParseDirection("row");
|
||||||
|
// mappingInfo.setValueColumn("Value");
|
||||||
|
//
|
||||||
|
// List<String> keyColumns = new ArrayList<>();
|
||||||
|
// keyColumns.add("Variable_name");
|
||||||
|
//
|
||||||
|
// mappingInfo.setKeyColumns(keyColumns);
|
||||||
|
// }
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
StringBuffer stringBuffer = new StringBuffer();
|
// private Map<Integer, MetaSensorItemKey> initMappingMap(MetaCrawler metaCrawler) {
|
||||||
|
//
|
||||||
Map<String, Object> extendMap = new HashMap<>();
|
// if(this.mappingMap == null) {
|
||||||
extendMap.put("nameSpace", "root/cimv2");
|
// this.mappingMap = new HashMap<>();
|
||||||
extendMap.put("wmicPath", "/home/snoop/temp/wmic");
|
// }
|
||||||
|
//
|
||||||
|
// Map<Integer, MetaSensorItemKey> resultMap = this.mappingMap.get(metaCrawler.getId());
|
||||||
List<Keys> keysList = null;
|
//
|
||||||
MetaSensorItemKey tempItemKey = null;
|
// if(resultMap != null) {
|
||||||
Keys keys = null;
|
// return resultMap;
|
||||||
for(Map.Entry<String, List<MetaSensorItemKey>> elems : metricMap.entrySet()) {
|
// }
|
||||||
keysList = new ArrayList<>();
|
//
|
||||||
item = new Item();
|
// resultMap = this.metaSensorItemKeyService.readAllByCrawler(metaCrawler);
|
||||||
stringBuffer.setLength(0);
|
// this.mappingMap.put(metaCrawler.getId(), resultMap);
|
||||||
|
//
|
||||||
stringBuffer.append("SELECT ");
|
// return resultMap;
|
||||||
|
// }
|
||||||
for(int indexI = 0; indexI < elems.getValue().size(); ++indexI) {
|
//
|
||||||
|
// private Map<String, Object> getAuth(MetaCrawler metaCrawler, com.loafle.overflow.module.infra.model.InfraService infraService) {
|
||||||
tempItemKey = elems.getValue().get(indexI);
|
//
|
||||||
stringBuffer.append(tempItemKey.getKey());
|
// Map<String, Object> auth = new HashMap<>();
|
||||||
if(indexI + 1 < elems.getValue().size()) {
|
//
|
||||||
stringBuffer.append(", ");
|
// switch (metaCrawler.getId()) {
|
||||||
}
|
// case 11: // mysql
|
||||||
|
// {
|
||||||
keys = new Keys();
|
// auth.put("url", "jdbc:mysql://"+StringConvertor.intToIp(infraService.getHost().getIp())+":"+String.valueOf(infraService.getPort()));
|
||||||
keys.setKey(tempItemKey.getKey());
|
// auth.put("id", "docker"); // FIXME: Auth Info
|
||||||
keys.setMetric(tempItemKey.getItem().getKey());
|
// auth.put("pw", "qwer5795QWER"); // FIXME: Auth Info
|
||||||
keysList.add(keys);
|
// }
|
||||||
}
|
// break;
|
||||||
|
// }
|
||||||
|
//
|
||||||
List<String> arrayColumns = null;
|
// return auth;
|
||||||
|
// }
|
||||||
String json = tempItemKey.getOption();
|
//
|
||||||
if(json != null && json.length() > 0) {
|
// private Crawler getCrawler(MetaCrawler metaCrawler) {
|
||||||
HashMap<String,Object> optionMap;
|
//
|
||||||
optionMap = new ObjectMapper().readValue(json, new TypeReference<HashMap<String,Object>>() {});
|
// Crawler crawler = new Crawler();
|
||||||
|
// crawler.setName(metaCrawler.getName());
|
||||||
Object obj = null;
|
//
|
||||||
obj = optionMap.get("appends");
|
// String container = "";
|
||||||
if(obj != null) {
|
//
|
||||||
List<String> appendsList = (List<String>)obj;
|
// switch (metaCrawler.getId()) {
|
||||||
for(String append : appendsList) {
|
// case 1:
|
||||||
stringBuffer.append(", ");
|
// break;
|
||||||
stringBuffer.append(append);
|
// case 2:
|
||||||
}
|
// case 9:
|
||||||
}
|
// case 10:
|
||||||
|
// case 11:
|
||||||
stringBuffer.append(" FROM ");
|
// case 13:
|
||||||
stringBuffer.append(elems.getKey());
|
// case 15:
|
||||||
|
// container = "java_proxy";
|
||||||
obj = optionMap.get("where");
|
// break;
|
||||||
if(obj != null) {
|
// default:
|
||||||
String where = (String)obj;
|
// container = "java_proxy";
|
||||||
stringBuffer.append(" WHERE ");
|
// break;
|
||||||
stringBuffer.append(where);
|
// }
|
||||||
}
|
//
|
||||||
|
//
|
||||||
obj = optionMap.get("arrayColumns");
|
// crawler.setContainer(container);
|
||||||
if(obj != null) {
|
//
|
||||||
arrayColumns = (List<String>)obj;
|
// return crawler;
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
stringBuffer.append(" FROM ");
|
|
||||||
stringBuffer.append(elems.getKey());
|
|
||||||
}
|
|
||||||
|
|
||||||
queryInfo = new QueryInfo();
|
|
||||||
queryInfo.setQuery(stringBuffer.toString());
|
|
||||||
queryInfo.setExtend(extendMap);
|
|
||||||
|
|
||||||
mappingInfo = new MappingInfo();
|
|
||||||
mappingInfo.setParseDirection("col");
|
|
||||||
mappingInfo.setArrayColumns(arrayColumns);
|
|
||||||
|
|
||||||
item.setMappingInfo(mappingInfo);
|
|
||||||
item.setQueryInfo(queryInfo);
|
|
||||||
item.setKeys(keysList);
|
|
||||||
|
|
||||||
itemList.add(item);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
config.setItems(itemList);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setQueryAndMapping(MetaCrawler metaCrawler, List<Keys> keysList, QueryInfo queryInfo, MappingInfo mappingInfo) {
|
|
||||||
|
|
||||||
switch (metaCrawler.getId()) {
|
|
||||||
case 11: // mysql
|
|
||||||
{
|
|
||||||
String query = "show status where ";
|
|
||||||
// queryInfo.setQuery("show status where ");
|
|
||||||
|
|
||||||
Keys keys = null;
|
|
||||||
for(int indexI = 0 ; indexI < keysList.size(); ++indexI) {
|
|
||||||
keys = keysList.get(indexI);
|
|
||||||
query += "variable_name = '";
|
|
||||||
query += keys.getKey();
|
|
||||||
query += "'";
|
|
||||||
if(indexI + 1 < keysList.size()) {
|
|
||||||
query += " or ";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
queryInfo.setQuery(query);
|
|
||||||
|
|
||||||
mappingInfo.setParseDirection("row");
|
|
||||||
mappingInfo.setValueColumn("Value");
|
|
||||||
|
|
||||||
List<String> keyColumns = new ArrayList<>();
|
|
||||||
keyColumns.add("Variable_name");
|
|
||||||
|
|
||||||
mappingInfo.setKeyColumns(keyColumns);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private Map<Integer, MetaSensorItemKey> initMappingMap(MetaCrawler metaCrawler) {
|
|
||||||
|
|
||||||
if(this.mappingMap == null) {
|
|
||||||
this.mappingMap = new HashMap<>();
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<Integer, MetaSensorItemKey> resultMap = this.mappingMap.get(metaCrawler.getId());
|
|
||||||
|
|
||||||
if(resultMap != null) {
|
|
||||||
return resultMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
resultMap = this.metaSensorItemKeyService.readAllByCrawler(metaCrawler);
|
|
||||||
this.mappingMap.put(metaCrawler.getId(), resultMap);
|
|
||||||
|
|
||||||
return resultMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Map<String, Object> getAuth(MetaCrawler metaCrawler, com.loafle.overflow.module.infra.model.InfraService infraService) {
|
|
||||||
|
|
||||||
Map<String, Object> auth = new HashMap<>();
|
|
||||||
|
|
||||||
switch (metaCrawler.getId()) {
|
|
||||||
case 11: // mysql
|
|
||||||
{
|
|
||||||
auth.put("url", "jdbc:mysql://"+StringConvertor.intToIp(infraService.getHost().getIp())+":"+String.valueOf(infraService.getPort()));
|
|
||||||
auth.put("id", "docker"); // FIXME: Auth Info
|
|
||||||
auth.put("pw", "qwer5795QWER"); // FIXME: Auth Info
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return auth;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Crawler getCrawler(MetaCrawler metaCrawler) {
|
|
||||||
|
|
||||||
Crawler crawler = new Crawler();
|
|
||||||
crawler.setName(metaCrawler.getName());
|
|
||||||
|
|
||||||
String container = "";
|
|
||||||
|
|
||||||
switch (metaCrawler.getId()) {
|
|
||||||
case 1:
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
case 9:
|
|
||||||
case 10:
|
|
||||||
case 11:
|
|
||||||
case 13:
|
|
||||||
case 15:
|
|
||||||
container = "java_proxy";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
container = "java_proxy";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
crawler.setContainer(container);
|
|
||||||
|
|
||||||
return crawler;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -525,209 +525,209 @@ INSERT INTO meta_sensor_item (create_date,"key",name,type_id) VALUES (
|
||||||
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','disk.usage.free[$0]','FreeSpace','3');
|
'2017-06-26 20:10','disk.usage.free[$0]','FreeSpace','3');
|
||||||
|
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_buffer_pool_dump_status','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','5');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_buffer_pool_load_status','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','6');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_buffer_pool_resize_status','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','7');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_buffer_pool_pages_data','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','8');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_buffer_pool_bytes_data','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','9');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_buffer_pool_pages_dirty','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','10');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_buffer_pool_bytes_dirty','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','11');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_buffer_pool_pages_flushed','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','12');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_buffer_pool_pages_free','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','13');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_buffer_pool_pages_misc','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','14');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_buffer_pool_pages_total','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','15');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_buffer_pool_read_ahead_rnd','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','16');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_buffer_pool_read_ahead','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','17');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_buffer_pool_read_ahead_evicted','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','18');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_buffer_pool_read_requests','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','19');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_buffer_pool_reads','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','20');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_buffer_pool_wait_free','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','21');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_buffer_pool_write_requests','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','22');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_data_fsyncs','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','23');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_data_pending_fsyncs','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','24');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_data_pending_reads','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','25');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_data_pending_writes','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','26');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_data_read','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','27');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_data_reads','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','28');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_data_writes','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','29');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_data_written','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','30');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_dblwr_pages_written','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','31');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_dblwr_writes','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','32');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_log_waits','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','33');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_log_write_requests','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','34');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_log_writes','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','35');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_os_log_fsyncs','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','36');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_os_log_pending_fsyncs','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','37');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_os_log_pending_writes','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','38');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_os_log_written','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','39');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_page_size','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','40');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_pages_created','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','41');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_pages_read','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','42');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_pages_written','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','43');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_row_lock_current_waits','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','44');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_row_lock_time','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','45');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_row_lock_time_avg','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','46');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_row_lock_time_max','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','47');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_row_lock_waits','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','48');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_rows_deleted','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','49');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_rows_inserted','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','50');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_rows_read','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','51');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_rows_updated','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','52');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_num_open_files','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','53');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_truncated_status_writes','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','54');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Innodb_available_undo_logs','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','55');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Connection_errors_accept','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','56');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Connection_errors_internal','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','57');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Connection_errors_max_connections','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','58');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Connection_errors_peer_address','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','59');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Connection_errors_select','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','60');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Connection_errors_tcpwrap','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','61');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Connections','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','62');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Max_used_connections','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','63');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Max_used_connections_time','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','64');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Performance_schema_accounts_lost','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','65');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Performance_schema_cond_classes_lost','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','66');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Performance_schema_cond_instances_lost','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','67');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Performance_schema_digest_lost','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','68');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Performance_schema_file_classes_lost','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','69');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Performance_schema_file_handles_lost','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','70');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Performance_schema_file_instances_lost','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','71');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Performance_schema_hosts_lost','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','72');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Performance_schema_index_stat_lost','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','73');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Performance_schema_locker_lost','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','74');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Performance_schema_memory_classes_lost','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','75');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Performance_schema_metadata_lock_lost','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','76');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Performance_schema_mutex_classes_lost','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','77');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Performance_schema_mutex_instances_lost','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','78');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Performance_schema_nested_statement_lost','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','79');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Performance_schema_prepared_statements_lost','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','80');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Performance_schema_program_lost','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','81');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Performance_schema_rwlock_classes_lost','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','82');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Performance_schema_rwlock_instances_lost','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','83');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Performance_schema_session_connect_attrs_lost','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','84');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Performance_schema_socket_classes_lost','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','85');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Performance_schema_socket_instances_lost','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','86');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Performance_schema_stage_classes_lost','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','87');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Performance_schema_statement_classes_lost','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','88');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Performance_schema_table_handles_lost','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','89');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Performance_schema_table_instances_lost','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','90');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Performance_schema_table_lock_stat_lost','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','91');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Performance_schema_thread_classes_lost','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','92');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Performance_schema_thread_instances_lost','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','93');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'2017-06-26 19:49','Performance_schema_users_lost','show status','{"valueColumn": "Value","keyColumns": ["Variable_name"]}','11','94');
|
||||||
INSERT INTO meta_sensor_item_key (create_date,"key","froms",option_json,crawler_id,item_id) VALUES (
|
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');
|
'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 (
|
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');
|
'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 (
|
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');
|
'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 (
|
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');
|
'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 (
|
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');
|
'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 (
|
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');
|
'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 (
|
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');
|
'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 (
|
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');
|
'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 (
|
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');
|
'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 (
|
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');
|
'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 (
|
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');
|
'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 (
|
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');
|
'2017-06-26 19:49','FreeSpace','Win32_LogicalDisk','{"arrayColumns": ["Caption"],"appends": ["Caption"]}','23','106');
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user