Search in sources :

Example 1 with DiagTestMetadata

use of com.emc.storageos.systemservices.impl.healthmonitor.beans.DiagTestMetadata in project coprhd-controller by CoprHD.

the class DiagnosticsScheduler method run.

@Override
public void run() {
    List<DiagTest> diagTests = DiagnosticsExec.getDiagToolResults(DiagConstants.VERBOSE);
    DiagTestMetadata diagTestMetadata;
    for (DiagTest test : diagTests) {
        if ((diagTestMetadata = DiagTestsMetadata.getMetadata().get(test.getName())) != null) {
            String[] statusArr = test.getStatus().split(",");
            for (String status : statusArr) {
                status = status.trim();
                if (!diagTestMetadata.getOk().contains(status)) {
                    if (diagTestMetadata.getWarn().contains(status)) {
                        alertsLog.warn(test);
                    } else if (diagTestMetadata.getError().contains(status)) {
                        alertsLog.error(test);
                    } else if (diagTestMetadata.getCrit().contains(status)) {
                        alertsLog.fatal(test);
                    }
                }
            }
        }
    }
    // Monitor dbsvc and geodbsvc status and persist service downtime to ZK
    _dbDowntimeTracker.run();
    // Analysis db and zk logs, if the errors match pre-define patterns, alter it in SystemEvents.
    _dbLogAnalyser.analysisLogs();
    _zkLogAnalyser.analysisLogs();
    _controllerSvcLogAnalyser.analysisLogs();
}
Also used : DiagTestMetadata(com.emc.storageos.systemservices.impl.healthmonitor.beans.DiagTestMetadata) DiagTest(com.emc.vipr.model.sys.healthmonitor.DiagTest)

Aggregations

DiagTestMetadata (com.emc.storageos.systemservices.impl.healthmonitor.beans.DiagTestMetadata)1 DiagTest (com.emc.vipr.model.sys.healthmonitor.DiagTest)1