Il y a 389 articles et 19 utilisateurs inscrits (ce bandeau est défini dans MediaWiki:Sitenotice)

Monitoring serveur

De AJLSM
Aller à la navigation Aller à la recherche

Le script de monitoring est hébergé sur le serveur Doc/Ouessant par l'utilisateur ajlsm. Le script est hébergé sur compte github et peut être cloné si besoin.

Important :
{{{1}}}.
git clone https://github.com/edouard-lopez/monitor-http-server

First you need to edit the file monitor-list.txt and add some servers URLs (using their FQDN).

Note that lines starting with a # (dash) are ignored.

# ignored hosts
# http://wont-be.tested.com/
# test
http://my.website.com/

Then you are good to go and run your first test, the script can take two argument :

  1. email: the target email
  2. server-list: the file containing the list of servers to monitor. Default is to use monitor-list-default.txt.
bash /path/to/monitor-servers.sh me@host.com ./custom-list.txt

J'ai déclaré une tâche cron rattacher à l'utilisateur ajlsm.

crontab -e

Voici à quoi elle ressemble :

# voir la liste des serveurs monitoré dans ~/shell-scripts/monitor/monitor-list-ajlsm.txt
0 7-23 * * * bash "$HOME"/shell-scripts/monitor/monitor-servers.sh ajlsm@ajlsm.com "$HOME"/shell-scripts/monitor/monitor-list-ajlsm.txt

<references/>