【问题标题】:SMPP check through MONIT通过 MONIT 进行 SMPP 检查
【发布时间】:2017-11-16 17:35:07
【问题描述】:

我是 linux 新手,我需要帮助来通过 MONIT 检查 kannel 的 SMPP 绑定是否在线或已死。 目前在一个名为 XYZ.sh 的脚本文件中使用 (curl --silent http://localhost:xyz/status?password=abc | grep SMPP| grep -v online) 并在 Monit 中编写如下:

check file XYZ with path /root/script/XYZ.sh if match "dead" after 5 cycles then alert 

它不起作用,请指导,因为我很不高兴。

【问题讨论】:

    标签: monit


    【解决方案1】:

    您使用了错误的检查。使用自定义脚本时,您应该使用 process 而不是 file

    process 也无法检查内容,因此您必须根据预期的行为返回不同的退出代码。因此,您必须更新脚本以根据您的期望返回退出代码

    check program XYZ with path /root/script/XYZ.sh if status != 0 for 5 cycles then alert
    

    文档:https://mmonit.com/monit/documentation/monit.html#Program

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-02-09
      • 1970-01-01
      相关资源
      最近更新 更多