This is a simple daemon that checks multiple websites concurrently and logs the statuses into SQLite database.
websites.yaml:
websites:
- url: https://packagemain.tech
interval: 10
- url: https://pliutau.com
interval: 15
- url: https://news.ycombinator.com
interval: 30
brew install opam
opam init
opam install ocaml-lsp-server odoc ocamlformat utop
opam switch create ocaml-base-compiler
opam install . --deps-only
dune build
CONFIG=./websites.yaml \
DB_NAME=./websites.sqlite3 \
./_build/install/default/bin/monitoring
docker build -t monitoring .
docker run \
-v $(pwd)/websites.yaml:/home/ocaml/websites.yaml \
-v $(pwd)/websites.sqlite3:/home/ocaml/websites.sqlite3 \
-e CONFIG=/home/ocaml/websites.yaml \
-e DB_NAME=/home/ocaml/websites.sqlite3 \
monitoring
dune runtest