tech:notes_supervision_nagios
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| tech:notes_supervision_nagios [2025/12/23 15:33] – Jean-Baptiste | tech:notes_supervision_nagios [2026/01/16 14:51] (Version actuelle) – Jean-Baptiste | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | < | ||
| + | {{tag> | ||
| + | |||
| + | # Notes supervision Nagios | ||
| + | |||
| + | Voir **Zabbix** | ||
| + | |||
| + | Voir : | ||
| + | * [[Exemple simple de conf Nagios]] | ||
| + | * [Stop using Nagios - Andy Sykes](https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | Voir aussi : | ||
| + | * Icinga | ||
| + | * Shinken | ||
| + | |||
| + | |||
| + | |||
| + | ## Administration | ||
| + | |||
| + | ### Effacer l' | ||
| + | |||
| + | ~~~bash | ||
| + | / | ||
| + | rm / | ||
| + | rm / | ||
| + | / | ||
| + | ~~~ | ||
| + | |||
| + | A la place de systématiquement effacer ces fichiers avant de démarrer Nagios il est possible de changer : | ||
| + | |||
| + | '' | ||
| + | ~~~bash | ||
| + | # | ||
| + | retain_state_information=0 | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Configuration | ||
| + | |||
| + | |||
| + | Voir aussi : | ||
| + | * https:// | ||
| + | * [Add Host to HostGroup? Or add HostGroup to Host? | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | |||
| + | |||
| + | ### Exemple de conf | ||
| + | |||
| + | Exemple avec [[Supervision - Sonde Nagios - Mémoire Linux|check_snmp_mem_cpu.sh]] | ||
| + | |||
| + | ''/ | ||
| + | ~~~bash | ||
| + | |||
| + | define service { | ||
| + | service_description | ||
| + | hostgroup_name | ||
| + | check_command | ||
| + | max_check_attempts | ||
| + | normal_check_interval | ||
| + | retry_check_interval | ||
| + | check_period | ||
| + | notification_interval | ||
| + | notification_period | ||
| + | notification_options | ||
| + | contact_groups | ||
| + | # | ||
| + | } | ||
| + | ~~~ | ||
| + | |||
| + | ''/ | ||
| + | ~~~bash | ||
| + | |||
| + | define command { | ||
| + | command_name | ||
| + | command_line | ||
| + | } | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ### Supervision de services sans hôte réel associé | ||
| + | |||
| + | |||
| + | Voir : | ||
| + | * https:// | ||
| + | |||
| + | Voir aussi : | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | Un service doit forcémenet être attaché à un hôte pour pouvoir être utilisé. | ||
| + | |||
| + | Dans certains cas il faudrait créer un hôte fantôme pour porter le service | ||
| + | |||
| + | Dummy | ||
| + | |||
| + | '' | ||
| + | ~~~bash | ||
| + | # ' | ||
| + | # NOTE: This command always returns an ' | ||
| + | define command { | ||
| + | command_name | ||
| + | command_line | ||
| + | } | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | '' | ||
| + | ~~~c | ||
| + | define host { | ||
| + | host_name | ||
| + | use | ||
| + | check_command | ||
| + | max_check_attempts | ||
| + | contact_groups | ||
| + | } | ||
| + | |||
| + | define service { | ||
| + | service_description plop | ||
| + | use generic-service | ||
| + | host_name generic | ||
| + | check_command check_plop!80 | ||
| + | } | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ### Exemple conf host hostgroupe service | ||
| + | |||
| + | ~~~c | ||
| + | define host { | ||
| + | use | ||
| + | host_name | ||
| + | alias | ||
| + | address | ||
| + | hostgroups | ||
| + | } | ||
| + | |||
| + | define host { | ||
| + | use | ||
| + | host_name | ||
| + | alias | ||
| + | address | ||
| + | hostgroups | ||
| + | } | ||
| + | |||
| + | define service { | ||
| + | use | ||
| + | hostgroup_name | ||
| + | service_description | ||
| + | check_command | ||
| + | } | ||
| + | |||
| + | define service { | ||
| + | use | ||
| + | hostgroup_name | ||
| + | service_description | ||
| + | check_command | ||
| + | } | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ### Conf des hosts | ||
| + | |||
| + | ### Conf des services | ||
| + | |||
| + | '' | ||
| + | ~~~c | ||
| + | define service { | ||
| + | use generic-service | ||
| + | hostgroup linux-remotes-servers | ||
| + | service_description | ||
| + | max_check_attempts 3 ; Re-check the service up to 3 times in order to determine its final (hard) state | ||
| + | retry_check_interval 1 ; Re-check the service every minute until a hard state can be determined | ||
| + | check_command check_snmp_host!procs!400!900 | ||
| + | flap_detection_enabled 0 | ||
| + | } | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | Exclusion | ||
| + | |||
| + | ~~~c | ||
| + | define service { | ||
| + | service_description | ||
| + | servicegroups | ||
| + | use | ||
| + | hostgroup_name | ||
| + | host_name | ||
| + | check_command | ||
| + | } | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | |||
| + | |||
