16_DNS
Sur Nagios
on va faire deux check, premier check :
/usr/local/nagios/libexec/check_dns -H 192.168.200.11 -s ns1.rohba.local
DNS OK: 0,021 secondes de temps de réponse . 192.168.200.11 returns ns1.rohba.local.|time=0,021006s;;;0,000000
deuxième check :
/usr/local/nagios/libexec/check_dig -l rohba.local
DNS WARNING - 0,016 seconds response time (dig à renvoyé un état d'erreur)|time=0,015702s;;;0,000000
du coup pour le fichier commande commands.cfg
define command{
command_name check_dns
command_line /usr/local/nagios/libexec/check_dns -H $HOSTADDRESS$
}
define command{
command_name check_dig
command_line /usr/local/nagios/libexec/check_dig -l $HOSTADDRESS$
}
dans le fichier host.cfg
define service{
use generic-service
host_name bind
service_description DNS - check_dns
check_command check_dns!
}
define service{
use generic-service
host_name bind
service_description Bind - Service Status
check_command check_bind
}