Integrations

Last updated: Oct 14, 2017

Overview

Integrations are what drives the CronAlarm alerting system. We currently offer 3 types of integrations: email, webhooks, and Slack integrations. Webhooks and Slack integrations are only available on the Professional and Enterprise plans.

You configure each type of integration as best fits your needs. Then, when defining your jobs in CronAlarm, you specify how you would like to be alerted in the event of failures and/or errors by linking specific integrations to the job. Some jobs you may just want to send an email, others you may want to send several emails, while others still you may want to inititiate a webhook and be alerted in your team's Slack channel.

To clarify the difference between integrations and alerts: integrations are various ways you configure to be notified and alerts are the specific integrations you link to specific jobs.

Email

Plain ol' email. Email is also the default notification method used by CronAlarm. You do not have to configure any integrations or link any specific integration to a job to be notified. If there are no alerts for a specific job when an error is detected, an email will be sent to the default email account used to create your CronAlarm account.

When first adding an email address, CronAlarm will send a confirmation email to that address to confirm they wish to receive alerts from CronAlarm. You can proceed to link unconfirmed addresses to jobs, but alerts will not be actually sent to addresses that have not confirmed they want to receive emails from CronAlarm.

While there is no limit to the number of email addresses you can add to CronAlarm, we highly recommend, if possible, to configure groups via your email provider and only add the group email address to CronAlarm. This will make things much easier on you if/when you need to update who should be receiving alerts for specific jobs.

Slack

Slack integrations are awesome! And prior to CronAlarm offering Slack integrations it was our most requested feature. So many teams rely on Slack for team communications, and being able to receive CronAlarm alerts and view vital statistics and information from the same tool is super nice.

Initial Setup

The setup for Slack integrations is a little more involved than the others, but it's still really easy.

  1. On the Slack Integrations page, click the 'Add To Slack' button. This will take you to the slack.com website where you can choose what team and channel you would like CronAlarm to send messages to.
  2. After making your selections, you will then be redirected back to CronAlarm where you should see your new Slack integration listed. It is now available to be used for alerts and can be linked to any job.
  3. Repeat this process for any additional team/channel you want to use to receive alerts from CronAlarm.

Once setup and linked to jobs, you'll automatically receive messages inside Slack whenever any runtime or MIA error is detected.

Slash Commands

Slash commands are simply regular Slack messages that being with `/cronalarm' (note the slash (/) at the beginning). So, not only can you receive alerts in Slack, but you can use slash commands to interact directly with CronAlarm to view important information.

For example, want to view any cron job that is currently running? Then just type /cronalarm running. How about any job currently in an error status? Then /cronalarm error is what you need. In fact, you can run a slash command for any status code used by CronAlarm.

Here is a complete list of available slash commands:

  • /cronalarm running - List all jobs currently running
  • /cronalarm success - List all jobs that have run on time and completed successfully
  • /cronalarm error - List all jobs that are currently in an error state
  • /cronalarm mia - List all jobs that have not checked in at their expected time
  • /cronalarm paused - List all jobs that have never checked in to CronAlarm.
  • /cronalarm status - View the total number of jobs in each status.
  • /cronalarm help - View all available commands.

Webhooks

Webhooks can be used to integrate with your own logging/report system, restarting the job, etc. If a webhook integration is linked to a job when an error is detected, CronAlarm will perform a POST request to the webhook endpoint with a JSON object. Depending on the type of error we detect, the JSON will look like the following:

MIA Error

{
  status: 'MIA',
  application: 'The parent application name',
  job: 'The name of the job',
  lastRunDateUTC: 'UTC date when the job was last seen',
  lastRunTimeUTC: 'UTC time when the job was last seen',
  interval: 'The interval the job should be executed'
}

Execution Error

{
  status: 'Error',
  API: 'Either "simple" or "advanced"',
  application: 'The parent application name',
  job: 'The name of the job',
  startDateUTC: 'UTC date when the job was last seen',
  startTimeUTC: 'UTC time when the job was last seen',
  server: 'Server name submitted via advanced API, or blank',
  path: 'File path submitted via advanced API, or blank',
  duration: 'Execution time (seconds)',
  userMessage: 'Message submitted via advanced API, or blank',
  cronAlarmMessage: 'Message generated by CronAlarm'
}