2

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?

Hieu Huynh
  • 239
  • 1
  • 8

1 Answers1

1

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.

Vlastimil Burián
  • 27,586
  • 56
  • 179
  • 309
Hieu Huynh
  • 239
  • 1
  • 8