Skip to content

Get the HTTP status of a bunch of URLs in a single JSON response. Ideal for monitoring a lot of services at once.

License

Notifications You must be signed in to change notification settings

IgorMarques/sickbay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sickbay

Get the HTTP status of a bunch of URLs in a single JSON response. Ideal for monitoring a lot of services at once.

Code Climate Build Status Coverage Status

$ curl -X GET 'http://localhost:9292?google=http://www.google.com.br&bing=http://www.bing.com'
{
  "google": "200",
  "bing": "200"
}

Why?

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.

Live App

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.

Setup

Assuming you have a proper Ruby workspace setted up, just run:

$ git clone http://github.com/IgorMarques/sickbay
$ cd sickbay
$ bundle install

Running the Server

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 :)

Using the App

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"
}

Testing

This app uses Rspec for testing. To run the test suit:

$ rspec

Contributing

Just fork the app and send a pull-request! Improvements are welcome :)

About

Get the HTTP status of a bunch of URLs in a single JSON response. Ideal for monitoring a lot of services at once.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages