About Linux FAQ

Browse More FAQs:

Monit: Monitor BIND 9 (named) Name Server and Auto Restart SSH If It Does Not Respond

Posted by Vivek Gite [Last updated: July 11, 2008]

This FAQ is part 3 of 3 in the series Linux Server Monitor

Q. How do I monitor my BIND 9 (named) server with monit which is chrooted at /var/lib/named directory? How do I restart bind (named) server if it does not respond or dead due to any issues under Debian / Ubuntu Linux?

A. You can easily restart or send alert when bind9 is not responding under Debian / Ubuntu or UNIX like operating system using monit.

Restart named (bind9) if does not respond to port 53

Open monitrc file, enter:
# vi /etc/monit/monitrc
Append following code, enter:

## bind
check process named with pidfile /var/lib/named/var/run/bind/run/named.pid
 start program = "/etc/init.d/bind9 start"
 stop program = "/etc/init.d/bind9 stop"
 if failed host 127.0.0.1 port 53 type tcp protocol dns then restart
 if failed host 127.0.0.1 port 53 type udp protocol dns then restart
 if 5 restarts within 5 cycles then timeout

A note about RHEL / CentOS / Red Hat / Fedora Linux

You need following code for RHEL, enter:

## bind
check process named with pidfile /var/named/chroot/var/run/named/named.pid
 start program = "/etc/init.d/named start"
 stop program = "/etc/init.d/named stop"
 if failed host 127.0.0.1 port 53 type tcp protocol dns then restart
 if failed host 127.0.0.1 port 53 type udp protocol dns then restart
 if 5 restarts within 5 cycles then timeout

Save and close the file. Restart monit, enter:
# /etc/init.d/monit restart

Navigation for Linux Server Monitor«Monit: Monitor SSHD Server and Auto Restart SSH If It Does Not Respond

E-mail this to a friend      Printable version

Related Other Helpful FAQs:

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Tags: , , , , , , , , , , , ,

Copyright © 2006-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.