Il y a 389 articles et 19 utilisateurs inscrits (ce bandeau est défini dans MediaWiki:Sitenotice)
« Monitoring serveur » : différence entre les versions
Aller à la navigation
Aller à la recherche
m →Configuration : exemple |
m →Installation : typo modele {{important}} |
||
| (Une version intermédiaire par le même utilisateur non affichée) | |||
| 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 == | ||
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 | 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.
Installation
[modifier | modifier le wikicode]Important :
{{{1}}}.
git clone https://github.com/edouard-lopez/monitor-http-server
Configuration
[modifier | modifier le wikicode]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
[modifier | modifier le wikicode]Then you are good to go and run your first test, the script can take two argument :
- email: the target email
- 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
[modifier | modifier le wikicode]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
[modifier | modifier le wikicode]<references/>