title: Monit restart program script
body: <p>I am fairly new to monit and I was wondering if this script is enough to restart a crashed program lets say program1 is the name of the program.</p>
  
  <pre><code>check process program1
  matching "program1"
  start program = "/home/user/files/start.sh"
  stop program = "/home/user/files/stop.sh"
  </code></pre>
  
  <p>Will it restart a crashed program now? And how can I assure it does not restart the program when it is working?</p>
  
  <p>Edit:
  some more info 
  The program uses port 30000 udp. Will this make it more cautious? And how many seconds are between the "cycles"?</p>
  
  <pre><code>if failed port 30000 type UDP for 3 cycles then restart
  </code></pre>