Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| software:applications:nagios:plugins:nrpe [2020/11/03 13:57] – créée yoann | software:applications:nagios:plugins:nrpe [2024/08/19 16:44] (Version actuelle) – yoann | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| {{tag> | {{tag> | ||
| - | ====== Nagios: | + | ====== Nagios: |
| ===== Terminologie ===== | ===== Terminologie ===== | ||
| - | **NRPE** signifie **N**agios **R**emote **P**lugin **E**xecutor, | + | **NRPE** signifie **N**agios **R**emote **P**lugin **E**xecutor, |
| ==== Agent ==== | ==== Agent ==== | ||
| - | * L' | + | * L' |
| - | * L' | + | * L' |
| * Lorsqu' | * Lorsqu' | ||
| Ligne 34: | Ligne 34: | ||
| </ | </ | ||
| - | Coté hôte à superviser, on installe l' | + | Coté hôte à superviser, on installe |
| <code bash> | <code bash> | ||
| - | apt-get install nagios-nrpe-server | + | apt-get install |
| + | |||
| + | # vérifier l' | ||
| + | systemctl status | ||
| </ | </ | ||
| Ligne 44: | Ligne 47: | ||
| # Interface d' | # Interface d' | ||
| + | server_address=192.168.0.10 | ||
| # IP autorisées à contacter l' | # IP autorisées à contacter l' | ||
| - | allowed_hosts=192.9.200.5/24 | + | allowed_hosts=192.168.1.33 |
| # Création d'une commande de test pour la partition racine | # Création d'une commande de test pour la partition racine | ||
| - | command[check_root_fs]=/ | + | command[check_root_fs]=/ |
| </ | </ | ||
| Ligne 60: | Ligne 62: | ||
| </ | </ | ||
| + | ==== Pare-feu ==== | ||
| + | |||
| + | Si l'hote à superviser a le pare-feu UFW actif, créer une règle autorisant le traffic entrant pour l' | ||
| + | <code bash> | ||
| + | ufw --dry-run allow in on ethX proto tcp from ip-superviseur to ip-agent port 5666 comment ' | ||
| + | </ | ||
| ===== Tester la communication ===== | ===== Tester la communication ===== | ||
| Ligne 82: | Ligne 90: | ||
| <code bash> | <code bash> | ||
| - | cd /usr/local/nagios/libexec/ | + | su - nagios |
| - | check_nrpe -H ipAgentNRPE | + | cd /usr/lib/nagios/plugins/ |
| - | check_nrpe -H ipAgentNRPE -c check_root_fs | + | ./check_nrpe -H ipAgentNRPE |
| + | ./check_nrpe -H ipAgentNRPE -c check_root_fs | ||
| </ | </ | ||
| - | ===== Création du test ====== | + | ===== Configuration des services à superviser |
| + | |||
| + | Sur le serveur de supervision, | ||
| < | < | ||
| Ligne 97: | Ligne 108: | ||
| } | } | ||
| </ | </ | ||
| + | |||
| + | La commande pourra être utilisée pour tester différents services. Créer par exemple le test d | ||
| + | < | ||
| + | |||
| + | </ | ||
| + | |||
| + | ===== Troubleshooting ===== | ||
| + | |||
| + | L' | ||
| + | < | ||
| + | CHECK_NRPE STATE CRITICAL: Socket timeout after 10 seconds. | ||
| + | </ | ||
| + | |||
| + | Nagios ne reçoit aucune réponse de l' | ||
| + | |||
| + | <code bash> | ||
| + | journalctl --since today | grep "UFW BLOCK" | ||
| + | </ | ||
| + | |||
| + | Voir section pour inclure une autorisation. | ||
| + | |||
| ===== Références ===== | ===== Références ===== | ||
| * https:// | * https:// | ||
| + | * https:// | ||