2013-07-29 52 views
0

我喜歡這個網站。這是一個尋找答案的好地方。感謝那。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' 

我試圖與「如果失敗,那麼」條款走動,但我真的不知道怎麼了解決此問題。

+0

用%20工作替換空間嗎?例如...&文本= CHECK%20EMAIL%20 - %20SERVER%20ERRORS! – chawarong

回答

0

感謝您的可能解決方案。 我最終使用Pushover,這是一款手機應用程序。 使用他的應用程序,您可以發送電子郵件到特定的電子郵件地址(Monit中的內置功能),並在您的手機上收到推送通知。

+0

使用Pushover一段時間後,我發現了Pushbullet,它提供了更多的平臺。所以人們也可以檢查出來 – Thom