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
création+catégories
 
m →Installation : typo modele {{important}}
 
(2 versions intermédiaires par le même utilisateur non affichées)
Ligne 2 : Ligne 2 :


== Installation ==
== Installation ==
{{important|j'utilise des [http://blog.endpoint.com/2010/04/git-submodule-workflow.html sous-modules git], pensé à les récupérer<ref name="submodule-workflow">[http://blog.endpoint.com/2010/04/git-submodule-workflow.html Git Submodules: What is the Ideal Workflow?]</ref>}
{{important|j'utilise des [http://blog.endpoint.com/2010/04/git-submodule-workflow.html sous-modules git], pensé à les récupérer<ref name="submodule-workflow">[http://blog.endpoint.com/2010/04/git-submodule-workflow.html Git Submodules: What is the Ideal Workflow?]</ref>}}
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
git clone https://github.com/edouard-lopez/monitor-http-server
git clone https://github.com/edouard-lopez/monitor-http-server
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).


Note that lines starting with a # (dash) are ignored.
Note that lines starting with a # (dash) are ignored.
 
<syntaxhighlight lang="bash">
# ignored hosts
# ignored hosts
# http://wont-be.tested.com/
# http://wont-be.tested.com/
# test
# test
http://my.website.com/
http://my.website.com/
</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

Dernière version du 28 mars 2013 à 09:33

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/>