Simple server monitoring with web notification.
Best suited for:
- Personal / non-critical projects that you still want to make sure it's up.
- Personal email server.
- Monitor multiple services & list them in one page.
- Log monitoring data in SQLite database.
- Access uptime statistics for the pervious day/week/month from web.
- Access latest (last n minutes) monitoring log from web.
- Comes with code for checking if HTTP server is up, responding with 200 and whether response contains some pre-defined strings.
- Comes with code to check for close-to-expiration / expired TLS certificates.
- Support SMTP STARTTLS for checking email servers.
-
Open
web/checks.rs
-
At the end of the file, find a piece of code like this:
http_and_tls!(0<<4, "maowtm.org");
http_and_tls!(1<<4, "paper.sc");
http_and_tls!(2<<4, "static.maowtm.org");
http_and_tls!(3<<4, "localhost");
smtp!( 4<<4, "gmail-smtp-in.l.google.com");
-
Remove them, and replace with code that check your servers.
The macro
http_and_tls!
andsmtp!
takes two argument: a unique check id, and the domain to check. Check id can be any number you choose, as long as it is unique for each check. Internally,http_and_tls!
creates two checks, one with the provided check id, another with the provided check id + 1. Hence I usedn<<4
to ensure that no two checks get assigned the same check id accidentally. -
cargo build --features 'web' --release
-
Run
target/release/web
. This will open a web server as instructed inweb/Rocket.toml
.
- Add more checks