1

I use Monit to quick check uptime of Elasticsearch service.

Here is my configuration:

check host [Elasticsearch]-test with address 1.2.3.4
    if failed
        port 9200
        protocol http
    then exec "/alerting/monit2telegram/monit2telegram.sh"

It means: when monit cannot do a http request to port 9200, then receive a notification to telegram. It works perfectly when my elastic is down.

But when host is back to normal, how can i configure monit that push alert/exec to remind?

0

Here is the solution:

check host [Elasticsearch]-test with address 1.2.3.4
    if failed
        port 9200
        protocol http
    then exec "/alerting/monit2telegram/monit2telegram.sh"
    else if succeeded then exec /alerting/monit2telegram/monit2telegram.sh"

It will exec again, when host is back to normal.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.