Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A rubygem for talking to monitoring service APIs

tag: v0.0.4

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile gem init October 07, 2011
Octocat-spinner-32 README.org
Octocat-spinner-32 Rakefile revert test.pattern change March 16, 2012
Octocat-spinner-32 redphone.gemspec
Octocat-spinner-32 redphone.jpg add image to readme October 07, 2011
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.