Search in sources :

Example 1 with JVMLocalOSDetector

use of com.creditease.agent.feature.monitoragent.detect.JVMLocalOSDetector 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");
    }
}
Also used : JVMContainerOSDetector(com.creditease.agent.feature.monitoragent.detect.JVMContainerOSDetector) JVMLocalOSDetector(com.creditease.agent.feature.monitoragent.detect.JVMLocalOSDetector) DetectorManager(com.creditease.agent.feature.monitoragent.detect.DetectorManager)

Aggregations

DetectorManager (com.creditease.agent.feature.monitoragent.detect.DetectorManager)1 JVMContainerOSDetector (com.creditease.agent.feature.monitoragent.detect.JVMContainerOSDetector)1 JVMLocalOSDetector (com.creditease.agent.feature.monitoragent.detect.JVMLocalOSDetector)1