This is a minimal gem that integrates to the OpsGenie API specification. Right now only OpsGenie Alerts are implemented. More functionality will follow later.
Create an OopsGenieAlert Object minimally providing your OpsGenie api key and a message.
alert = OopsGenie::OopsGenieAlert.new('your api key here', 'Testing Alerts')
alert.send_alert
Additionally you can set other configuration parameters to the alert object before sending. eg.
alert = OopsGenie::OopsGenieAlert.new('your api key here', 'Testing Alerts')
alert.tags = ['Critical', 'Another tag']
alert.priority = 'P1'
alert.send_alert
In the host application, ensure there is configuration file in config/opsgenie.yml
in the format below:
development:
endpoint: opsgenie-url
api_key: opsgenie-api-key
production:
endpoint: opsgenie-url
api_key: opsgenie-api-key
Attributes that can be set on the alert oject are:
- api_key
- message
- alias
- actions
- tags
- details
- entity
- priority
- responders
See the OpsGenie API for more information on these.
Add this line to your application's Gemfile:
gem 'oops_genie'
And then execute:
$ bundle
Or install it yourself as:
$ gem install oops_genie
Contribution directions go here.
The gem is available as open source under the terms of the MIT License.