A basic Sinatra app to monitor crons. Alerts you if a cron has started and not ended or if a cron has not started within the specified time.
All you need to do is curl a url before and after a cron runs
Before cron - http://localhost:5000/ping?name=cron_name&et=approx_time_taken_to_run&pf=time_between_2_runs&status=start
After cron - http://localhost:5000/ping?name=cron_name&et=approx_time_complete_run&status=compelte
Integrations - Slack, HipChat
Dependencies and all configuration is done in environment.rb. Your database is also set up here. DataMapper will use mysql by default in this app. Tests use the sqlite3-memory adapter (no configuration needed).
Add your controller actions in application.rb. Views for these actions are placed in the views directory. Static files, including a stock stylesheet, go in the public directory. Models go in the lib directory and are auto-loaded.
Environment variables that you want to expose to your application can be added in .env
It needs proper specs
Add your specs in spec; just require spec_helper.rb to pre-configure the test environment. A number of samples are provided (including a sample model, which can be removed). To run the specs:
bundle exec rake spec
bundle install
bundle exec foreman start
We've included a handy console script that fires up irb with your environment loaded. To load it, use the Rake task:
bundle exec rake console
The sinatra template has been adapted from Nick Plante.