tech:notes_supervision_nagios
Ceci est une ancienne révision du document !
Table des matières
Notes supervision Nagios
Voir Zabbix
Voir :
Voir aussi :
- Icinga
- Shinken
Administration
Effacer l'historique des données remontées par les sondes Nagios
/etc/init.d/nagios stop rm /usr/local/nagios/var/retention.dat rm /usr/local/nagios/var/objects.cache /etc/init.d/nagios start
A la place de systématiquement effacer ces fichiers avant de démarrer Nagios il est possible de changer :
nagios.cfg
#retain_state_information=1 retain_state_information=0
Configuration
Voir aussi :
Exemple de conf
Exemple avec check_snmp_mem_cpu.sh
/usr/local/nagios/etc/objects/servers.cfg
define service{ service_description Memory hostgroup_name WEB_APP1 check_command check_snmp_mem_cpu!mem!80!90 max_check_attempts 1 normal_check_interval 1 retry_check_interval 1 check_period 24x7 notification_interval 2000 notification_period 24x7 notification_options w,c,r contact_groups support #event_handler trigger_memory }
/usr/local/nagios/etc/objects/commands.cfg
define command{ command_name check_snmp_mem_cpu command_line $USER1$/check_snmp_mem.sh -H $HOSTADDRESS$ -t $ARG1$ -w $ARG2$ -c $ARG3$ }
Supervision de services sans hôte réel associé
Voir :
Voir aussi :
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
define host{ host_name generic use generic-host check_command check_dummy!0 # Revoit toujours OK max_check_attempts 1 contact_groups admins } define service{ service_description plop use generic-service host_name generic check_command check_plop!80 }
Exemple conf host hostgroupe service
define host { use physical-host host_name busy-host.example.com alias busy-host.example.com address 10.43.16.1 hostgroups linux,centos,ldap,http,busy } define host { use physical-host host_name normal-host.example.com alias narmal-host.example.com address 10.43.1.1 hostgroups linux,centos,dns,proxy,ldap,hp,http,puppetmaster } define service { use generic-service hostgroup_name linux,!busy service_description Load check_command check_snmp_load } define service { use generic-service hostgroup_name busy service_description Load check_command check_snmp_load_busy }
Conf des hosts
Conf des services
etc/objects/servers.cfg
define service{ use generic-service hostgroup linux-remotes-servers service_description Total Processes 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
define service{ service_description CPU Stats servicegroups sysres use generic hostgroup_name linux host_name !server1 check_command check_iostat }
Conf command
Dummy commands.cfg
# 'check_dummy' command definition # NOTE: This command always returns an 'OK' result no matter what. define command{ command_name check_dummy command_line $USER1$/check_dummy 0 }
tech/notes_supervision_nagios.1768400920.txt.gz · Dernière modification : de Jean-Baptiste
