-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from internet2/PC_MoreUpdates
add starter status page
- Loading branch information
Showing
5 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| #!/bin/python | ||
|
|
||
| containers = ["idp", "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("<table><tr><th style='text-align:left;width:150px'>Container</th><th style='text-align:left'>Health Status</th></tr>") | ||
| for container in containers: | ||
| from subprocess import Popen, PIPE | ||
| dcmd = "docker ps -f name=workbench_" + container + "_1 --format '{{ .Status }} '" | ||
| pipe = Popen(dcmd, shell=True, stdout=PIPE) | ||
| healthstatus = '<font color="grey">unknown</font>' | ||
| for line in pipe.stdout: | ||
| if ('(' in line): | ||
| healthstatus=line.split('(')[1].split(')')[0].strip() | ||
| if (healthstatus == "healthy"): | ||
| healthstatus='<font color="green">' + healthstatus + '</font>' | ||
| elif (healthstatus == "unhealthy"): | ||
| healthstatus='<font color="red">' + healthstatus + '</font>' | ||
| else: | ||
| healthstatus='<font color="blue">' + healthstatus + '</font>' | ||
| else: | ||
| healthstatus='<font color="orange">unspecified</font>' | ||
|
|
||
| print("<tr><td>" + container + "</td><td>" + healthstatus + "</td></tr>") | ||
| print("</table>") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #!/bin/bash | ||
| CRONFILE=/csp-tap/InCommonTAP-Examples/Workbench/scripts/csp-cron | ||
|
|
||
| #build crontab file | ||
| echo "#update CSP container status" > ${CRONFILE} | ||
| echo "*/5 * * * * /csp-tap/InCommonTAP-Examples/Workbench/scripts/update-health-status.sh" >> ${CRONFILE} | ||
| chmod 644 ${CRONFILE} | ||
|
|
||
| #install crontab | ||
| crontab ${CRONFILE} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| #!/bin/bash | ||
|
|
||
| /csp-tap/InCommonTAP-Examples/Workbench/scripts/gethealth.py > /csp-tap/InCommonTAP-Examples/Workbench/scripts/gethealth-output.txt | ||
|
|
||
| docker cp /csp-tap/InCommonTAP-Examples/Workbench/scripts/gethealth-output.txt workbench_webproxy_1:/var/www/html/status/index.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters