Wiki » Historique » Version 6
Patrice Nadeau, 2014-09-14 11:13
| 1 | 1 | Patrice Nadeau | %{font-size:18pt}check_domain_expiration% |
|---|---|---|---|
| 2 | |||
| 3 | 3 | Patrice Nadeau | Vérifie la date d'expiration d'un domaine internet. |
| 4 | |||
| 5 | 1 | Patrice Nadeau | --- |
| 6 | |||
| 7 | {{toc}} |
||
| 8 | |||
| 9 | h1. Explications |
||
| 10 | 3 | Patrice Nadeau | |
| 11 | Ce script _Bash_ vérifie la date d'expiration d'un domaine internet. |
||
| 12 | Les TLD(Top Level Domain) suivants sont reconnus : |
||
| 13 | * biz |
||
| 14 | * ca |
||
| 15 | * co |
||
| 16 | * com |
||
| 17 | * edu |
||
| 18 | * info |
||
| 19 | * me |
||
| 20 | * mobi |
||
| 21 | * net |
||
| 22 | * org |
||
| 23 | * tv |
||
| 24 | * us |
||
| 25 | * xxx |
||
| 26 | 1 | Patrice Nadeau | |
| 27 | 5 | Patrice Nadeau | h1. Installation |
| 28 | 4 | Patrice Nadeau | |
| 29 | Je prends pour acquis une installation sous openSUSE. |
||
| 30 | |||
| 31 | Installer le programme _whois_ (si il n'est pas deja installer) |
||
| 32 | <pre><code class="bash"> |
||
| 33 | # Verify if installed |
||
| 34 | rpm -qa | grep whois |
||
| 35 | # Install |
||
| 36 | zypper install whois |
||
| 37 | </code></pre> |
||
| 38 | |||
| 39 | Copier le fichier dans _/usr/lib/nagios/plugins_ |
||
| 40 | |||
| 41 | Rendre le fichier exécutable |
||
| 42 | <pre><code class="bash"> |
||
| 43 | chmod +x /usr/lib/nagios/plugins/check_domain_expiration.sh |
||
| 44 | 1 | Patrice Nadeau | </code></pre> |
| 45 | 5 | Patrice Nadeau | |
| 46 | h1. Utilisation |
||
| 47 | |||
| 48 | h2. Fichier de commandes |
||
| 49 | |||
| 50 | Ajouter au fichier _/etc/nagios/objects/commands.cfg_ : |
||
| 51 | <pre><code class="bash"> |
||
| 52 | 6 | Patrice Nadeau | # Check an internet domain expiration date |
| 53 | define command{ |
||
| 54 | command_name check_domain_expiration |
||
| 55 | command_line $USER1$/check_domain_expiration.sh $HOSTADDRESS$ $ARG1$ $ARG2$ |
||
| 56 | } |
||
| 57 | 5 | Patrice Nadeau | </code></pre> |
| 58 | |||
| 59 | h2. Fichier de domaines |
||
| 60 | |||
| 61 | Créer le fichier _/etc/nagios/objects/domains.cfg_ : |
||
| 62 | <pre><code class="bash"> |
||
| 63 | |||
| 64 | 1 | Patrice Nadeau | </code></pre> |
| 65 | 5 | Patrice Nadeau | |
| 66 | 6 | Patrice Nadeau | h2. |