Get the HTTP status of a bunch of URLs in a single JSON response. Ideal for monitoring a lot of services at once.
$ curl -X GET 'http://localhost:9292?google=http://www.google.com.br&bing=http://www.bing.com'
{
"google": "200",
"bing": "200"
}
This app can be very useful for healthchecking multiple applications at the same time.
The app is also easily deployable on heroku on any other service of your preference.
One app that uses Sickbay for healthchecking is The Nurse click here for more info.
You can check the app at https://sickbay.herokuapp.com
Acessing:
https://sickbay.herokuapp.com/?google=http://www.google.com&bing=http://www.bing.com
For instance should return you the statuses of Google and Bing.
Assuming you have a proper Ruby workspace setted up, just run:
$ git clone http://github.com/IgorMarques/sickbay
$ cd sickbay
$ bundle install
Since this is a sinatra app, you just need to run:
$ rackup
The output should be something similar to:
[2016-11-22 20:10:13] INFO WEBrick 1.3.1
[2016-11-22 20:10:13] INFO ruby 2.3.0 (2015-12-25) [x86_64-darwin16]
[2016-11-22 20:10:13] INFO WEBrick::HTTPServer#start: pid=3389 port=9292
Simple as that :)
Just send a GET
request with the URLs you want to check as params. Each key of the param will be returned as a key of the response JSON:
$ curl -X GET 'http://localhost:9292?google=http://www.google.com.br&bing=http://www.bing.com'
{
"google": "200",
"bing": "200"
}
Sending invalid or unreachable URLs will get a '0' as status:
$ curl -X GET 'http://localhost:9292?some_bad_url=this_is_not_a_real_url'
{
"some_bad_url": "0"
}
This app uses Rspec for testing. To run the test suit:
$ rspec
Just fork the app and send a pull-request! Improvements are welcome :)