What is the approach to the control of cron are You using?

0 like 0 dislike
5 views
On our projects, there are dozens of periodic tasks result in a need to control.


The easiest way is to infer the execution result of the Krona to the console and get it all on soap. In this day have read a ton of emails, and it does not guarantee that is found crowns that fell off and ceased to run.


The current vision of the solution — placing reversed in the database of the results of its work and the conclusion of these results in the graphs munin, zabbix, nagios seems to be very time consuming.


How do you do that?
by | 5 views

4 Answers

0 like 0 dislike
hmm, usually add to the script that runs the cron, the test completed successfully, if successful, keep quiet, else the notification on soap. Or you just failed tons?
by
0 like 0 dislike
implemented (in a team estesstvenno) large social network, a lot of CZK tasks. Many scripts must be constantly spinning (I guess you could call them demons, but run for the crown).
Had to develop a system of deployment and management tasks/scripts (tasks spinning on different servers).
The basic principles are as follows:
All cron tasks are heirs from the base class.
All cron tasks are run from a single script (wrapper) run.
Crowns each task has a pid file ( in case that does not start at the same time two identical tasks )
If you want to run simultaneously two of the same script, then in this case the pid file had the extension
for example crontask.1.pid crontask.2.pid
Every cron script to a centralized DB ( Soi network organized sharding, all data are divided into shards ) sent data: start time run end time run, how many made (a kind of measure, for example number of processed items in the queue)
\r
there were two script analysis.
the first script monitors the current data in the database, compared them with a template (what should be) and gave Nagios 0 1 2
sysadmin for Nagios if they saw something wrong, then run the monitoring table scripts and observed data on scripts which when and how did
\r
here's a layered cake
by
0 like 0 dislike
IMHO the script should be silent if everything is good and informative to swear, if something is wrong. Sootvetvenno the soap comes information if you need a che-thread.
Regular infa resets in BD for statistics, graphs and other things in the admin area.
by
0 like 0 dislike
At one time I wrote in Python a crutch to send stdout via XMPP. Was done on some blog (almost habru) turned out ~ fifty rows all in all.
\r
If messages are too many, then you can immediately send only critical, the rest collect in the likeness of the digests and to send every hour or two.
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
asked Apr 12, 2019 by vdm_mar
110,608 questions
257,186 answers
0 comments
28,804 users