0

How can Monit be used to monitor a simple script that creates no PID file and is running in the background within a detached screen session?

titel
  • 111
  • 1
  • 8

1 Answers1

0

See Documentation regarding CHECK PROCESS. It's as simple as

CHECK PROCESS myProcName MATCHING "my_detached_script.sh"

It checks for Processes containing "my_detached_script.sh" (note: It's a regex. So it also matches "my_detached_script-sh" and so on). It can be any valid regex. You might want to check your regex with monit procmatch '<YourRegexHere>' to match your needs.

boppy
  • 476
  • 2
  • 5