0.01
No commit activity in last 3 years
No release in over 3 years
Yet another mackerel client for Ruby.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

>= 0
>= 0

Runtime

 Project Readme

mackerel-rb

Gem Version Build Status Code Climate Dependency Status

Installation

Add this line to your application's Gemfile:

gem 'mackerel-rb'

And then execute:

$ bundle

Or install it yourself as:

$ gem install mackerel-rb

Usage

Mackerel.configure do |config|
  config.api_key = "<Your API Key>"               # Default: ENV['MACKEREL_APIKEY']
  config.proxy   = "http://proxy.example.com:80"  # Default: nil (Not use http proxy)
end

hosts = Mackerel.hosts
hosts.each do |host|
  puts host
  #=> #<Hashie::Mash createdAt=1437422856 displayName="www001.mackerel-rb.dev" id="Dummmmmmmmy", ..., status="standby" type="unknown">
end

Feature

Services

  • List of Services - GET/api/v0/services
  • List of metric-names - GET/api/v0/service/<serviceName>/metrics-names

Roles

  • List of Roles - GET/api/v0/services/<serviceName>/roles

Hosts

  • Registering host information - POST/api/v0/hosts
  • Getting host information - GET/api/v0/hosts/<hostId>
  • Updating host information - PUT/api/v0/hosts/<hostId>
  • Updating host status - POST/api/v0/hosts/<hostId>/status
  • Updating host roles - PUT/api/v0/hosts/<hostId>/role-fullnames
  • Retiring a host - POST/api/v0/hosts/<hostId>/retire
  • List of hosts - GET/api/v0/hosts.json
  • Getting host metrics - GET/api/v0/hosts/<hostId>/metrics
  • List of metric-names - GET/api/v0/hosts/<hostId>/metrics-names

Metrics

  • Posting metrics - POST/api/v0/tsdb
  • Getting latest metrics - GET/api/v0/tsdb/latest
  • Posting graph definitions - POST/api/v0/graph-defs/create
  • Posting service metrics - POST/api/v0/services/<serviceName>/tsdb
  • Posting monitoring check results - POST/api/v0/monitoring/checks/report

Monitors

  • Register monitor configurations - POST/api/v0/monitors
  • Get monitor configurations - GET/api/v0/monitors
  • Get monitor configurations - GET/api/v0/monitors/<monitorId>
  • Update monitor configurations - PUT/api/v0/monitors/<monitorId>
  • Delete monitor configurations - DELETE/api/v0/monitors/<monitorId>

Dashboards

  • Creating Dashboards - POST/api/v0/dashboards
  • Getting Dashboards - GET/api/v0/dashboards/<dashboardId>
  • Updating Dashboards - PUT/api/v0/dashboards/<dashboardId>
  • Deleting Dashboards - DELETE/api/v0/dashboards/<dashboardId>
  • List of Dashboards - GET/api/v0/dashboards

Alerts

  • List of Alerts - GET/api/v0/alerts
  • Closing Alert - POST/api/v0/alerts/<alertId>/close

Organization

  • Getting Organization - GET/api/v0/org

Contributing

  1. Fork it ( https://github.com/pepabo/mackerel-rb/fork )
  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