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

« Monitoring serveur » : différence entre les versions

De AJLSM
Aller à la navigation Aller à la recherche
m →Configuration : exemple
m →Configuration : test
Ligne 9 : Ligne 9 :
== Configuration ==
== Configuration ==


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


Ligne 20 : Ligne 19 :
</syntaxhighlight>
</syntaxhighlight>


Then you are good to go and run your first test
== Test ==
 
Then you are good to go and run your first test, the script can take two argument :
# {{value|email}}: the target email
# {{value|server-list}}: the file containing the list of servers to monitor. Default is to use {{path|monitor-list-default.txt}}.
<syntaxhighlight lang="bash">
bash /path/to/monitor-servers.sh me@host.com ./custom-list.txt
bash /path/to/monitor-servers.sh me@host.com ./custom-list.txt
</syntaxhighlight>


=== Tâche Cron ===
=== Tâche Cron ===
J'ai déclarer une tâche {{cmd|cron}} rattacher à l'utilisateur {{value|ajlsm}}
J'ai déclaré une tâche {{cmd|cron}} rattacher à l'utilisateur {{value|ajlsm}}.
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
crontab -e
crontab -e

Version du 12 mars 2013 à 18:01

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.

Installation

{{important|j'utilise des sous-modules git, pensé à les récupérer<ref name="submodule-workflow">Git Submodules: What is the Ideal Workflow?</ref>}

git clone https://github.com/edouard-lopez/monitor-http-server

Configuration

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/

Test

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

Tâche Cron

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

Références

<references/>