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.
check process program1
matching "program1"
start program = "/home/user/files/start.sh"
stop program = "/home/user/files/stop.sh"
Will it restart a crashed program now? And how can I assure it does not restart the program when it is working?
Edit: some more info The program uses port 30000 udp. Will this make it more cautious? And how many seconds are between the "cycles"?
if failed port 30000 type UDP for 3 cycles then restart
Read about execution
This is just example what you should execute program or script:
Based on
ConfigurationExamples