This repository has been archived on 2026-06-29. You can view files and clone it, but cannot push or open issues or pull requests.
Files
resensys-site-status/checkAllSites.py
2026-06-29 13:32:41 -04:00

39 lines
956 B
Python

import mysql.connector.python
import requests
# The Lambda endpoint
URL = "https://7ft6zzxgc3fr34nmrd5t63cel40vzvhp.lambda-url.us-east-1.on.aws/"
# List of site IDs to check
site_ids = [
"48-01",
"48-02",
"48-03",
# add more here...
]
# Common headers
HEADERS = {
"Content-Type": "application/json"
}
MYSQL_USER = "MKK"
MYSQL_PW = "BoxPaxMint12"
MYSQL_HOST = "resensys-cloudbase.coxrusc9yue4.us-east-1.rds.amazonaws.com"
MYSQL_PORT = 3306
def get_sites():
print("This is where we get the site IDs...")
if __name__ == "__main__":
for site_id in site_ids:
payload = {"site_id": site_id}
try:
response = requests.post(URL, headers=HEADERS, json=payload, timeout=10)
response.raise_for_status() # raises for 4xx/5xx
print(f"[{site_id}] OK: {response.json()}")
except requests.exceptions.RequestException as e:
print(f"[{site_id}] ERROR: {e}")