我喜歡這個網站。這是一個尋找答案的好地方。感謝那。Monit在檢查失敗時打開URL
我與穆寧的測試服務器上的功能摔跤。 它運行lighttpd,mysql,ssh,proftpd,postfix和dovecot。
如果其中一個出現故障,我想收到旁邊的「默認」的電子郵件文本消息。 VoipBuster使用了一個SMS網關。如果我請求一個網址(如下所述),我會收到一條短信。 https://www.voipbuster.com/myaccount/sendsms.php?username=xxxxxx&password=xxxxxx&from=xxxxxx&to=xxxxxx&text=xxxxxx
我已經試過在我的監視配置中包括這個,但我不能讓它工作。
這是我的嘗試。 包括每個檢查下,「如果再失敗」,像這樣:
check process lighttpd with pidfile /var/run/lighttpd.pid
group lighttpd
start program = "/etc/init.d/lighttpd start"
stop program = "/etc/init.d/lighttpd stop"
if failed host 178.21.118.206 port 80
protocol http then restart
if 5 restarts within 5 cycles then timeout
if failed then (url https://www.voipbuster.com/myaccount/sendsms.php?username=xxxxxx&password=xxxxxx&from=xxxxxx&to=xxxxxx&text=CHECK EMAIL -- SERVER ERRORS!)
但我不斷收到這樣的錯誤,當我重新啓動。
/etc/monit/monitrc:194: Error: syntax error 'EMAIL'
我試圖與「如果失敗,那麼」條款走動,但我真的不知道怎麼了解決此問題。
用%20工作替換空間嗎?例如...&文本= CHECK%20EMAIL%20 - %20SERVER%20ERRORS! – chawarong