Skip to content
This repository has been archived by the owner on Dec 11, 2022. It is now read-only.

jaxxstorm/redphone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Redphone, the monitoring service ruby library

  • Pagerduty support (integration, incidents)
  • Pingdom support (checks, results, actions)
  • Loggly support (event, search, facets)
  • StatusPage support (incidents, components)

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

  • All API request are done over SSL
  • Response bodies are returned as Ruby hashes

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

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"

Pingdom

require "redphone/pingdom"
pingdom = Redphone::Pingdom.new(
  :user => USER,
  :password => PASSWORD
)

Create a check

response = pingdom.create_check(
  :name => "redphone",
  :host => "www.amazon.ca",
  :type => "http"
)
check_id = response['check']['id']

Delete a check

pingdom.delete_check(:id => check_id)

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

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

Faceted search results on date

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

Add an option for faceted search results on input name

:facet_type => "input"

Or on IP address

:facet_type => "ip"

You can add the following options for a date range

:from => "2011-08-01T12:00:00Z",
:until => "2011-10-01T12:00:00Z"

StatusPage.io

require "redphone/statuspage"
statuspage = Redphone::Statuspage.new(
  :page_id => PAGE_ID,
  :api_key => API_KEY
)

Create a realtime incident

response = statuspage.create_realtime_incident(
  :name => "testing",
  :status => "identified",
  :wants_twitter_update => "t",
  :message => "testing message"
)

Update an incident

incident_id = response["id"]
statuspage.update_incident(
  :name => "testing",
  :status => "resolved",
  :wants_twitter_update => "t"
  :incident_id => incident_id
)

Delete an incident

statuspage.delete_incident(
  :incident_id => incident_id
)

Update a component status

statuspage.update_component(
  :component_id => COMPONENT_ID,
  :status => "major_outage"
)

Contributors

About

A rubygem for talking to monitoring service APIs

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages