Website and Server Monitor
- Check Website Status + Response Time
- Check if port is open + Response Time
- Export Metrics in Prometheus
- Send Webhook when status code change (Slack/Discord)
Technology Used: Fastify, Next (React), Bulma
Requirements :
- MongoDB
- Node.JS (v13)
npm run build && npm run start
Or you can use docker image (don't contain mongodb server)
docker pull qlaffont/monity
REST Documentation is accessible at the address http://localhost:5000/documentation.
To setup checkers, you can go to http://localhost:5000/setup.
To know the process to get auth token, you can go to http://localhost:5000/setup/auth.
Environment Variable (* = required) | Description | Example |
---|---|---|
PORT | Change default port (Default: 5000) |
process.env.PORT=5000 |
MONGODB_URI * | MongoDB Connection URI | process.env.MONGODB_URI="" |
NODE_ENV | If NODE_ENV === "production", it will disable rest documentation access. | process.env.NODE_ENV="production" |
AUTH_SECRET | Define JWT Secret Key. We strongly recommend to generate one. (Default: 'monity-secret') |
process.env.AUTH_SECRET="MySecretJWTKey" |
DEBUG_WORKER | Display Command send to Worker. (Default: false) |
process.env.DEBUG_WORKER=true |
DISABLE_AUTH | Disable Authentication and block access to API. (Default: false) |
process.env.DISABLE_AUTH=true |
WEBHOOK_URL | URL to call when Status Code Change (ex: Slack/Discord) | process.env.WEBHOOK_URL="myurl" |
WEBHOOK_MESSAGE | Markdown Message to use for webhook | process.env.WEBHOOK_MESSAGE="NEW STATUS" |
DISABLE_PROMETHEUS | Disable Prometheus Export | process.env.DISABLE_PROMETHEUS=true |
DISABLE_AUTOCLEAN | Disable Auto Clean Metrics (default: false) | process.env.DISABLE_AUTOCLEAN=true |
ENABLE_CRONTAB | Disable JS Crontab and activate sys crontab (see below) | process.env.ENABLE_CRONTAB=true |
To activate webhook, you need to add WEBHOOK_URL
in your environment variable.
To create a custom WEBHOOK_MESSAGE
, you can use these variables in your message:
Template Variables | Description |
---|---|
*|checkerName|* | Checker Name |
*|checkerAddress|* | Checker Address |
*|oldStatusCode|* | Old Status Code |
*|newStatusCode|* | New Status Code |
Default Message :
:information_source: **Status Changed** :information_source: \n __Checker__ : **|checkerName|** \n __Status Code__ : ~~*|oldStatusCode|*~~ to ***|newStatusCode|*** \n __Address__ : ***|checkerAddress|*** \n\n Powered by Monity
You can disable JS Crontab execution to use your crontab system.
To do that:
- Launch editor for crontab
crontab -e
- Add a cron line
* * * * * /myrepo/dist/server/worker/crontab.js > /dev/null
If you have any problems, please contact us through a GitHub issue.
You are invited to contribute new features, fixes, or updates, large or small. Regarding a pull request, tests need to pass to be merged.