From 225fb48d46d27a9dc1fca8831eb4792a88101290 Mon Sep 17 00:00:00 2001 From: Israel Ogbole Date: Thu, 6 Aug 2020 18:02:26 +0100 Subject: [PATCH] Feature/containerHealthRules (#28) --- configMyApp.sh | 7 +- .../Application/Agent-Availability.json | 35 ++-- .../ServiceEndPoint-ErrorRate.json | 159 ++++++++++++++++++ .../ServiceEndPoint-ResponseTime.json | 141 ++++++++++++++++ 4 files changed, 324 insertions(+), 18 deletions(-) create mode 100644 healthrules/Application/ServiceEndPoint-ErrorRate.json create mode 100644 healthrules/Application/ServiceEndPoint-ResponseTime.json diff --git a/configMyApp.sh b/configMyApp.sh index 58b508d..ff7986d 100755 --- a/configMyApp.sh +++ b/configMyApp.sh @@ -128,7 +128,8 @@ function func_check_http_status() { local message_on_failure=$2 #echo "HTTP status code: $http_code" if [[ $http_code -lt 200 ]] || [[ $http_code -gt 299 ]]; then - echo $message_on_failure + + echo "$http_code : $message_on_failure" func_cleanup exit 1 fi @@ -199,7 +200,7 @@ function func_import_health_rules(){ allHealthRules=$(curl -s --user ${_user_credentials} ${_controller_url}/alerting/rest/v1/applications/${appId}/health-rules ${_proxy_details}) for f in $folderPath; do - + echo "Processing $f health rule template" # get health rule name from json file healthRuleName=$(jq -r '.name' <$f) # use it to get health rule id (if exists) @@ -244,7 +245,7 @@ echo "" if [ "${_bt_only}" = true ]; then echo "" - echo "You entered $_bt_only. This instruction will ONLY configure business transaction in $_application_name" + echo "BT_ONLY=$_bt_only. This instruction will ONLY configure business transaction in $_application_name" echo "Application health rules, SIM health rules, dashboard, etc will not be created..." echo "" echo "Please wait while we process your Business transaction configuration settings from the JSON file" diff --git a/healthrules/Application/Agent-Availability.json b/healthrules/Application/Agent-Availability.json index f4826a9..ee7bcdb 100644 --- a/healthrules/Application/Agent-Availability.json +++ b/healthrules/Application/Agent-Availability.json @@ -1,44 +1,49 @@ { - "name": "Node Availability Health: Java Agents", - "enabled": false, - "useDataFromLastNMinutes": 6, - "waitTimeAfterViolation": 6, + "name": "Agent Availability", + "enabled": true, + "useDataFromLastNMinutes": 60, + "waitTimeAfterViolation": 30, "scheduleName": "Always", "affects": { "affectedEntityType": "TIER_NODE_HARDWARE", "affectedEntities": { "tierOrNode": "NODE_AFFECTED_ENTITIES", - "typeofNode": "JAVA_NODES", + "typeofNode": "ALL_NODES", "affectedNodes": { - "affectedNodeScope": "ALL_NODES" + "affectedNodeScope": "NODES_MATCHING_PATTERN", + "patternMatcher": { + "matchTo": "EQUALS", + "matchValue": "Machine Agent", + "shouldNot": true + } } } }, "evalCriterias": { - "criticalCriteria": { + "criticalCriteria": null, + "warningCriteria": { "conditionAggregationType": "ALL", "conditionExpression": null, "conditions": [ { - "name": "Java Node Availability Health", + "name": "Agent Failure Warning", "shortName": "A", - "evaluateToTrueOnNoData": false, + "evaluateToTrueOnNoData": true, "evalDetail": { "evalDetailType": "SINGLE_METRIC", - "metricAggregateFunction": "SUM", - "metricPath": "Agent|App|Availability", + "metricAggregateFunction": "VALUE", + "metricPath": "Agent|Machine|Availability", "metricEvalDetail": { "metricEvalDetailType": "SPECIFIC_TYPE", "compareCondition": "LESS_THAN_SPECIFIC_VALUE", - "compareValue": 3 + "compareValue": 1 } }, "triggerEnabled": false, - "minimumTriggers": 2 + "minimumTriggers": 0 } ], "evalMatchingCriteria": null - }, - "warningCriteria": null + } } } \ No newline at end of file diff --git a/healthrules/Application/ServiceEndPoint-ErrorRate.json b/healthrules/Application/ServiceEndPoint-ErrorRate.json new file mode 100644 index 0000000..cef38b2 --- /dev/null +++ b/healthrules/Application/ServiceEndPoint-ErrorRate.json @@ -0,0 +1,159 @@ +{ + "name": "Standard Service Endpoints: Error Rate Health", + "enabled": true, + "useDataFromLastNMinutes": 30, + "waitTimeAfterViolation": 30, + "scheduleName": "Always", + "affects": { + "affectedEntityType": "SERVICE_ENDPOINTS", + "affectedServiceEndpoints": { + "serviceEndpointScope": "ALL_SERVICE_ENDPOINTS" + } + }, + "evalCriterias": { + "criticalCriteria": { + "conditionAggregationType": "ALL", + "conditionExpression": null, + "conditions": [ + { + "name": "Error Percentage", + "shortName": "A", + "evaluateToTrueOnNoData": false, + "evalDetail": { + "evalDetailType": "METRIC_EXPRESSION", + "metricExpression": "{totalErrors}/{totalCalls}*100", + "metricExpressionVariables": [ + { + "variableName": "totalErrors", + "metricAggregateFunction": "VALUE", + "metricPath": "Errors per Minute" + }, + { + "variableName": "totalCalls", + "metricAggregateFunction": "VALUE", + "metricPath": "Calls per Minute" + } + ], + "metricEvalDetail": { + "metricEvalDetailType": "SPECIFIC_TYPE", + "compareCondition": "GREATER_THAN_SPECIFIC_VALUE", + "compareValue": 5 + } + }, + "triggerEnabled": false, + "minimumTriggers": 15 + }, + { + "name": "Minimum Calls per Minute", + "shortName": "B", + "evaluateToTrueOnNoData": false, + "evalDetail": { + "evalDetailType": "SINGLE_METRIC", + "metricAggregateFunction": "VALUE", + "metricPath": "Calls per Minute", + "metricEvalDetail": { + "metricEvalDetailType": "SPECIFIC_TYPE", + "compareCondition": "GREATER_THAN_SPECIFIC_VALUE", + "compareValue": 10 + } + }, + "triggerEnabled": false, + "minimumTriggers": 15 + }, + { + "name": "Minimum Errors", + "shortName": "C", + "evaluateToTrueOnNoData": false, + "evalDetail": { + "evalDetailType": "SINGLE_METRIC", + "metricAggregateFunction": "VALUE", + "metricPath": "Errors per Minute", + "metricEvalDetail": { + "metricEvalDetailType": "SPECIFIC_TYPE", + "compareCondition": "GREATER_THAN_SPECIFIC_VALUE", + "compareValue": 10 + } + }, + "triggerEnabled": false, + "minimumTriggers": 15 + } + ], + "evalMatchingCriteria": { + "matchType": "ANY_NODE", + "value": null + } + }, + "warningCriteria": { + "conditionAggregationType": "ALL", + "conditionExpression": null, + "conditions": [ + { + "name": "Error Percentage", + "shortName": "A", + "evaluateToTrueOnNoData": false, + "evalDetail": { + "evalDetailType": "METRIC_EXPRESSION", + "metricExpression": "{totalErrors}/{totalCalls}*100", + "metricExpressionVariables": [ + { + "variableName": "totalErrors", + "metricAggregateFunction": "VALUE", + "metricPath": "Errors per Minute" + }, + { + "variableName": "totalCalls", + "metricAggregateFunction": "VALUE", + "metricPath": "Calls per Minute" + } + ], + "metricEvalDetail": { + "metricEvalDetailType": "SPECIFIC_TYPE", + "compareCondition": "GREATER_THAN_SPECIFIC_VALUE", + "compareValue": 1 + } + }, + "triggerEnabled": false, + "minimumTriggers": 15 + }, + { + "name": "Minimum Calls per Minute", + "shortName": "B", + "evaluateToTrueOnNoData": false, + "evalDetail": { + "evalDetailType": "SINGLE_METRIC", + "metricAggregateFunction": "VALUE", + "metricPath": "Calls per Minute", + "metricEvalDetail": { + "metricEvalDetailType": "SPECIFIC_TYPE", + "compareCondition": "GREATER_THAN_SPECIFIC_VALUE", + "compareValue": 10 + } + }, + "triggerEnabled": false, + "minimumTriggers": 15 + }, + { + "name": "Minimum Errors", + "shortName": "C", + "evaluateToTrueOnNoData": false, + "evalDetail": { + "evalDetailType": "SINGLE_METRIC", + "metricAggregateFunction": "VALUE", + "metricPath": "Errors per Minute", + "metricEvalDetail": { + "metricEvalDetailType": "SPECIFIC_TYPE", + "compareCondition": "GREATER_THAN_SPECIFIC_VALUE", + "compareValue": 10 + } + }, + "triggerEnabled": false, + "minimumTriggers": 15 + } + ], + "evalMatchingCriteria": { + "matchType": "ANY_NODE", + "value": null + } + } + } +} \ No newline at end of file diff --git a/healthrules/Application/ServiceEndPoint-ResponseTime.json b/healthrules/Application/ServiceEndPoint-ResponseTime.json new file mode 100644 index 0000000..b7d93bd --- /dev/null +++ b/healthrules/Application/ServiceEndPoint-ResponseTime.json @@ -0,0 +1,141 @@ +{ + "name": "Standard Service Endpoint: Response Time Health", + "enabled": true, + "useDataFromLastNMinutes": 30, + "waitTimeAfterViolation": 30, + "scheduleName": "Always", + "affects": { + "affectedEntityType": "SERVICE_ENDPOINTS", + "affectedServiceEndpoints": { + "serviceEndpointScope": "ALL_SERVICE_ENDPOINTS" + } + }, + "evalCriterias": { + "criticalCriteria": { + "conditionAggregationType": "ALL", + "conditionExpression": null, + "conditions": [ + { + "name": "Average Response Time", + "shortName": "A", + "evaluateToTrueOnNoData": false, + "evalDetail": { + "evalDetailType": "SINGLE_METRIC", + "metricAggregateFunction": "VALUE", + "metricPath": "Average Response Time (ms)", + "metricEvalDetail": { + "metricEvalDetailType": "BASELINE_TYPE", + "baselineCondition": "GREATER_THAN_BASELINE", + "baselineName": "Default Baseline", + "compareValue": 4, + "baselineUnit": "STANDARD_DEVIATIONS" + } + }, + "triggerEnabled": false, + "minimumTriggers": 15 + }, + { + "name": "Minimum Calls per Minute", + "shortName": "B", + "evaluateToTrueOnNoData": false, + "evalDetail": { + "evalDetailType": "SINGLE_METRIC", + "metricAggregateFunction": "VALUE", + "metricPath": "Calls per Minute", + "metricEvalDetail": { + "metricEvalDetailType": "SPECIFIC_TYPE", + "compareCondition": "GREATER_THAN_SPECIFIC_VALUE", + "compareValue": 10 + } + }, + "triggerEnabled": false, + "minimumTriggers": 15 + }, + { + "name": "Minimum Average Response Time", + "shortName": "C", + "evaluateToTrueOnNoData": false, + "evalDetail": { + "evalDetailType": "SINGLE_METRIC", + "metricAggregateFunction": "VALUE", + "metricPath": "Average Response Time (ms)", + "metricEvalDetail": { + "metricEvalDetailType": "SPECIFIC_TYPE", + "compareCondition": "GREATER_THAN_SPECIFIC_VALUE", + "compareValue": 100 + } + }, + "triggerEnabled": false, + "minimumTriggers": 15 + } + ], + "evalMatchingCriteria": { + "matchType": "ANY_NODE", + "value": null + } + }, + "warningCriteria": { + "conditionAggregationType": "ALL", + "conditionExpression": null, + "conditions": [ + { + "name": "Average Response Time", + "shortName": "A", + "evaluateToTrueOnNoData": false, + "evalDetail": { + "evalDetailType": "SINGLE_METRIC", + "metricAggregateFunction": "VALUE", + "metricPath": "Average Response Time (ms)", + "metricEvalDetail": { + "metricEvalDetailType": "BASELINE_TYPE", + "baselineCondition": "GREATER_THAN_BASELINE", + "baselineName": "Default Baseline", + "compareValue": 3, + "baselineUnit": "STANDARD_DEVIATIONS" + } + }, + "triggerEnabled": false, + "minimumTriggers": 15 + }, + { + "name": "Minimum Calls per Minute", + "shortName": "B", + "evaluateToTrueOnNoData": false, + "evalDetail": { + "evalDetailType": "SINGLE_METRIC", + "metricAggregateFunction": "VALUE", + "metricPath": "Calls per Minute", + "metricEvalDetail": { + "metricEvalDetailType": "SPECIFIC_TYPE", + "compareCondition": "GREATER_THAN_SPECIFIC_VALUE", + "compareValue": 10 + } + }, + "triggerEnabled": false, + "minimumTriggers": 15 + }, + { + "name": "Minimum Average Response Time", + "shortName": "C", + "evaluateToTrueOnNoData": false, + "evalDetail": { + "evalDetailType": "SINGLE_METRIC", + "metricAggregateFunction": "VALUE", + "metricPath": "Average Response Time (ms)", + "metricEvalDetail": { + "metricEvalDetailType": "SPECIFIC_TYPE", + "compareCondition": "GREATER_THAN_SPECIFIC_VALUE", + "compareValue": 100 + } + }, + "triggerEnabled": false, + "minimumTriggers": 15 + } + ], + "evalMatchingCriteria": { + "matchType": "ANY_NODE", + "value": null + } + } + } +} \ No newline at end of file