monit-general
[Top][All Lists]
Advanced

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

Re: How to stop a process permanent


From: Russell Simpkins
Subject: Re: How to stop a process permanent
Date: Mon, 16 May 2016 10:34:44 -0400

Lutz,

It sounds like you should look at your start scripts and make them a bit more resilient, such that they handle a start when the process is already running and then remove any "un-monitor after failure" logic from your monit config. 

If the "start" process throws failures, monit will give up and not monitor the process (iirc.) If you configure it to umonitor after N failures, it will become unmonitored.

I like to use pid files e.g.

check process httpd with pidfile /var/run/httpd/httpd.pid
      start program = "/etc/init.d/httpd start"
      stop program = "/etc/init.d/httpd stop"

If I manually restart apache, monit's cool with that. My start stop scripts handle different scenarios. If you can't control the start/stop scripts, you could also create a script to better handle start/stops for monit to use. I have this one program that becomes unresponsive and hangs requests, so a PID check isn't sufficient. For that I have a bash script that tests the service using CURL with a timeout. Here is what that looks like 

check program badactor-responsive with path "/var/actor/bin/check-actor.sh 7002" with timeout 3 seconds
    if status != 0 then start
    start program "/etc/init.d/actor start 7002" with timeout 10 seconds

I discovered this site with a bunch of monitoring plugins you might find useful: 

https://www.monitoring-plugins.org/doc/man/index.html

Russ

On Mon, May 16, 2016 at 7:12 AM, Lutz Mader <address@hidden> wrote:
Hi all folks,
I start using monit some months ago and got a problem all the time a
"Process" or "Program" was stopped via monit and became "Not monitored"
(the process was gone), but started by someone else manually later
(started outside from monit).

This is sometimes a problem, because independent of a process is running
or stopped, monit gives the information "Not monitored" all the time and
there is no way to stop this "Zombie“ via monit.
The service monitoring mode is active all the, this is the default.

My question, how to stop a process via monit permanently.
How to identify such a manually startet process and how to get the right
state for this processes.

Today my understanding of "Not monitored" is, monit ignore the "Process"
or "Program" (the "status" and "monitoring status" is set to "Not
monitored"),
but this is not something like a "Stopped" status.

Any suggestion how to handle this,
Lutz

p.s.
I start using monit in january this year with some AIX, Linux systems to
migrate the application startup, stopping and monitoring to a more
useful tool.
In the past we, I use lots of application specific start, stop, monitor
scripts, but this doesn't fit my understanding of the way how to do this.

I start using monit to get a useful tool to do all the systems
housekeeping in a easy way with a uniform interface to handle all the
actions.

--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general


reply via email to

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