Skip to content

lucasuyezu/heartcheck-webservice

 
 

Repository files navigation

Heartcheck::Webservice

Build Status

A plugin to check webservice connection with heartcheck

Installation

Add this line to your application's Gemfile:

gem 'heartcheck-webservice'

And then execute:

$ bundle

Or install it yourself as:

$ gem install heartcheck-webservice

Usage

You can add a check to a webservice when configuring heartcheck

The service is a Hash that needs to respond to :name to identify the service, :url of the service (GET request) and :body_match is a regex that is going to match the response body. Ex.

Heartcheck.setup do |config|
  config.add :webservice do |c|
    c.add_service(name: 'CloudApi', url: "http://cloud.example.com/status", body_match: /OK/)
  end
end

You can ignore ssl if you want, just set the Hash with :ignore_ssl_cert. Ex.

Heartcheck.setup do |config|
  config.add :webservice do |c|
    c.add_service(name: 'CloudApi',
                  url: "https://cloud.example.com/status",
                  body_match: /OK/,
                  ignore_ssl_cert: true)
  end
end

Contributing

  1. Fork it ( https://github.com/locaweb/heartcheck-webservice )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

About

A plugin to check a webservice connection with heartcheck

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%