SMPP通过MONIT检查

时间:2017-11-16 17:35:07

标签: monit

我是linux的新手,我需要帮助通过MONIT检查SMPP绑定kannel是否在线或死亡。 目前在一个名为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 

它不起作用,请指导,因为我非常沮丧。

1 个答案:

答案 0 :(得分:0)

您使用了错误的支票。使用自定义脚本时,您应该使用进程而不是文件

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

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

相关问题