These are great sugestions and have worked like that in the past using
the MAILTO env var in crond.
I didn't think of the Alarm() (I don't know if I can do that in php, I
will read the php docs)

The problem I see with MAILTO or having cron send the emails, is that
if I have a "minutly" cron, and it fails (due to a permission problem
or server down or what not), the I end up with tons of emails.
That is why I thought monit or something of the sort to alert me
intelligently ...

I feel like for as long as I've been programming for the web (over 10
years now), this has been a recurring need (monitoring
offline/asyncron tasks), that my first reaction is: "There must be
some package out there that does exactly what I'm looking for" (Or
maybe it's the manager in me talking)



(Hey Vlad, long time no speak, hope all is good)

On Tue, Nov 24, 2009 at 3:38 PM, Vladislav Tchernev <[email protected]> wrote:
> Set "[email protected]" in the begging of your /etc/crontab.
> Unless your script/app is sending the standard output and error
> somewhere else you will get a mail from corn after each job execution.
> You could also check for the exit code of each job and send a mail if
> it indicates an error.
>
> Cheers
> Vlad
>
> On Tue, Nov 24, 2009 at 2:45 PM, Sherif Zaroubi <[email protected]> wrote:
>> Hello Everyone,
>>     I have a problem ( I love starting emails like this ;) ) ....
>>     I have a system with over 100 cronjobs (some of which are legacy,
>> iow I can modify the code but it might be time consuming).
>>
>>     I need to monitor these jobs, by monitor I mean:
>>     - Failed to execute (Cron was supposed to run but didn't)
>>     - Failed in it's execution (Cron job reported errors)
>>     - Execution took too long (Cron job took more than x% of time than 
>> normal)
>>
>>    The monitoring should not over send msgs (I remember the time
>> where I went on vacation for 2 weeks, and a 3rd party provider fell to
>> it's knees .... long story short ... outlook crashed )
>>
>>     Here is what I am thinking of:
>>
>>     (Cron) --[executes job]---> (Job specific log file) ---- (nagios
>> or other monitoring too, analyse time stamp and content of logfile)
>> -----> sends email with warnings, errors and all .
>>
>>
>>     It sounds a bit duct tape, (cause I gotta start monitoring my
>> nagios and all). I have googled and checked freshmeat.net for
>> opensource "all in one" solutions. (All in one == schedule and
>> monitor).
>>     I was wondering, how do you solve this issue.
>>
>>
>> --
>> Sherif Zaroubi
>> szaroubi |at| gmail |dot| com
>> _______________________________________________
>> mlug mailing list
>> [email protected]
>> https://listes.koumbit.net/cgi-bin/mailman/listinfo/mlug-listserv.mlug.ca
>>
> _______________________________________________
> mlug mailing list
> [email protected]
> https://listes.koumbit.net/cgi-bin/mailman/listinfo/mlug-listserv.mlug.ca
>



-- 
Sherif Zaroubi
szaroubi |at| gmail |dot| com
_______________________________________________
mlug mailing list
[email protected]
https://listes.koumbit.net/cgi-bin/mailman/listinfo/mlug-listserv.mlug.ca

Reply via email to