Code Monkey home page Code Monkey logo

redis_dashboard's Introduction

Redis Dashboard

A Sinatra web app showing monitoring informations about your Redis servers. You can run it in standalone or inside your Rails app.

Redis dashboard

Features

List of your redis servers

  • Connections
  • Memory
  • Commands per second

Detailed views for each server

  • Redis INFO output
  • Redis CONFIG GET output
  • Redis CLIENT LIST output
  • Redis SLOWLOG GET output

Installation inside a Rails app

Add to your Gemfile gem "redis_dashboard" and run bundle install.

Then mount the app from config/routes.rb:

mount RedisDashboard::Application, at: "redis"

By default Redis dashboard tries to connect to REDIS_URL environment variable or to localhost. You can specify any other URL by adding an initializer in config/initializers/redis_dashboard.rb :

RedisDashboard.urls = [ENV["REDIS_URL"] || "redis://localhost"]

Finally visit http://localhost:3000/redis.

Authentication and permissions

To protect your dashboard you can setup a basic HTTP authentication :

# config/initializers/redis_dashboard.rb
RedisDashboard::Application.use(Rack::Auth::Basic) do |user, password|
  user == "USER" && password == "PASSWORD"
end

In case you handle authentication with Devise, you can perform the permission verification directly from the routes :

# config/routes.rb
authenticate :user, -> (u) { u.admin? } do # Supposing there is a User#admin? method
  mount RedisDashboard::Application, at: "redis"
end

MIT License

Made by Base Secrète.

Rails developer? Check out RoRvsWild, our Ruby on Rails application monitoring tool.

redis_dashboard's People

Contributors

alexisbernard avatar antoinem avatar incubus avatar wbotelhos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

redis_dashboard's Issues

New release

Can you release a new version on rubygems.
Version 0.1.3 does not work with redis-rb >=4.

Unable to use with rediss urls and self-signed certificates

Right now the redis client will not work with rediss urls if the redis server presents a self-signed certificate. This is the case for e.g. Heroku Redis. The following error is raised:

OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 peeraddr=x.x.x.x:20229 state=error: certificate verify failed (self signed certificate in certificate chain)

To enable this we can pass an additional parameter when calling Redis.new e.g.

Redis.new(
  url: ENV["REDIS_URL"],
  ssl_params: { verify_mode: OpenSSL::SSL::VERIFY_NONE }
)

Would you accept a pull request to add a configuration option for this? Let me know if you have a preference as to what the configuration API should look like.

ERR unknown command `config`, with args beginning with: `get`, `*`

Accessing menu config or sloglog:

Redis: 4.1.3

Redis::CommandError - ERR unknown command `config`, with args beginning with: `get`, `*`,:
	/usr/local/ruby/gem/gems/redis-4.1.3/lib/redis/client.rb:126:in `call'
	/usr/local/ruby/gem/gems/redis-4.1.3/lib/redis.rb:206:in `block in config'
	/usr/local/ruby/gem/gems/redis-4.1.3/lib/redis.rb:52:in `block in synchronize'
	/usr/local/ruby/2.6.5/lib/ruby/2.6.0/monitor.rb:235:in `mon_synchronize'
	/usr/local/ruby/gem/gems/redis-4.1.3/lib/redis.rb:52:in `synchronize'
	/usr/local/ruby/gem/gems/redis-4.1.3/lib/redis.rb:205:in `config'
	/usr/local/ruby/gem/bundler/gems/redis_dashboard-956450c2181d/lib/redis_dashboard/client.rb:14:in `config'
	/usr/local/ruby/gem/bundler/gems/redis_dashboard-956450c2181d/lib/redis_dashboard/client.rb:33:in `slow_commands'
	/usr/local/ruby/gem/bundler/gems/redis_dashboard-956450c2181d/lib/redis_dashboard/application.rb:32:in `block in <class:Application>'

Error when trying to access the dashboard

See stack trace

Started GET "/redis_dashboard/" for ::1 at 2018-04-05 21:58:27 -0400
Errno::ENOENT - No such file or directory @ rb_sysopen - ./views/index.erb:
 /Users/josh/.rvm/gems/ruby-2.4.0/gems/tilt-1.4.1/lib/tilt/template.rb:91:in `initialize'
 /Users/josh/.rvm/gems/ruby-2.4.0/gems/tilt-1.4.1/lib/tilt/template.rb:91:in `open'
 /Users/josh/.rvm/gems/ruby-2.4.0/gems/tilt-1.4.1/lib/tilt/template.rb:91:in `read_template_file'
 /Users/josh/.rvm/gems/ruby-2.4.0/gems/tilt-1.4.1/lib/tilt/template.rb:68:in `block in initialize'
 /Users/josh/.rvm/gems/ruby-2.4.0/gems/tilt-1.4.1/lib/tilt/template.rb:69:in `initialize'
 /Users/josh/.rvm/gems/ruby-2.4.0/gems/sinatra-1.2.8/lib/sinatra/base.rb:613:in `new'
 /Users/josh/.rvm/gems/ruby-2.4.0/gems/sinatra-1.2.8/lib/sinatra/base.rb:613:in `block in compile_template'
 /Users/josh/.rvm/gems/ruby-2.4.0/gems/tilt-1.4.1/lib/tilt.rb:127:in `fetch'
 /Users/josh/.rvm/gems/ruby-2.4.0/gems/sinatra-1.2.8/lib/sinatra/base.rb:592:in `compile_template'
 /Users/josh/.rvm/gems/ruby-2.4.0/gems/sinatra-1.2.8/lib/sinatra/base.rb:574:in `render'
 /Users/josh/.rvm/gems/ruby-2.4.0/gems/sinatra-1.2.8/lib/sinatra/base.rb:467:in `erb'
 /Users/josh/.rvm/gems/ruby-2.4.0/gems/redis_dashboard-0.1.3/lib/redis_dashboard/application.rb:9:in `block in <class:Application>'
 /Users/josh/.rvm/gems/ruby-2.4.0/gems/sinatra-1.2.8/lib/sinatra/base.rb:1175:in `call'
 /Users/josh/.rvm/gems/ruby-2.4.0/gems/sinatra-1.2.8/lib/sinatra/base.rb:1175:in `block in compile!'
 /Users/josh/.rvm/gems/ruby-2.4.0/gems/sinatra-1.2.8/lib/sinatra/base.rb:739:in `instance_eval'
 /Users/josh/.rvm/gems/ruby-2.4.0/gems/sinatra-1.2.8/lib/sinatra/base.rb:739:in `route_eval'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.