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'

  • 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 6: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 6: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
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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.