Monitoring Compute services with Munin – OpenStack

(4.0)

| 1585 Ratings

Munin the monitoring tool surveys all your computers and remembers what it saw.Munin Monitoring System is one of the popular computer system, network and infrastructure monitoring tool. With Munin, real-time information about the servers, applications, services, SANs, network and many more resources is available in graphs through a web interface. And Munin is easy to set up and deploy with its plug and play capabilities, and coupled with the fact that it’s free and open source, making it a popular monitoring tools for web servers and hosts.Munin actually consists of two parts, namely Munin Master and Munin node. Munin Server is the data gatherer and grapher which also hosts the software website. The Munin Server will periodically poll all the nodes in your network, it’s aware of for data, which it in turn will use to create graphs and HTML pages for viewing via web browser. Munin Node is the agent that monitors and extracts data from the node it runs on, and then passes the data to the server for further processing.

Getting ready

We will be configuring Munin on a server that has access to the OpenStack Compute environment hosts. Ensure this server has enough RAM, disk, and CPU capacity for the environment you are running. As a bare minimum in a test environment, it is possible to run this on a VM with 1vCPU, 1.5 GB of RAM, and 8 GB of disk space.

How to accomplish it…

To set up Munin with OpenStack, carry out the following steps:

Install Munin.

Configure the Munin nodes.

Configure OpenStack plugins for Munin.

Munin master server

The munin master is responsible for gathering data from munin nodes. It stores this data in RRD, files, and graphs them on request. It also checks whether the fetched values fell below or go over specific thresholds (warning, critical) and will send alerts if this happens and the administrator configured it to do so.It must be installed first, as follows:

Configure a server with Ubuntu 12.04, 64 bit Version with access to the servers in our OpenStack environment.

By default, the Apache configuration for Munin only allows access from 127.0.0.1. To allow access from our network, we edit /etc/apache2/conf.d/munin and allow the server(s) or network(s) that can access Munin. For example, to allow access from 172.16.0.0/16, we add the following access line in:

Allow from 172.16.

We reload the Apache service to pick up this change. We do this as follows:

sudo service apache2 reload

At this stage, we have a basic installation of Munin that is gathering statistics for the running machine where we have just installed Munin. This can be seen if you load up a web browser and browse to https://server/munin:

Configuration of Munin Master is done in the /etc/munin/munin.conf. Here, we tell Munin where our OpenStack hosts, which are specified as FQDNs, are. Munin groups these hosts under the same domain. For example, to add in two OpenStack hosts that have addresses 172.16.0.200 (openstack1) and 172.16.0.201 (openstack2), we add the following section into the /etc/munin/munin.conf file:

We can now proceed to configure the nodes that we want to monitor, for example openstack1 and openstack2.

Munin nodes

A munin node is a data collector for munin that runs on a slice.With the Munin master server, we can now configure the Munin nodes. These have an agent on them, called munin-node that the master uses to gather the information and present to the user.

We first need to install the munin-node package on our OpenStack hosts. So, for each one we execute the following:

Once installed, we need to configure this so that our Munin master host is allowed to get information from the node. To do this, we edit the /etc/munin/munin-node.conf file and add in an allow line. To allow our master on IP address 172.16.0.253, we add the following entry:

allow ^172.16.0.253$

Once that the line is in, we can restart the munin-node service to pick up the change:

sudo restart munin-node

Monitoring OpenStack Compute services

With Munin master installed, and having a couple of nodes with graphs showing up on the Master, we can add the plugins to pick up the OpenStack services and graph them. To do this, we check out some plugins from GitHub.

We first ensure that we have the git client available to us on our OpenStack nodes:

sudo apt-get update
sudo apt-get -y install git

We can now check out the OpenStack plugins for Munin as they’re not yet available in the munin-plugins-extra package:

git clone https://github.com/munin-monitoring/contrib.git

This checks out contributed code and plugins to a directory named contrib. We copy the relevant plugins for the OpenStack services into the Munin plugins directory, as follows:

We also need to add an extra configuration file to sit alongside the OpenStack plugins called /etc/munin/plugin-conf.d/openstack:

[nova_*] user nova
[keystone_*] user keystone
[glance_*] user glance

With the appropriate plugins configured, we restart the munin-node service, as follows, to pick up the change:

sudo restart munin-node

When the master server refreshes, we see OpenStack services as options and graphs, which we can click on:

How it works…

Munin is an excellent, open source networked, resource-monitoring tool that can help analyze resource trends and identify problems with our OpenStack environment. Configuration is very straightforward, with out of the box configuration providing lots of very useful graphs from RRD (Round Robin Database) files. By adding in a few extra configuration options and plugins, we can extend this to monitoring our OpenStack environment.Once Munin has been installed, we have to do a few things to configure it to produce graphed statistics for our environment:

Configure the master Munin server with the nodes we wish to get graphs from. This is done in the /etc/munin/munin.conf file by using the tree-like structure domain/host address sections.

We then configure each node with the munin-node. This is a service that has its own configuration file where we have to explicitly set what Munin server that can pull graphs from it. This is set in with the allow line in the /etc/munin/munin.conf file.

Finally, we configure appropriate plugins for the services that we want to monitor. With the OpenStack plugins installed, we can monitor the Compute, Keystone, and Glance services and obtain statistics on the number of instances running, the number of floating IPs assigned, allocated, and used, and so on.

Subscribe For Free Demo

Phone *

E-mail Address *

Free Demo for Corporate & Online Trainings.

About The Author

Ravindra Savaram is a Content Lead at Mindmajix.com. His passion lies in writing articles on the most popular IT platforms including Machine learning, DevOps, Data Science, Artificial Intelligence, RPA, Deep Learning, and so on. You can stay up to date on all these technologies by following him on LinkedIn and Twitter.

Mindmajix - Online global training platform connecting individuals with the best trainers around the globe. With the diverse range of courses, Training Materials, Resume formats and On Job Support, we have it all covered to get into IT Career. Instructor Led Training - Made easy.