0

I would like to use monit to monitor my DNS server. if BIND failed it should stop OSPFD.

i tried this but I get an error;

> check process named with pidfile /var/run/named/named.pid start
> program "/etc/init.d/named start" stop program  "/etc/init.d/named
> stop"
>         if status != 0 then stop program ospfd

the error is Error: syntax error 'status'

Abhijeet Kasurde
  • 985
  • 9
  • 20
  • Could you please paste whole script so that we can understand what is problem in script? Be more specific. – Abhijeet Kasurde Jun 24 '15 at 06:42
  • # BIND DNS check process named with pidfile /var/run/named/named.pid start program "/etc/init.d/named start" stop program "/etc/init.d/named stop" if STATUS != 0 then stop program ospfd # OSPF check process named with pidfile /var/run/ospfd.pid start program "/etc/init.d/ospfd start" stop program "/etc/init.d/ospfd stop" – Mahdi Adnan Jun 24 '15 at 06:53
  • If you could edit this into the question and indent with 4 spaces, it will display as a code block. I can't tell where the line breaks are meant to be in your comment. – shearn89 Jun 24 '15 at 12:07

1 Answers1

0

Am assuming you've already looked here.

Only watching the pid of a network service like named can be misleading. The purpose of the service is to answer network requests, so you should verify that the network port is listening and responding. If the monitor fails, you can then restart/stop ospfd via it's own init script.

Rick Buford
  • 166
  • 5