Skip to content

Latest commit

 

History

History
53 lines (32 loc) · 1.68 KB

README.md

File metadata and controls

53 lines (32 loc) · 1.68 KB

Cron Monitor - First Phase

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

TODO

Integrations - Slack, HipChat

Configuration

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

Testing

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

Getting Started

bundle install
bundle exec foreman start

Extras

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

Credits

The sinatra template has been adapted from Nick Plante.