Package org.rhq.modules.integrationTests.restApi.d

Examples of org.rhq.modules.integrationTests.restApi.d.AlertCondition


        int definitionId = createEmptyAlertDefinition(true);

        // Now add a condition
        try {

            AlertCondition alertCondition = new AlertCondition("AVAILABILITY", "AVAIL_GOES_UP");
            addConditionToDefinition(definitionId, alertCondition);

            alertCondition = new AlertCondition("EVENT","ERROR");
            alertCondition.setOption(".*JBAS123.*");
            addConditionToDefinition(definitionId, alertCondition);

            int metricDef = findAMetricDefinitionForResourceId(_platformId, "metric");
            assert metricDef != 0;
            alertCondition = new AlertCondition("THRESHOLD");
            alertCondition.setComparator("<");
            alertCondition.setThreshold(12345.0);
            alertCondition.setMeasurementDefinition(metricDef);
            addConditionToDefinition(definitionId, alertCondition);

            alertCondition = new AlertCondition("BASELINE");
            alertCondition.setThreshold(0.5);
            alertCondition.setOption("mean");
            alertCondition.setComparator("<");
            alertCondition.setMeasurementDefinition(metricDef);
            addConditionToDefinition(definitionId, alertCondition);

            alertCondition = new AlertCondition("AVAIL_DURATION","AVAIL_DURATION_DOWN");
            alertCondition.setOption("240"); // 4 min
            addConditionToDefinition(definitionId, alertCondition);

            alertCondition = new AlertCondition("CHANGE");
            alertCondition.setMeasurementDefinition(metricDef);
            addConditionToDefinition(definitionId, alertCondition);

            int traitDef = findAMetricDefinitionForResourceId(_platformId, "trait");
            assert traitDef!=0;
            alertCondition = new AlertCondition("TRAIT");
            alertCondition.setOption("10.*");
            alertCondition.setMeasurementDefinition(traitDef);
            addConditionToDefinition(definitionId, alertCondition);

            alertCondition = new AlertCondition("RANGE");
            alertCondition.setMeasurementDefinition(metricDef);
            alertCondition.setThreshold(4.0); // lower bound
            alertCondition.setOption("7.0"); // upper bound
            alertCondition.setComparator(">=");
            addConditionToDefinition(definitionId, alertCondition);

            alertCondition = new AlertCondition("CONTROL","discovery");
            alertCondition.setOption("FAILURE");
            addConditionToDefinition(definitionId, alertCondition);

            System.out.println("Definition created, waiting 60s for it to become active");

            // Wait a while - see https://bugzilla.redhat.com/show_bug.cgi?id=830299
View Full Code Here

TOP

Related Classes of org.rhq.modules.integrationTests.restApi.d.AlertCondition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.