Chapter 12
259
3. Then, we copy everything over to the web server DocumentRoot directory:
sudo cp -a ./collectd-web /var/www
4. Create or modify the /etc/collectd/collection.conf file with the
following contents:
datadir: "/var/lib/collectd/"
libdir: "/usr/lib/collectd/"
5. We then run the standalone server that will listen locally for requests from Apache:
cd /var/www/collectd-web
sudo nohup python runserver.py &
6. After this we edit the vhost file that controls the DocumentRoot of our Apache setup
(on Ubuntu, this is /etc/apache2/sites-enabled/000-default) to ensure that
.htaccess files are understood with the AllowOverride all configuration:
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
7. We can now simply reload Apache to pick up the changes, as follows:
sudo service apache2 reload
8. Now, we point our web browser to our installation, for example,
http://172.16.0.253/collectd-web, to view the collectd
stats from the listed servers.
How it works...
Munin has plugins for various monitoring activities, including libvirt. As libvirt is used
to manage the running instances on our Compute nodes, they hold an array of information
that we can send to Munin to allow us to get a better understanding of what is happening in
and on our OpenStack Compute hosts and instances.
Collectd is regarded as one of the standard ways of collecting resource information from
servers and instances. It can act as a server and a client and, as such, we use the same
installation binaries on both our monitoring host and guests. The difference is in the
configuration file,
/etc/collectd/collectd.conf. For the server, we specify that we
listen on a specific port using the following lines in the server's configuration file:
Listen "*" "12345"
www.it-ebooks.info