0.0
No commit activity in last 3 years
No release in over 3 years
Run-time date collector
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

Rack::Monitor¶ ↑

Rack::Monitor is Rack middleware collecting run-time information for monitoring tools like Munin.

Installation¶ ↑

sudo gem install rack-monitor rack-contrib

Basic Usage¶ ↑

Rack::Monitor is implemented as a piece of Rack middleware and can be used with any Rack-based application. If your application includes a rackup (.ru) file or uses Rack::Builder to construct the application pipeline, simply require and use as follows:

require 'rack/contrib'
require 'rack/monitor'

if ENV['RACK_ENV'] == 'production'
  use Rack::Access, '/rack_status' => [ '127.0.0.1' ]
  use Rack::Monitor, :url => '/rack_status', :watch => ['/', '/ping']
end

run app

Using with Rails¶ ↑

Add this to your config/environments/production.rb:

config.gem "rack-monitor", :lib => "rack/monitor"

require 'rack/monitor' #Rails bug?
config.middleware.use ::Rack::Monitor, :url => '/rack_status', :watch => ['/', '/ping']

You should now see Rack::Monitor listed in the middleware pipeline:

RAILS_ENV=production rake middleware

Rack::Monitor doesn’t work properly when started with mongrel_rails. Use thin instead.

Monitoring with Munin¶ ↑

Copy plugin files from github.com/pka/rack-monitor/tree/master/munin/ to /etc/munin/plugins/

Setup a configuration in /etc/munin/plugin-conf.d/ like github.com/pka/rack-monitor/tree/master/munin/plugin-conf.d/rack

/etc/init.d/munin-node restart
GitHub

github.com/pka/rack-monitor

Thanks to:

  • rack-bug

  • Rails footnotes

Copyright © 2010 Pirmin Kalberer. See LICENSE for details.