[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Monit and laptops
From: |
David Blank-Edelman |
Subject: |
Re: Monit and laptops |
Date: |
Sat, 10 Oct 2020 21:57:00 -0400 |
Hi Lutz-
Thanks for this snippet. I noticed you listed two separate hosts (macbook.and
macbookpro.local)., Was that significant or just a typo in the message?
I’m trying to make sure I understand the logic, though.
If I’m reading it right, it says
- if I can’t connect to the internal web server within 30 seconds of 3 cycles,
try to reload monit (which would reset the count?)
- if I tried to reload 3 times within 10 cycles, then stop trying
If that understanding is correct, how does it ever get out of the unmonitored
state again?
If you could say a bit more about why you did it this way, I’d really
appreciate it.
Sorry if this seems like very basic questions.
— dNb
> On Oct 7, 2020, at 4:58 PM, Lutz Mader <lutz.mader@freenet.de> wrote:
>
> Hello David,
> I use monit on a Macbook, this works well.
>
>> It seems like Monit would do just fine with a config that said “ping this
>> address and if you have N failures in time T (or cycles), cycle the
>> interface”. My only concern is how it might handle situations when the
>> laptop sleeps or partially sleeps (or wakes up and doesn’t have wifi for a
>> bit). I don’t think I’d want it to be flapping things in those cases.
>
> But you are right, a wake-up or a switch to a other wlan is a problem.
>
> I configure monitrc to use the Macbook hostname to bind to.
>
> use address macbook.local
>
> And monit monitor themselves, to bind to an interface after the wake-up.
>
> check host Monit with address macbookpro.local
> start program "/usr/local/bin/monit reload"
> if failed port 2812 with protocol https username "guest" password "guest"
> and request "/_ping" with status >= 200
> with ssl options {verify: disable, selfsigned: allow}
> with timeout 30 seconds for 3 cycles then start
> # if failed port 2812 with timeout 30 seconds for 3 cycles then start
> # else if recovered then alert
> if 3 restarts within 10 cycles then unmonitor
>
> With regards,
> Lutz
>