monit-general
[Top][All Lists]
Advanced

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

RE: Monit Check Syntax


From: Leif Gustafson
Subject: RE: Monit Check Syntax
Date: Tue, 18 Dec 2012 16:24:19 -0900

Hello,
  One downside is that you will only get a problem alert on the next check
of this program (so, 15 minutes "late" in your case).  This is because monit
does not check the exit code of the previous execution until the next
execution *of the particular test*.  I ended up writing a wrapper to get
around this problem.  The wrapper creates a lockfile with a future mtime and
does not execute the program until that time has been reached, and will
terminate with an exit code of 0 in the meantime .  Then, the wrapper is
called each cycle.  This kind of solution means you will get an alert the
minute after the failure (assuming cycle of 60) followed by another
"success" alert the following minute.  Not ideal, but it means you get your
alerts closer to the time of the event.

Leif

-----Original Message-----
From: address@hidden
[mailto:address@hidden On
Behalf Of Christina Arsenault
Sent: Tuesday, December 18, 2012 10:06 AM
To: address@hidden
Subject: Re: Monit Check Syntax

Martin,



Thanks for your help, it was user error! ;)  I just needed to add
#!/usr/bin/python to the top of the script, so I could leave out the
"/usr/bin/python" at the beginning of the path:

ie:

check program movie_creation with path
"/home/carsenault/hlcam/videos/monit_movie_creation_test.py" with timeout 60
seconds every 15 cycles
       if status != 0 then alert



Appreciate it!

~Christina






  ------------------------------

Message: 5
Date: Tue, 18 Dec 2012 17:35:38 +0100
From: Martin Pala<address@hidden>
To: This is the general mailing list for monit
        <address@hidden>
Subject: Re: Monit Check Syntax
Message-ID:<address@hidden>
Content-Type: text/plain; charset=us-ascii

Hi,

the configuration looks OK ... what the problem is? (please provide the
error messages or describe the expected behaviour vs. reality).

If you use the "every <x> cycles" option, the cycle length is set with the
global "set daemon <y>" => if you want to run it once per 15 minutes, with
that configuration the "set daemon 60" should approximately do the trick.

Note that monit scheduler  currently isn't wall-clock based ... the cycle
length is variable (based on number of tests and timeouts ... the "set
daemon" sets the sleep interval between cycles => even with 15 * 60 it won't
be exactly 15 minutes as the time consumed by the cycle itself is not
included. We will fix this in the future - the monit scheduler will allow
the run the tests at exact time.

Regards,
Martin


On Dec 18, 2012, at 5:28 PM, Christina Arsenault<address@hidden>
wrote:

> Hello Everyone,
>
>
>
> I am trying to kick off a python script to run once every 15 minutes and
to timeout if it takes more than 60 seconds to run.  I think maybe I'm doing
the wrong kind of "check", here is my attempt.
>
> check program movie_creation with path "/usr/bin/python
/home/carsenault/hlcam/videos/monit_movie_creation_test.py" with timeout 60
seconds every 15 cycles
>        if status != 0 then alert
>
>
> Thanks in advance for your help!
>
> Christina Arsenault
>
>
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general



------------------------------

_______________________________________________
monit-general mailing list


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




reply via email to

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