Skip to content
forked from qlaffont/monity

Monitoring Website and Servers (feat. Public Page, Webhook, Prometheus Export)

License

Notifications You must be signed in to change notification settings

inframonit/monity

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🖥 Monity

Open Source Love Maintenance Travis (.com) David

GitHub issues PRs Welcome

GitHub stars Docker Pulls

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


Install

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

Documentation

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 Variables

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

Webhook

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

Activate System Crontab

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

Issues

If you have any problems, please contact us through a GitHub issue.

Contributing

You are invited to contribute new features, fixes, or updates, large or small. Regarding a pull request, tests need to pass to be merged.

About

Monitoring Website and Servers (feat. Public Page, Webhook, Prometheus Export)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 94.9%
  • JavaScript 2.8%
  • CSS 1.7%
  • Other 0.6%