Skip to content

Commit

Permalink
Feature/containerHealthRules (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
iogbole committed Aug 6, 2020
1 parent 264da3d commit 225fb48
Show file tree
Hide file tree
Showing 4 changed files with 324 additions and 18 deletions.
7 changes: 4 additions & 3 deletions configMyApp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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"
Expand Down
35 changes: 20 additions & 15 deletions healthrules/Application/Agent-Availability.json
Original file line number Diff line number Diff line change
@@ -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
}
}
}
159 changes: 159 additions & 0 deletions healthrules/Application/ServiceEndPoint-ErrorRate.json
Original file line number Diff line number Diff line change
@@ -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
}
}
}
}
141 changes: 141 additions & 0 deletions healthrules/Application/ServiceEndPoint-ResponseTime.json
Original file line number Diff line number Diff line change
@@ -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
}
}
}
}

0 comments on commit 225fb48

Please sign in to comment.