<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Scout ~ The Blog comments on Monitoring Amazon EC2 Instances</title>
    <link>http://blog.scoutapp.com/</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Scout ~ The Blog comments</description>
    <item>
      <title>"Monitoring Amazon EC2 Instances" by seebq</title>
      <description>&lt;p style="float:left"&gt;&lt;img src="http://scoutapp.com/images/uses/amazon_ec2.gif" alt="" /&gt;
Amazon&amp;#8217;s &lt;a href="http://aws.amazon.com/ec2"&gt;Elastic Compute Cloud (Amazon &lt;span class="caps"&gt;EC2&lt;/span&gt;) Service&lt;/a&gt; is changing how we approach computing infrastructure.  Scout is an ideal monitoring solution for Ruby on Rails application servers on &lt;span class="caps"&gt;EC2&lt;/span&gt; instances.&lt;/p&gt;


	&lt;h2&gt;Why use Scout for monitoring your &lt;span class="caps"&gt;EC2&lt;/span&gt; instances?&lt;/h2&gt;


	&lt;ul&gt;
	&lt;li&gt;Just a single line of code to add the client&lt;/li&gt;
		&lt;li&gt;No complicated scripts to configure &amp;#8211; choose what you want to monitor through the Scout web interface&lt;/li&gt;
		&lt;li&gt;Easy to re-use or view statistical data once an instance has terminated&lt;/li&gt;
	&lt;/ul&gt;


	&lt;h2&gt;Overview&lt;/h2&gt;


	&lt;p&gt;The basic process for &lt;span class="caps"&gt;EC2&lt;/span&gt; monitoring works like this: You create a new client that you want to use as a template . You can then clone this client (and all of its plugins) using the scout clone command, which can be added to the boot/startup script on your &lt;span class="caps"&gt;AMI&lt;/span&gt;.&lt;/p&gt;


	&lt;p&gt;Read on for the Step-by-Step.&lt;/p&gt;

&lt;h2&gt;Step-by-Step&lt;/h2&gt;


	&lt;p&gt;Create a new client using the Scout Web Interface:&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://scoutapp.com/images/uses/new_client.gif" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;Install plugins on this client:&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://scoutapp.com/images/uses/install_plugin.gif" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;Grab the client key of your newly created &amp;#8220;template&amp;#8221; from the Client Settings tab:&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://scoutapp.com/images/uses/client_key.gif" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;Now, you can easily create a brand new client from your template using the scout clone command:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
scout clone [client-key] `hostname`
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;The output of the line above is a line for your crontab file, so you could simply add this to the bottom of the crontab:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
scout clone [client-key] `hostname` &amp;gt;&amp;gt; /etc/crontab
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;You&amp;#8217;re just one step away from automating the entire process by adding the scout gem dependency to your &lt;span class="caps"&gt;AMI&lt;/span&gt;, and even adding the scout clone line above to your startup scripts.&lt;/p&gt;


	&lt;p&gt;Here&amp;#8217;s my first version of our Scout install script to be run on boot of our Rails &lt;span class="caps"&gt;AMI&lt;/span&gt;:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
#!/bin/bash
# Scout Install / Setup Script

/usr/bin/gem install scout

CLONE_CLIENT_KEY = 6ecad312-0a17-3db1-9x2c-a12c45493fg # replace with your template client key
INTERVAL = 10
NEW_CLIENT_KEY = /usr/bin/scout clone $CLONE_CLIENT_KEY

# add to crontab:
echo "*/$INTERVAL * * * *   root   /usr/bin/scout $NEW_CLIENT_KEY" &amp;gt;&amp;gt; /etc/crontab
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;When your AMIs boot up, they&amp;#8217;ll be on the cloud, and under the watch of Scout.&lt;/p&gt;</description>
      <pubDate>Thu,  3 Jul 2008 12:53:00 CDT</pubDate>
      <guid>&lt;a href="/articles/2008/07/03/monitoring-amazon-ec2-instances"&gt;Monitoring Amazon EC2 Instances&lt;/a&gt;</guid>
      <link>&lt;a href="/articles/2008/07/03/monitoring-amazon-ec2-instances"&gt;Monitoring Amazon EC2 Instances&lt;/a&gt;</link>
    </item>
  </channel>
</rss>
