Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

If you want to run a cronjob inside the Checkmk site, please follow this short How-To


With crontab -l you will get an overview of all installed crontabs inside the Checkmk site

OMD[workshop]:~/etc/check_mk/multisite.d/wato$ crontab -l
#
# Do not edit this file. It will be recreated each time OMD
# is started or reloaded.
#
# execute 'omd reload crontab'
# to rebuild this file out of /omd/sites/workshop/etc/cron.d/*
#
# --ENVIRONMENT------------------------------------------------
SHELL=/bin/bash
BASH_ENV=/omd/sites/workshop/.profile
OMD_ROOT=/omd/sites/workshop
OMD_SITE=workshop
PATH=/omd/sites/workshop/local/bin:/omd/sites/workshop/bin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin
MAILTO=""
# ------------------------------------------------------------
# /omd/sites/workshop/etc/cron.d/cmk_bulk_notify
# Needed for bulk notifcations.
...
...
...
...


Step-by-step guide

  1. Option

    1. create a file below /omd/sites/mysite/etc/cron.d with your new cronjob, e.g. /omd/sites/mysite/etc/cron.d/myjob

      # My cronjob
      */5 * * * * $OMD_ROOT/local/myjob --params >/dev/null 2>&1


    2. execute 'omd reload crontab' to rebuild this file out of /omd/sites/workshop/etc/cron.d/*
  2. Option
    1. The second possibility is to create a systemwide cronjob below /etc/cron.d, e.g. /etc/cron.d/myjob. Note the slightly different syntax: the 6th columnn (after the time settings) requires the user under which this cronjob is executed. Also, the environment variables $OMD_ROOT and such are not available (unless you set them explicitely in this file):


Filter by label

There are no items with the selected labels at this time.

  • No labels