diff --git a/Workbench/scripts/getCriticalResourceStatus.sh b/Workbench/scripts/getCriticalResourceStatus.sh new file mode 100755 index 0000000..6fd4cc6 --- /dev/null +++ b/Workbench/scripts/getCriticalResourceStatus.sh @@ -0,0 +1,54 @@ +#/bin/bash + +###config settings### +#mp_username='administrator' +#mp_userpass='5ecr3t' +mp_username='banderson' +mp_userpass='Password1' +#################### + +###declarations### +declare -A KeyResources + +###functions### +function getResourceStatus() { + + KeyResources=( ["Grouper"]="fb0bbf07-e33f-4ddd-85a1-16a7edc237f2" ["COmanage"]="edb9e47b-e8ad-48b7-9127-ae7b8911a8f2" ["LDAP"]="0a37121f-d515-4a23-9b6d-554c5ef61272" ) + mp_baseUrl='https://localhost:10443/midpoint/ws/rest' + + for resourcename in "${!KeyResources[@]}"; do + if [ "$resourcename" = "$1" ]; then + thisResourceOid=${KeyResources[$resourcename]} + thisResourceName=$resourcename + fi + done + + url=$mp_baseUrl/resources/$thisResourceOid/test + rawVal=$(curl -s -k --user $mp_username:$mp_userpass -H "Accept: application/json" -X POST $url) + if [ $? -ne 0 ]; then + echo "ERROR: Problem connecting to host. Exiting..." + echo "" + exit 1 + fi + + resourceStatus=$(echo $rawVal | jq -r '.object.status') + echo "Resource Name: $thisResourceName" + #echo "Resource OID: $thisResourceOid" + if [ "$resourceStatus" != "success" ]; then + echo "*** resource has problems (status=$resourceStatus) ***" + else + echo "resource is healthy" + fi + + echo "" +} + +### Main ### +echo "midPoint Resource Health Check" +echo "" +getResourceStatus "Grouper" +getResourceStatus "COmanage" +getResourceStatus "LDAP" +echo "" +echo "" + diff --git a/Workbench/scripts/getCriticalTasksStatus.sh b/Workbench/scripts/getCriticalTasksStatus.sh new file mode 100755 index 0000000..94864e9 --- /dev/null +++ b/Workbench/scripts/getCriticalTasksStatus.sh @@ -0,0 +1,61 @@ +#/bin/bash + +###config settings### +#mp_username='administrator' +#mp_userpass='5ecr3t' +mp_username='banderson' +mp_userpass='Password1' +#################### + +###declarations### +declare -A KeyTasks + +###functions### +function getTaskStatus() { + KeyTasks=( ["Grouper Livesync"]="552112fc-9546-4e63-a170-339d99a3455e" ["COmanage Livesync"]="5a821505-7318-4364-9a2f-501b8bf30b44" \ + ["COmanage Import"]="ec605247-fcb3-42f7-a241-3b1aaa96cea4" ["Grouper reconcile groups"]="22625b6c-e9a7-4151-88f8-013abb1cc158" \ + ["Grouper reconcile subjects"]="95539396-14ce-4787-aaa8-c93e2aacfbc0" ["Recompute all users"]="f71bd7ce-2329-42da-a71e-b7c45ebed549" ) + mp_baseUrl='https://localhost:10443/midpoint/ws/rest' + + for taskname in "${!KeyTasks[@]}"; do + if [ "$taskname" = "$1" ]; then + thisTaskOid=${KeyTasks[$taskname]} + thisTaskName=$taskname + fi + done + + url=$mp_baseUrl/tasks/$thisTaskOid + #echo "URL is: $url" + rawVal=$(curl -s -k --user $mp_username:$mp_userpass -H "Accept: application/json" -X GET $url) + if [ $? -ne 0 ]; then + echo "ERROR: Problem connecting to host. Exiting..." + echo "" + exit 1 + fi + + taskStatus=$(echo $rawVal | jq -r '.task.executionState') + echo "Task Name: $thisTaskName" + #echo "Task OID: $thisTaskOid" + if [ "$taskStatus" = "running" ]; then + echo "task is running" + elif [ "$taskStatus" = "runnable" ]; then + echo "task is runnable" + else + echo "*** task has failed (status=$taskStatus) ***" + fi + + echo "" +} + +### Main ### +echo "midPoint Critical Task Status Check" +echo "" +getTaskStatus "Grouper Livesync" +getTaskStatus "COmanage Livesync" +getTaskStatus "COmanage Import" +getTaskStatus "Grouper reconcile groups" +getTaskStatus "Grouper reconcile subjects" +getTaskStatus "Recompute all users" +echo "" +echo "" + diff --git a/Workbench/scripts/gethealth2.py b/Workbench/scripts/gethealth2.py deleted file mode 100755 index 31dd6f2..0000000 --- a/Workbench/scripts/gethealth2.py +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/python - -containers = ["idp", "idp_ui", "idp_ui_data", "idp_ui_api", "grouper_ui", "grouper_ws", "grouper_daemon", "grouper_data", "comanage", "comanage_cron", "comanage_data", "midpoint_server", "midpoint_data", "webproxy", "wordpress_server", "wordpress_data", "mq", "directory", "sources"] - -print("
Container | Health Status |
---|---|
" + container + " | " + healthstatus + " |