I'm trying to monitor my pdns instance with monit. Main reason is I've been having some trouble with the pipe backend: it stops resolving requests after a few days (even when using the pdns guardian option).<div>
<br>
</div><div><div>The official monit documentation says to do this for DNS:</div><div><br></div><div><div> if failed host 127.0.0.1 port 53 type tcp protocol dns then restart</div><div> if failed host 127.0.0.1 port 53 type udp protocol dns then restart</div>
</div><div><br></div><div>But it seems powerdns does not like the "protocol dns" option and monit fails to connect to powerdns and eventually kills it.</div><div><br></div><div>I tried to find more information and found this: Monit's check for DNS protocol was to query for the hint.zone (".") and if the name server you try to monitor does not allow recursive queries from the monitoring host the check fails.</div>
<div><br></div><div>I added allow-recursion=127.0.0.1 to my pdns.conf file but that didn't seem to help.</div><div><br></div><div>Any ideas what I'm missing?</div><div><br></div><div><br></div></div><div>As a side note, my current monit config is:</div>
<div><br></div><div><div>check process powerdns with pidfile /var/run/pdns.pid</div><div> start program = "/etc/init.d/pdns start"</div><div> stop program = "/etc/init.d/pdns stop"</div><div> check program host with path "/usr/local/bin/check_host.sh"</div>
<div> if status != 0 then restart</div><div> if 5 restarts within 5 cycles then timeout</div><div><br></div><div>The check_host.sh script has:</div></div><div><div>#!/bin/sh</div><div>/usr/bin/dig @<a href="http://127.0.0.1">127.0.0.1</a> random$RANDOM-host$RANDOM.com</div>
</div><div><br></div><div>This works but seems a bit of a hack. </div><div><br></div><div>Roman</div>