Python/bash script to check if websites are up every 5minutes, send email if down/up.
https://app.sendgrid.com/guide/integrate/langs/python
https://app.sendgrid.com/settings/sender_auth/senders/new
export SENDGRID_API_KEY='SG.F--...Y'
x=1; while true; do echo $x;python3 web-chk.py; (( x++ ));sleep 300; done
- Create Function with 2 variables: SENDGRID_API_KEY SENDGRID_EMAIL_ADDRESS
- copy the code from file gcp-function-web-chk.py
- Create Scheduler => pub/sub
*/5 * * * *
to trigger the function
refer to the bash-chk-web.sh file
- SendGrid doesn't support multiple recipients in the current Python module
- It can't send any email if I make the sendgrid api call as a function in Python3