use of com.creditease.agent.feature.monitoragent.detect.JVMContainerOSDetector in project uavstack by uavorg.
the class MonitorAgent method startAppServerMonitorDetector.
private void startAppServerMonitorDetector() {
long detectInterval = DataConvertHelper.toLong(this.getConfigManager().getFeatureConfiguration(this.feature, "detector.interval"), 20000);
// init DetectorManager
DetectorManager appServerMonitorDetector_TimerWorker = new DetectorManager("AppServerMonitorDetector_TimerWorker", this.feature);
boolean isContainerDetectEnable = DataConvertHelper.toBoolean(this.getConfigManager().getFeatureConfiguration(this.feature, "detector.container.scan.enable"), false);
if (isContainerDetectEnable == true) {
// init JVMContainerOSDetector
JVMContainerOSDetector cosd = new JVMContainerOSDetector("JVMContainerOSDetector", this.feature, "modatahandlers", detectInterval);
cosd.register("appserver", "com.creditease.agent.feature.monitoragent.datacatch.http.HttpAppServerMonitorDataCatchWorker");
cosd.register("mscp", "com.creditease.agent.feature.monitoragent.datacatch.http.HttpMSCPMonitorDataCatchWorker");
cosd.register("springboot", "com.creditease.agent.feature.monitoragent.datacatch.http.HttpSpringBootMonitorDataCatchWorker");
// install JVMContainerOSDetector
appServerMonitorDetector_TimerWorker.installDetector(cosd);
}
boolean isLocalOSDetectEnable = DataConvertHelper.toBoolean(this.getConfigManager().getFeatureConfiguration(this.feature, "detector.local.scan.enable"), true);
if (isLocalOSDetectEnable == true) {
// init JVMLocalOSDetector
JVMLocalOSDetector asmd = new JVMLocalOSDetector("JVMLocalOSDetector", this.feature, "modatahandlers", detectInterval);
asmd.register("appserver", "com.creditease.agent.feature.monitoragent.datacatch.jmx.JMXAppServerMonitorDataCatchWorker");
asmd.register("mscp", "com.creditease.agent.feature.monitoragent.datacatch.jmx.JMXMSCPMonitorDataCatchWorker");
asmd.register("unknown", "com.creditease.agent.feature.monitoragent.datacatch.jmx.JMXJavaMonitorDataCatchWorker");
asmd.register("springboot", "com.creditease.agent.feature.monitoragent.datacatch.jmx.JMXSpringBootMonitorDataCatchWorker");
// install JVMLocalOSDetector
appServerMonitorDetector_TimerWorker.installDetector(asmd);
}
// start ApplicationServerMonitorDetector
this.getTimerWorkManager().scheduleWork("AppServerMonitorDetector_TimerWorker", appServerMonitorDetector_TimerWorker, 0, detectInterval);
if (log.isTraceEnable()) {
log.info(this, "ApplicationServer MonitorDetector started");
}
}
Aggregations