Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Oct 2020 09:09:21 +1100
From:      Dewayne Geraghty <dewayne@heuristicsystems.com.au>
To:        freebsd-questions@freebsd.org, Jerry <jerry@seibercom.net>
Subject:   Re: Monitor an app
Message-ID:  <69ec859f-163d-2908-7e34-bc3d1c8d3381@heuristicsystems.com.au>
In-Reply-To: <20201002075125.000001d6@seibercom.net>
References:  <65C3BE67-3389-4F8E-9975-7EC0714FB056@kreme.com> <20201002075125.000001d6@seibercom.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2/10/2020 9:51 pm, Jerry wrote:
> On Fri, 2 Oct 2020 04:59:59 -0600, @lbutlr commented:
>> Are there any tools that monitor apps or services and do sane things
>> to make sure that the series are running?
>>
>> Obviously, I can write a simple script that says something like "if
>> service <name> status doesn't have a PID, then …" but that's
>> simplistic and I don't want something that is simply going to restart
>> a failed service over and over every time it crashes. (But once or
>> twice when it crashes is good, with an escalation to maybe restart a
>> different series and a fall back from that to restart the machine… but
>> again, not restarting the machine a few seconds after boot because it
>> can't start the service.)
>>
>> I am not looking for something that says "hey, email is not working"
>> (I already have that but more subtly like "Hey, dovecot isn't running"
>> or "MySQL isn't running".
>>
>> Googling leads me to external monitoring of forward facing services
>> based on port scanning, I'm looking for something local to the machine.
> 
> Have you considered "/sysutils/monit" or one of its cousins? It might
> do what you want. It an be configured to limit the number of times it
> will attempt to restart a program, and lots of other things too.
> 
I've used monit for a few years and its VERY helpful.  Though, for the
reason that you reference managing applications via PID, I've also
incorporated s6 and s6-rc to manage services (and hence eliminate
reliance upon a PID).  monit is very easy to learn and should do most of
what you want, s6 and friends have a steep learning curve. (If you
choose the latter, the gentoo website has an excellent guideline)

Cheers.
PS port scanning is like penetration testing - last resort for technical
folks, yet often mandated by management ;)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69ec859f-163d-2908-7e34-bc3d1c8d3381>