Monitor whenever Gem Cron Jobs with CronRabbit
RubyThe Problem
The whenever gem generates crontab entries for Rails tasks. But generated entries don't include any monitoring, so failures go undetected.
The Solution
Add CronRabbit pings to your whenever schedule definitions or inside the Rake tasks themselves.
Integration Options
Option 1: Add curl pings directly in your schedule.rb job commands. Option 2: Add monitoring inside the Rake task Ruby code. Option 2 is more robust.
Code Examples
schedule.rb with monitoring
Ruby# config/schedule.rb
every 1.day, at: '2:00 am' do
command "cd /app && bundle exec rake reports:daily && curl -fsS -m 10 --retry 5 --retry-all-errors https://ping.cronrabbit.com/your-id"
end