Right now I run the program with cron and have that send success/failure
email, which I could certainly offload to monit via some mechanism (such as
log / drop file as you suggest) to allow monit to detect success / failure.

What I am trying to accomplish is not having crontab entries spread across
all of my machines.  Right now I am able to start/stop programs in monit
remotely from a single centralized crontab (hitting remote monit http port
via python script) and as the number of machines grows it is nice to have
only a single crontab to manage.  In addition, I can fire off that remote
script at any time via the monit web interface or from m/monit which isn't
possible if it is scheduled in cron.

I'd even be open to adding a mode to monit called "batch" (in addition to
"active", "passive" and "manual") that would allow a job to be run once
when start is clicked.



On Fri, Feb 26, 2016 at 12:35 PM, me mine <[email protected]> wrote:

> Hello, I saw your post and wanted to ask...
>
> Just curious what you are trying to monitor for. If you can run the
> program with cron, why not just have the script log an entry or create a
> drop file, then have monit monitor the file and give alert based on that?
>
> I guess I don't understand what end result you are achieving here.
>
>
> -jim
>
> > On Feb 26, 2016, at 1:28 PM, Marc Rossi <[email protected]> wrote:
> >
> > Is it possible to use monit to run a batch job that needs to run once a
> day?
> >
> > For example:
> >
> > check program my-program
> >     with path "/usr/local/bin/my-program.py"
> >     every "0 6 * * 1-5"
> >     if status != 0 then alert
> >
> > Would run this job only once a day @ 6:00 am M-F?  I know the docs say
> to not use a "specific minute" but I have my polling interval set to 20
> seconds using "set daemon 20" in my config file.
> >
> > Does this potentially run twice in a minute?  Say @ 6:00:00 and 6:00:20
> for example?
> >
> > TIA
> > Marc
> >
> > --
> > To unsubscribe:
> > https://lists.nongnu.org/mailman/listinfo/monit-general
>
>
>
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general
>
--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

Reply via email to