Add healthcheck pings to opentofu and add systemd cleanup to healthcheck
This commit is contained in:
		
							parent
							
								
									2ad3cce749
								
							
						
					
					
						commit
						a15e70d73d
					
				
					 7 changed files with 60 additions and 11 deletions
				
			
		|  | @ -2,7 +2,6 @@ | |||
| 
 | ||||
| cd /opt/ || exit | ||||
| 
 | ||||
| hc_url="https://hc-ping.com/$HTTP_HC_UID" | ||||
| services_down="" | ||||
| error="" | ||||
| 
 | ||||
|  | @ -46,8 +45,8 @@ check_url "www.reitanlage-oranienburg.de" | |||
| 
 | ||||
| if [ "$error" = "" ] | ||||
| then | ||||
|     curl_hc "$hc_url" >/dev/null | ||||
|     curl_hc "$HTTP_HC_URL" >/dev/null | ||||
| 	echo "ALL GOOD" | ||||
| else | ||||
| 	curl_hc --data-raw "$services_down$error" "$hc_url/fail" >/dev/null | ||||
| 	curl_hc --data-raw "$services_down$error" "$HTTP_HC_URL/fail" >/dev/null | ||||
| fi | ||||
|  |  | |||
|  | @ -8,10 +8,8 @@ import sys | |||
| import asyncio | ||||
| from nio import AsyncClient, RoomMessageNotice | ||||
| 
 | ||||
| healthcheck_url = "https://hc-ping.com/" + os.environ['MATRIX_HC_UID'] | ||||
| 
 | ||||
| def send_ping(success, msg=""): | ||||
|     url = healthcheck_url | ||||
|     url = os.environ['MATRIX_HC_URL'] | ||||
|     if not success: | ||||
|         url += "/fail" | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue