我有这样的规则:
if memory usage > 85% for 10 cycles then alert
Run Code Online (Sandbox Code Playgroud)
我不仅想通过电子邮件通知,还想通过 slack 通知。所以我可以像这样添加第二行:
if memory usage > 85% for 10 cycles then exec /path/to/slack.rb
Run Code Online (Sandbox Code Playgroud)
当您有多个规则并且必须复制每一行时,这很烦人。可以一起使用alert和exec吗?像这样的东西:
if memory usage > 85% for 10 cycles then alert and exec /path/to/slack.rb
Run Code Online (Sandbox Code Playgroud) monit ×1