使用 monit 是否可能发生这样的事情:
check process foo with bar
check process foo2 with bar2
start program = "baz start"
stop program = "baz stop"
基本上,我正在寻找“或”条件。
答案1
它并不完全是您要求的“或”条件,但请看一下check process <name> matching <regex>
语法。
CHECK PROCESS <unique name> MATCHING <regex>
<regex> is alternative process specification using pattern matching
to process name (command line) from process table instead of pidfile.
例子:
check process foo_foo2 matching "foo_name|foo2_name"
start program = "baz start"
stop program = "baz stop"