Install puppet-dashboard on RedHat/CentOS 5
If you have a puppet network in place you will want to use puppet-dashboard. It is a fairly new project and still has some misssing pieces but overall a good way to tell the health of your puppet network. The thing I really like about it is that you can see when the last check in time is for a client and if it had any errors or warnings during its runs so you can fix them.
The big issue is that out of the box its a bit hard to get running on Redhat/CentOS. No worries I spent some time to make it work and passing it on to you.
Install Rake
rpm -ivh http://mirrors.tummy.com/pub/fedora.redhat.com/epel/5/x86_64/rubygems-1.3.1-1.el5.noarch.rpm
rpm -ivh http://mirrors.tummy.com/pub/fedora.redhat.com/epel/5/x86_64/rubygem-rake-0.8.3-1.el5.noarch.rpm
Install MySQL bindings for Ruby
rpm -ivh http://mirrors.tummy.com/pub/fedora.redhat.com/epel/5/x86_64/ruby-mysql-2.7.3-1.el5.x86_64.rpm
Install git if needed
yum install git
I like to install non-rpmed apps in /opt so that is where I will clone the git project
cd /opt
git clone git://github.com/reductivelabs/puppet-dashboard.git
Now lets config the database. As of writing this, there is an error in the sample configs but one of the authors told me he was doing to fix them. It is in user and pass, they should be username and password
So here is my sample config
cd puppet-dashboard
cat config/database.yml
Here are the contents
development:
adapter: mysql
database: puppet_dash
username: puppet
password: master
encoding: utf8
host: 192.168.100.5
rake install
/etc/puppet/puppet.conf
report = true
/etc/sysconfig/puppetmaster
#PUPPETMASTER_EXTRA_OPTS=–noca
PUPPETMASTER_EXTRA_OPTS=”––reports puppet_dashboard”
cp /opt/puppet-dashboard/puppet/lib/puppet_dashboard.rb /usr/lib/ruby/site_ruby/1.8/puppet/reports/
service puppetmaster restart
/opt/puppet-dashboard/script/server
I also wrote a post on setting up a init.d script for puppet-dashboard
Thanks for the writeup, Mike.
Installing dashboard on systems that run Ruby 1.8.5 is a bit trickier than usual (you have to install the mysql bindings using a system package, for instance) but hopefully not unnecessarily so.
Also, the sample database.yml that is copied during rake:install has been fixed. Thanks for bringing it to our attention.
thanks for all the hard work on the dashboard. I love all the error reporting I get to see to see the health of my puppet network. I can’t wait for updates.
Thanks for the post. It helped me to get the dashboard up for reporting only which is what I wanted.
————————————————————
In the [puppet] section add the following
report = true
————————————————————
I had to do this under [puppetd] and not [puppet] for it to work.
I guess this would depend if you run puppet from cron or as a daemon ?
Thanks.. this is an error in my post.. I have corrected it.
So I’m running into a cryptic error when attempting the rake install.. I can connect to the DB with the username/password combination I used in config/database.yml. In addition, all my version numbers match what you’re specifying above. I’m running this on centos 5.4.
Here’s a full trace:
(in /usr/local/puppet-dashboard)
** Invoke install (first_time)
** Invoke copy_config (first_time)
** Invoke config/database.yml (first_time, not_needed)
** Invoke config/database.yml.example (first_time, not_needed)
** Execute copy_config
** Invoke db:create (first_time)
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Execute db:create
rake aborted!
undefined method `[]‘ for nil:NilClass
/usr/local/puppet-dashboard/vendor/rails/railties/lib/tasks/databases.rake:55:in `create_database’
/usr/local/puppet-dashboard/vendor/rails/railties/lib/tasks/databases.rake:31
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:616:in `call’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:616:in `execute’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:611:in `each’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:611:in `execute’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:577:in `invoke_with_call_chain’
/usr/lib/ruby/1.8/monitor.rb:238:in `synchronize’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:570:in `invoke_with_call_chain’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:587:in `invoke_prerequisites’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:584:in `each’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:584:in `invoke_prerequisites’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:576:in `invoke_with_call_chain’
/usr/lib/ruby/1.8/monitor.rb:238:in `synchronize’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:570:in `invoke_with_call_chain’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:563:in `invoke’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2018:in `invoke_task’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1996:in `top_level’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1996:in `each’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1996:in `top_level’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2035:in `standard_exception_handling’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1990:in `top_level’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1969:in `run’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2035:in `standard_exception_handling’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1966:in `run’
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/bin/rake:31
/usr/bin/rake:19:in `load’
/usr/bin/rake:19
Any idea what’s going on here?
Thanks in advance for any help!
my guess is the user you are using does not have privileges to create that table in the database.
You did what I did and copied / pasted the database.yml above??
You have to indent all the stuff below ‘development’ with two spaces
thanks! I fixed the block in question
Have you compared this with foreman?
http://theforeman.org/projects/foreman/wiki/Screenshots
I did look at foreman and i like it. I went with dashboard since all I really wanted to see was if nodes were erroring out during check in.
Plus I like a challenge and there was no instructions for setting it up with a very common distro like Redhat/CentOS 5
Just to clarify based on your comment – Foreman fully supports telling you what is the states of your nodes as part of its own dashboard.
Foreman has a mode which disable the OS provisioning, acting as a puppet external nodes, inventory and reporting infrastructure
Hello
Can I use Oracle instead of mysql or sqlite ?
thx.
I might be completely wrong, but as of now dashboard only supports mysql
Not sure if it’s a typo in your instructions or they re-structured the puppet-dashboard package a little bit but the puppet_dashboard.rb file now resides in puppet-dashboard/lib/puppet
Thanks for this really helpful,but the dashboard does not show all my classes and node it is showing only the samples, how do i get all my classes and nodes to show it the dashboard
This post is very helpful but, as mahmoud have, dashboard don’t show me “production” view; and rake install only create “development” database. Is there a parameter to fix “production” environment?
Thank’s for you help.
I Can import puppet reports to dashboard :
rake reports:import
Importing 157410 reports from /var/lib/puppet/reports/
but ……
I have the same issue. How do you get it to pick up the reports automatically from the production environment without importing them?
Mike –
Thanks, the install went great using the steps above.
One other thing to add is if you have two puppet masters that you’d like to report to one dashboard, you just need to:
- copy over ‘puppet_dashboard.rb’ with a modified HOST line
- modify /etc/sysconfig/puppetmaster
- turn on reporting on the clients
- restart puppetmaster
Andrew
hi, i have install puppet and puppet_dashboard in my virtualBox.
In puppet dashboard i add a node (just my client puppet).
I meet a issue:
Unreported Nodes
1 node has not yet reported: test03.testdev.com.
this is my config:
puppet client:
[puppetd]
report = true
puppet server:
[puppetmasterd]
reports = puppet_dashboard
/usr/lib/ruby/site_ruby/1.8/puppet/reports/puppet_dashboard.rb
service puppetmaster restart
Now run puppet-dashboard
/opt/puppet-dashboard/script/server
/usr/sbin/puppetmasterd
PUPPETMASTER_EXTRA_OPTS=”–reports puppet_dashboard”
I dont’t known why doesn’t report?
thx
did you restart your client?
Thanks