Skip to content

Instantly share code, notes, and snippets.

@eksiscloud
Created April 22, 2020 18:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eksiscloud/1f8aa21632d75bb5dd81f463d63b8f91 to your computer and use it in GitHub Desktop.
Save eksiscloud/1f8aa21632d75bb5dd81f463d63b8f91 to your computer and use it in GitHub Desktop.
Monit: Cron
check process crond with pidfile /var/run/crond.pid
group system
group crond
start program = "/etc/init.d/cron start"
stop program = "/etc/init.d/cron stop"
if 5 restarts with 5 cycles then timeout
depend cron_bin
depend cron_rc
depend cron_spool
check file cron_bin with path /usr/sbin/cron
group crond
include /etc/monit/templates/rootbin
check file cron_rc with path "/etc/init.d/cron"
group crond
include /etc/monit/templates/rootbin
check directory cron_spool with path /var/spool/cron/crontabs
group crond
if failed permission 1730 then unmonitor
if failed uid root then unmonitor
if failed gid crontab then unmonitor
@eksiscloud
Copy link
Author

You should monitor cron because a leaking PHP-script started by cron or too slow script can eat up all of your RAM quite fast.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment