Go to All Forums

Auto CRON monitor creation


We like the CRON monitor but have found the process of adding 100's of them manually to be time consuming.

It would be good if there was either an API to create them which we could call on first setup, or maybe if they auto created on the first push?

Is a feature like this planned?



Like (1) Reply
Replies (1)


Please find the API to create a cron monitor in the Site24x7 web client:

curl -X POST -H 'Authorization: Zoho-authtoken <authtoken>' -H "Content-Type: application/json;charset=UTF-8" 'https://www.site24x7.com/api/monitors' -d '{"type" : "CRON", "display_name" : "name" , "cron_expression" : "* * * * *", "wait_time" : 30,    "cron_tz" : "Asia/Kolkata", "threshold_profile_id" : <threshold_profile_id>, "user_group_ids" : <user_group_ids>}'

Once the monitor is created successfully, add the ping URL before and after the command to be executed in the cron.

* * * * *  curl -m 10 https://plus.site24x7.com/cron/<apikey>/<display_name>/start; COMMAND curl -m 10 https://plus.site24x7.com/cron/<apikey>/<display_name>/end;

Using a script to auto-detect and add a cron monitor

Please follow the steps below:

  1. Download the attached zip folder and place it in the location of your choice.
  2. In the config.cfg file, fill in the required configurations like the authtoken, API key, name of the cron monitor, cron expressions, wait time, time zone in which the cron expression has to be validated.
  3. By default, the /etc/crontab file for the current logged in user will be auto-detected and a monitor will be created for every cron entry in the Site24x7 web client.
  4. This will generate a file, crondata, in the folder where the attached zip file has been unzipped and placed.
  5. Replace the /etc/crontab file with the content of the crondata file to ensure proper monitoring of the cron monitors in the Site24x7 web client and an alert is triggered when there is a threshold breach.

Let us know your feedback on using the script to auto-detect and add a cron monitor. For further queries, comment in the below thread.

Happy Monitoring!

Size: 2.77 KB
Like (0) Reply

Was this post helpful?