Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A rubygem for talking to monitoring service APIs
Ruby
tag: v0.0.4

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.gitignore
Gemfile
README.org
Rakefile
redphone.gemspec
redphone.jpg

README.org

Redphone, the monitoring service ruby library

  • Pagerduty support (integration, incidents)
  • Loggly support (events)

https://github.com/portertech/redphone/raw/master/redphone.jpg

Getting started

gem install redphone

Examples

Pagerduty

require "redphone/pagerduty"
pagerduty = Redphone::Pagerduty.new(
  :service_key => SERVICE_KEY,
  :subdomain => SUBDOMAIN,
  :user => USER,
  :password => PASSWORD
)

Trigger an incident

pagerduty.trigger_incident(
  :description => "Testing Redphone Rubygem",
  :incident_key => "redphone/test"
)
# OR Redphone::Pagerduty.trigger_incident()

Resolve an incident

pagerduty.resolve_incident(:incident_key => "redphone/test")
# OR Redphone::Pagerduty.resolve_incident()

List/query current and past incidents

incidents = pagerduty.incidents(:incident_key => "redphone/test")

You can add the following options for a date range

:since => "2011-08-01",
:until => "2011-10-01"

Or if you only care about unresolved incidents

:status => "triggered,acknowledged"

Loggly

require "redphone/loggly"
loggly = Redphone::Loggly.new(
 :subdomain => SUBDOMAIN,
 :user => USER,
 :password => PASSWORD
)

Create an event

loggly.send_event(
  :input_key => INPUT_KEY,
  :input_type => "json",
  :event => {
    :service => "redphone",
    :message => "test"
  }
)
# OR Redphone::Loggly.send_event()

Search for previous event occurrences

events = loggly.search(:q => "json.service:redphone")

Contributors

Something went wrong with that request. Please try again.