Skip to content

hexlo/website-monitoring-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

  _____               _     _ 
  \_   \___ ___  ___ (_) __| |
   / /\/ __/ _ \/ _ \| |/ _` |
/\/ /_| (_|  __/ (_) | | (_| |
\____/ \___\___|\___/|_|\__,_|
                              

website-monitoring-docker

Simple docker container that checks availability of websites.

  • Using gmail smtp server for email notifications by default.

  • The container will check the websites every hour by default. You can overwrite this behavior if you provide a file named custom-cron and bind-mount it in the container in /etc/cron.d. See the docker-compose.yml example below. Here is the cron expression documentation and a cron expression generator.

  • Here are the environment variables to either provide or optionally modify:

environment variables (case-sensitive!):

Env variable Description Default Example
EMAIL_ADDRESS required The email used to send the alert from and to. none EMAIL_ADDRESS=youremail@gmail.com
EMAIL_PASSWORD required Your email passwordused. It is recommended to generate an app password from your gmail account. none EMAIL_PASSWORD=password
URLS required URLs to be monitored. They are delimited by a comma. none URLS=website.com,b.org,https://c.io
SMTP_SERVER (optional) smtp server address smtp.gmail.com SMTP_SERVER=smtp.mail.yahoo.com
SMTP_PORT (optional) smtp port to be used. (25, SSL: 465, TLS: 587) 465 SMTP_PORT=587
EMAIL_LIST (optional) Email list to send the alert to. same value as EMAIL_ADDRESS EMAIL_LIST=joe@example.com,jane@domain.net
TZ (optional) Timezone. Here is a list of possible values. America/Toronto TZ=America/Toronto

custom-cron example (just modify the cron expression)

*/5 * * * * python3 monitor-websites.py
# This file must end with an empty or commented line

docker-compose.yml example (this uses a .env file to store the env variables):

version: '3.6'
services:
  web-monitor:
    image: ghcr.io/iceoid/website-monitoring-docker
    container_name: web-monitor
    restart: unless-stopped
    environment:
      - EMAIL_ADDRESS=$EMAIL_ADDRESS
      - EMAIL_PASSWORD=$EMAIL_PASSWORD
      # URLS are delimited by a comma i.e a.com,http://b.net,https://c.io
      - URLS=$URLS
      - TZ=America/Toronto
    volumes:
      - ./scripts/custom-cron:/ect/cron.d/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published