質問

I love the site. It's a good place to look for answers. Thanks for that.

I am wrestling with a feature of munin on a test server. It runs lighttpd, mysql, ssh, proftpd, postfix and dovecot.

If one of them fails, I would like to receive a text message next to the 'default' email. I have got an SMS gateway in use, with VoipBuster. If I request an url (as stated below) I will receive a text message. https://www.voipbuster.com/myaccount/sendsms.php?username=xxxxxx&password=xxxxxx&from=xxxxxx&to=xxxxxx&text=xxxxxx

I have tried including this in my monit config, but I just can't get it to work.

Here's what I tried. Including a 'if failed then' under every check, like this:

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!)

But I keep getting errors like this when I am restarting.

/etc/monit/monitrc:194: Error: syntax error 'EMAIL'

I tried moving around with the 'if failed then' clause, but I literally don't know how to solve this anymore.

役に立ちましたか?

解決

Thanks for the possible solutions. I ended up using Pushover, which is an app for mobile phones. With his app you can send an email to a specific email address (built-in feature in Monit) and get push notifications on your mobile.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top