Update README.md

This commit is contained in:
Axel 2021-01-08 17:29:35 +01:00 committed by GitHub
parent 64aea328db
commit 26a60ea87d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,19 +1,22 @@
# MONITOLITE # MONITOLITE
MonitoLite is a quite old project I recently found into my archives. I developed this script years ago. **MonitoLite** is a quite old project I recently found into my archives. I developed this script years ago.
I figured it could be useful for others so here we are. I figured it could be useful for others so here we are.
## What it does ## What it does
MonitoLite is a very simple monitoring tool developed in Perl. It supports : **MonitoLite** is a very simple monitoring tool developed in Perl. It supports :
* ping monitoring * **ping monitoring**: sends a `ping` command to the specified host. Raises an alert if the host is down
* http monitoring * **http monitoring**: gets the provided URL and raises an alert if the URL returns an error. Optionally you may specify a string to search on the page using the `param` database field. It raises an alert if the specified text could not be found on the page.
In case of an alert, the script sends an email notifications to the specified contacts (one or many).
The script also sends a recovery email notification when the alert is over.
It uses a SQL backend for handling the tasks and the status of the tasks. It uses a SQL backend for handling the tasks and the status of the tasks.
Tested on MySQL only. Tested on MySQL only.
It comes with a very straightforward dashboard written in PHP. It comes with a very straightforward dashboard written in PHP. This is **optional**, the `monitolite.pl` script runs as standalone.
I rewrote a couple of things today to make sure the script still works. I rewrote a couple of things today to make sure the script still works.
@ -24,11 +27,13 @@ I rewrote a couple of things today to make sure the script still works.
## Requirements ## Requirements
* Perl * Perl : with DBI, Dotenv, Net::Ping, MIME::Lite, LWP::Agent, LWP::UserAgent
* a MTA * a MTA: Postfix, ...
* PHP (with PDO) * PHP 7+ (optional): with PDO
* a Database server (MySQL, other?) * a webserver (optional): Apache, Nginx, ...
* Access to CRON tasks * a Database server: MySQL, other? (untested)
* access to CRON tasks
* possibly `root` access for the `ping` command to run (needs confirmation)
## Installation ## Installation
@ -37,6 +42,8 @@ I rewrote a couple of things today to make sure the script still works.
* install Perl dependencies * install Perl dependencies
* install PHP composer dependencies: `cd ./web && composer install` * install PHP composer dependencies: `cd ./web && composer install`
* create a Database and import the schema from `sql/create.sql` * create a Database and import the schema from `sql/create.sql`
* create your own `.env` file: `cp .env.example .env` and adapt it to your needs
* create a webserver vhost with document root to the `web` directory
* add tasks and contacts into the database (no backend yet) * add tasks and contacts into the database (no backend yet)
* run the script: `perl monitolite.pl` * run the script: `perl monitolite.pl`
* check the web dashboard for results. * check the web dashboard for results.
@ -47,6 +54,9 @@ I rewrote a couple of things today to make sure the script still works.
## TODO ## TODO
* Make CRUD possible from the backend * Make CRUD possible from the backend for adding tasks and contacts
* Multithreading * Multithreading
* SMS Notifications * SMS Notifications
* Better dashboard
* Raise alert when tasks are not run at the correct frequency (CRON down or other reason)
* Set a notification capping limit to prevent many notifications to be sent in case of an up-and-down host