monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: use curl to check if api is down or up


From: Mike D
Subject: Re: use curl to check if api is down or up
Date: Sun, 26 Jun 2022 07:08:34 -0500

Actually you'd want to change the 502 in this to 200. Any response code that comes back that is not 200, would execute whatever you stick into "then."

On Sat, Jun 25, 2022 at 9:32 PM Mike D <ekimdunaway@gmail.com> wrote:
I believe you could do something like this:

 check host mmonit.com with address mmonit.com
       if failed
          port 80 protocol http and request "/location/of/whatever" method GET status = 502
       then restart

On Sat, Jun 25, 2022 at 7:25 PM Anthony Ettinger <ettinger@gmail.com> wrote:
I want to use monit and curl so that curl would hit and api and check if its up, if it gets a 502 or similar error then restart the systemd service.

How would I do this?

--
Anthony
408-656-2473

reply via email to

[Prev in Thread] Current Thread [Next in Thread]