Systems monitoring with visual representations of trending and resource consumption is an essential component of the bigger picture of infrastructure management and design. The open source (GPL) project Munin is an excellent approach to getting graphs of systems behavior quickly. A default installation producing useful information takes less than 30 minutes and requires only a minimal understanding of the software or the various resources being monitored.
Here we discuss a few issues involved in using Munin to monitor EC2 instances, and in particular micro instances. There’s a two step approach used here: Initially monitoring and graphing on one or several nodes then upon satisfactory results the graphing component will be moved to a central system. It’s important to note that the resources available on an AWS EC2 micro instance are insufficient for data collection and graph generation.
Single Node Configuration
1. Install httpd, munin and munin-node. All of these items are available in the AWS repositories. Apache httpd is needed only for the first part of this process and may be shut off or removed entirely later on.
# yum install munin
# yum install munin-node
2. Make the necessary edits to the Munin configuration.
3. Start the services.
# service sysstat start
# service munin-node start
# chkconfig sysstat on
# chkconfig munin-node on
4. Check to see the munin-node service started correctly.
2011/07/16-01:30:24 Munin::Node::Server (type Net::Server::Fork) starting! pid(1349)
Binding to TCP port 4949 on host *
Setting gid to “0 0”
5. Apache needs an alias in order to find the munin graphs.
Alias /munin /var/www/html/munin
Then restart apache to load the Alias just entered and see if /var/www/html/munin/index.html exists. If so, open the following in a browser: http://mymuninnode/munin
If after 10 minutes /var/www/html/munin/index.html still hasn’t been created, check to see if the crontab exists, /etc/cron.d/munin. This file is a necessary part of munin. It runs every 5 minutes to create the graphs.
Assuming at least the graph boxes have been created, take a close look at the left running column of graphs. The left running column are the “by day” items. In the far right in some of those you might see very small lines beginning to trend. Give this 20-30 minutes to really see the trending develop. If everything looks fine, then proceed to consolidating the graphs on a monitoring server in the network configuration.
***** iostat plugin
Determine which system will be used as a monitoring server. It should have a substantial amount of available CPU (quad core, 2Ghz). In this example we’ll use a server named muninmonitor.example.com (126.96.36.199) monitoring the node mylilnode.example.com (188.8.131.52).
1. On the node to be monitored
At this time the notation for the ip address must be a regular expression
2. Configure the network equipment for the monitored node. Open an inbound port (default 4949) to allow for the data collection coming from the monitoring server. With an AWS EC2 instance use the AWS Management Console: EC2 -> Networking and Security (in lefmost Navigation column) -> Security Groups.
3. From the monitoring server, use telnet or netcat to check the connection:
Connected to mylilnode.example.com.
Escape character is ‘^]’.
# munin node at mylilnode.example.com
# Unknown command. Try cap, list, nodes, config, fetch, version or quit
4. On the monitoring server, tell munin to monitor the node.
– how to force graph generation here?
5. Check that the graphs have been generated on the monitoring server http://muninmonitor.example.com/munin
Tutorial and documentation…
Various plugins for AWS services…
s3 plugin: http://www.ohardt.com/dev/munin/