<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Nuclear Rooster</title>
	<atom:link href="http://dev.nuclearrooster.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://dev.nuclearrooster.com</link>
	<description></description>
	<lastBuildDate>Thu, 17 May 2012 17:50:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Why Rackspace should (actively) play nice with Config Automation</title>
		<link>http://dev.nuclearrooster.com/2012/05/17/why-rackspace-should-actively-play-nice-with-config-automation/</link>
		<comments>http://dev.nuclearrooster.com/2012/05/17/why-rackspace-should-actively-play-nice-with-config-automation/#comments</comments>
		<pubDate>Thu, 17 May 2012 17:50:20 +0000</pubDate>
		<dc:creator>nick.stielau</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dev.nuclearrooster.com/?p=779</guid>
		<description><![CDATA[Rackspace Cloud is a popular, growing public cloud provider. From their traditional high-touch dedicated server hosting, to their Slicehost acquisition, to their OpenStack initiatives and support, Rackspace is no stranger to running an managing servers. Yet, the Rackspace Cloud leaves a lot to be desired when creating production-ready systems deployments. On the spectrum of cloud [...]]]></description>
			<content:encoded><![CDATA[<p>Rackspace Cloud is a popular, growing public cloud provider.  From their traditional<br />
high-touch dedicated server hosting, to their Slicehost acquisition, to their OpenStack<br />
initiatives and support, Rackspace is no stranger to running an managing servers. Yet,<br />
the Rackspace Cloud leaves a lot to be desired when creating production-ready systems<br />
deployments.</p>
<p>On the spectrum of cloud offerings, Rackspace is more of a dense low-hanging San Francisco<br />
fog than a whispy sirrus-stratus cloud formation: the Rackspace Cloud is very approachable<br />
to those coming from tradition server infrastructure, but it lacks many of the features<br />
essential to a true cloud-based deployment of non-trivial system infrastructre.</p>
<p>One example of this is Rackspace Cloud's faculties for interacting with Configuration<br />
Management tools like Chef, Puppet, and CFEngine.  Declarative configuration management<br />
is an essential part of large-scale deployments, wherein your systems rely on introspection<br />
and interaction, attempting to achieve the desired configuration state (even if they<br />
have to try a few times to overcome intermittant network outages or other issues).</p>
<p>One thing tools like Chef help with is to abstract away some of the differences between<br />
different cloud providers, public or private.  Rackspace cloud, for example, offers<br />
both a public and private network interface whereas Amazon's EC2 offers only a private<br />
interface along with a DNS name that routes to the private interface.  Without a tool<br />
to abstract these differences, it is painful to manage systems that span multiple cloud<br />
providers ('cloud agnostic' or 'hybrid cloud' setups).</p>
<p>In order to acheive these abstractions, Chef probes the server and network to determine<br />
which cloud provider is hosting the system.  EC2 'plays nice' with Chef, making it easy<br />
to indentify an EC2 server accuratly, tested over hundreds of thousands of server launches.<br />
Rackspace Cloud, does not make things quite so easy, and tools like Chef have to 'guess' and<br />
do not always have enough information to guess correctly, which cracks the cloud-provider<br />
abstractions and can prevent Chef from working at all.</p>
<p>It is 100% in Rackspace's interest to work with the Chef maintainers to define a better<br />
way to deterministically identify Rackspace Cloud servers.  For one thing, anybody using<br />
Chef is likely launching many servers, and more servers means more money.  And while<br />
Rackspace is probably pulling in some significant dough with their cloud services, they<br />
have some negative brand associations created by their high-touch, support-driven<br />
hierarchies.  In my mind, following up directly on <a href="http://tickets.opscode.com/browse/OHAI-344">THIS TICKET</a> or elsewhere would speak volumes,<br />
indicating that they are actually interesting in providing services for next-generations<br />
application and platform deployments, not just bringing buzzword-compliant virtualization<br />
to clients who can't afford dedicated hardware.</p>
<p>Rackspace is a major player in the public cloud arena, and thousands of customers run<br />
thousands of servers on their platform.  However, if Rackspace doesn't address the client-base<br />
that is trying to push the limits of cloud deployments, they will lose customers and thought-leadership<br />
in the long run.</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.nuclearrooster.com/2012/05/17/why-rackspace-should-actively-play-nice-with-config-automation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enable ElasticSearch TTL for Graylog2 Messages</title>
		<link>http://dev.nuclearrooster.com/2012/05/15/enable-elasticsearch-ttl-for-graylog2-messages/</link>
		<comments>http://dev.nuclearrooster.com/2012/05/15/enable-elasticsearch-ttl-for-graylog2-messages/#comments</comments>
		<pubDate>Tue, 15 May 2012 19:02:33 +0000</pubDate>
		<dc:creator>nick.stielau</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dev.nuclearrooster.com/?p=776</guid>
		<description><![CDATA[Graylog2 is a great tool to get all your logs in a single location that your entire team can use. Graylog2, as of version 0.9.6, uses the awesome Elastic Search to index messages, along with MongoDB for stream definitions, config and counters. The messages are the bulk of of the data, and indexing gobs of [...]]]></description>
			<content:encoded><![CDATA[<p>Graylog2 is a great tool to get all your logs in a single location that your entire team can use.</p>
<p>Graylog2, as of version  0.9.6, uses the awesome <a href="http://www.elasticsearch.org/">Elastic Search</a> to index messages, along with MongoDB for stream definitions, config and counters.  The messages are the bulk of of the data, and indexing gobs of data takes disk space processing power.  Elastic Search's TTL functionality makes it easy to expire messages after a predefined period.  Here's a quick rundown of how to set a default TTL for an Elastic Search 'mapping':</p>
<p><script src="https://gist.github.com/2698094.js?file=enable_ES_TLL.sh"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://dev.nuclearrooster.com/2012/05/15/enable-elasticsearch-ttl-for-graylog2-messages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Monitoring, False Dichotomy, and The Knob of Pain</title>
		<link>http://dev.nuclearrooster.com/2012/04/12/monitoring-false-dichotomy-and-the-knob-of-pain/</link>
		<comments>http://dev.nuclearrooster.com/2012/04/12/monitoring-false-dichotomy-and-the-knob-of-pain/#comments</comments>
		<pubDate>Thu, 12 Apr 2012 15:18:51 +0000</pubDate>
		<dc:creator>nick.stielau</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dev.nuclearrooster.com/?p=769</guid>
		<description><![CDATA[Launching new web services requires monitoring new web services, and despite generic components like a HTTP REST API, monitoring new services takes a bit thought (and perhaps tooling). For example, after launching a Socket.io based push notification service, I decided to monitor both the socket.io.js JavaScript file that the Node.js processes serve over HTTP, in [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://saveyourself.ca/resources/images/knob-pain-xl.jpg" width="200" style="float:left;padding:10px"/><br />
Launching new web services requires monitoring new web services, and despite generic components like a HTTP REST API, monitoring new services takes a bit thought (and perhaps tooling).  For example, after launching a Socket.io based push notification service, I decided to monitor both the socket.io.js JavaScript file that the Node.js processes serve over HTTP, in addition to a HTTP stats interface that collected some stats about connected clients and notifications sent (rather than attempting to push notifications themselves).</p>
<p>I know that it's best to <a href="http://teddziuba.com/2011/03/monitoring-theory.html"> monitor what the user interacts with</a>, but in an attempt proactively precent downtime I also want to check on some lower-level things that may precede user-facing outages. Take a standard HTTP service, with multiple processes running on multiple machines. Do you monitor the service through the load balancer (i.e. what the user sees), per machine, per port?  My answer is 'yes!', which works pretty well except for one thing.</p>
<p>My sanity and sleep, and that of my team.</p>
<p>This means we're generally alerted long before the user sees any issues, but it introduces noise into the communication channels and sleepytime pager rotation.</p>
<p>As much as I find false dichotomies distasteful ("You're either with us, or against us"), I had settled on one for monitoring: "You can either have false positive alerts, or false negative alerts, and to keep the customers happy we need to side with false positives at the cost of some pain on our side".  Good in theory, until you are generally disgruntled, bleary eyed, tired, unproductive and your heart stutters at the sound of your cellphone (even when it's probably just your mom calling).</p>
<p>The reason false dichotomies are so insidious is that they slowly reduce your perspective to a single dimension, and it's hard to break back out to the multi-dimensional perspective required to innovate. I got a chance to meet with an experienced fellow the other day, and I presented my monitoring false dichotomy.  He's response was, yeah, sometimes you're alerts will be going off like a carnival bell, but it doesn't have to stay that way.  Imagine a knob, The Knob of Pain, that you can dial up or down.  Team pissed off and burnt out on alerts? dial it back (a bit).  Team hungry, ready for some risks? Dial it up a bit.</p>
<p>Building software and infrastructure, we make tradeoffs daily.  Speed or throughput?  Availability or consistency?  Data granularity or disk space? The first issue is to understand the tradeoffs.  The next issue is to take the tradeoffs under your control, and decrease the effort and time to adjust them, as your costs, customers, resources, or appetite for risk dictate.</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.nuclearrooster.com/2012/04/12/monitoring-false-dichotomy-and-the-knob-of-pain/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sublime Text 2 Whitespace Plugin</title>
		<link>http://dev.nuclearrooster.com/2011/12/22/sublime-text-2-whitespace-plugin/</link>
		<comments>http://dev.nuclearrooster.com/2011/12/22/sublime-text-2-whitespace-plugin/#comments</comments>
		<pubDate>Thu, 22 Dec 2011 17:43:28 +0000</pubDate>
		<dc:creator>nick.stielau</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dev.nuclearrooster.com/?p=766</guid>
		<description><![CDATA[I've recently ditched Textmate in favor of Sublime Text 2. I've also recently shelved Ruby for Python, and it's pretty cool to be able to whip together some python to extend my editor. There are some tutorials for creating plugins and decent documentation, but sometimes code is worth a thousand words. I found a nice [...]]]></description>
			<content:encoded><![CDATA[<p>I've recently ditched Textmate in favor of <a href="http://www.sublimetext.com/2">Sublime Text 2</a>.  I've also recently shelved Ruby for Python, and it's pretty cool to be able to whip together some python to extend my editor.  There are some <a href="http://net.tutsplus.com/tutorials/python-tutorials/how-to-create-a-sublime-text-2-plugin/">tutorials</a> for creating plugins and <a href="http://www.sublimetext.com/docs/2/">decent documentation</a>, but sometimes code is worth a thousand words.  </p>
<p>I found a <a href="https://github.com/ehamiter/Sublime-Text-2-Plugins">nice set of plugins</a> on github from <a href="https://github.com/ehamiter">ehamiter</a> to get started with.  It's pretty easy to get the swing of things, just be prepared for a few infinite loops and force closing your editor!</p>
<p>Here's the whitespace plugin I came up with to handle three issues vital to my day-to-day development: 1) removing trailing whitespace, 2) expanding tabs, and 3) adding a single newline at the end of the file.</p>
<p>There is an out-of-the-box Sublime Text 2 command for expanding tabs, which I wanted to run on every save, so the <code>ExpandTabs</code> class is a simple pre-save handler that calls the command.  All three pre-save handlers check for a configuration settings (set via JSON preferences file), so if you don't use one it will still be light-weight.</p>
<p>This works for me, but a slightly cleaner model would be to create TextCommand actions, in addition to EventListeners that call the command, so you get the best of both worlds (call commands with key bindings, or enable event listeners).</p>
<p>To install, I simply clone to the repo into my packages directory, i.e. <code>git clone git@github.com:nstielau/Sublime-Text-2-Plugins.git /Users/nstielau/Library/Application Support/Sublime\ Text\ 2/Packages/nstielau</code>, and then can easily sync the plugins across workstations via github.</p>
<p><script src="http://gist-it.appspot.com/github/nstielau/Sublime-Text-2-Plugins/raw/master/whitespace.py"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://dev.nuclearrooster.com/2011/12/22/sublime-text-2-whitespace-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cloudkick Webhooks for Alert Trending and Jabber Notifications</title>
		<link>http://dev.nuclearrooster.com/2011/07/11/cloudkick-webhooks-for-alert-trending-and-jabber-notifications/</link>
		<comments>http://dev.nuclearrooster.com/2011/07/11/cloudkick-webhooks-for-alert-trending-and-jabber-notifications/#comments</comments>
		<pubDate>Mon, 11 Jul 2011 14:03:23 +0000</pubDate>
		<dc:creator>nick.stielau</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[devops]]></category>
		<category><![CDATA[grapite]]></category>
		<category><![CDATA[jabber]]></category>
		<category><![CDATA[monitoring]]></category>

		<guid isPermaLink="false">http://dev.nuclearrooster.com/?p=745</guid>
		<description><![CDATA[Like every monitoring solution around, Cloudkick isn't perfect. I think it's overpriced and has too much logic integrated into the web-app UI. Cloudkick does OK, just something lacking in the warm-fuzzies department. Digging into Cloudkick's Webhooks, it proves extensible enough to add some useful functionality. The worst thing a monitoring solution can try to do [...]]]></description>
			<content:encoded><![CDATA[<p>Like every <a href="https://twitter.com/#!/search/%23monitoringsucks">monitoring solution around</a>, <a href="http://www.cloudkick.com">Cloudkick</a> isn't perfect.  I think it's overpriced and has too much logic integrated into the web-app UI.   Cloudkick does OK, just something lacking in the warm-fuzzies department.  Digging into <a href="https://support.cloudkick.com/Addresses">Cloudkick's Webhooks</a>, it proves extensible enough to add some useful functionality.  The worst thing a monitoring solution can try to do is to solve <em>every</em> monitoring/alerting problem, and webhooks are a great model for adding decoupled features.</p>
<p>Two features high on my list were trending alerts ("It seems like these damn alerts are going off CONSTANTLY!") and adding Jabber notifications for alerts I didn't care about quite enough to land in my inbox.</p>
<p>Here's a small Sinatra app that makes these possible:</p>
<p><script src="https://gist.github.com/1075871.js?file=cloudkick_webhook_handlers.rb"></script></p>
<p>Run the Sinatra app somewhere (bug me and I'll release a chef cookbook for it), and add the URL as a new webhook 'Address' in Cloudkick, and then select it for all applicable 'Monitors'.</p>
<p>To test the webhook, save the example payload to a file:</p>
<p><script src="https://gist.github.com/1075871.js?file=alert_payload.json"></script></p>
<p>And use CURL to test:</p>
<p><script src="https://gist.github.com/1075871.js?file=test_webhook.sh"></script></p>
<p>Here's what the graphite graph starts to look like after a few days (using Graphite's drawNonZeroAsInfinite() data function).</p>
<p><img src="http://dev.nuclearrooster.com/wp-content/uploads/2011/07/cloudkick_to_graphite_alerts.png" alt="" title="cloudkick_to_graphite_alerts" width="586" height="308" class="aligncenter size-full wp-image-746" /></p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.nuclearrooster.com/2011/07/11/cloudkick-webhooks-for-alert-trending-and-jabber-notifications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Greppin&#8217; with Knife</title>
		<link>http://dev.nuclearrooster.com/2011/06/30/greppin-logs-with-knife/</link>
		<comments>http://dev.nuclearrooster.com/2011/06/30/greppin-logs-with-knife/#comments</comments>
		<pubDate>Thu, 30 Jun 2011 21:54:45 +0000</pubDate>
		<dc:creator>nick.stielau</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dev.nuclearrooster.com/?p=727</guid>
		<description><![CDATA["Got tight last night on absinthe and did knife tricks." -Hemingway Taking some inspiration from good ol' Ernest, I got tight on Tecate last night and did knife tricks. Check 'em out. Grep remote logs across multiple machines Tail and selectively grep logs across multiple nodes, streaming to your console: Sort nodes across a role [...]]]></description>
			<content:encoded><![CDATA[<p><img style="float:left;padding: 10px;" src="http://dev.nuclearrooster.com/wp-content/uploads/2011/06/hemmingway.jpg" alt="" title="hemmingway" width="150" /></p>
<blockquote style="font-size:22px;width:500px;"><p>"Got tight last night on absinthe and did knife tricks." -Hemingway</p></blockquote>
<p><br style="clear:both;"/></p>
<p>Taking some inspiration from good ol' Ernest, I got tight on Tecate last night and did knife tricks.  Check 'em out.</p>
<h2>Grep remote logs across multiple machines</h2>
<p>Tail and selectively grep logs across multiple nodes, streaming to your console:</p>
<pre class="brush: bash; title: ; notranslate">
# Look for 502's in Nginx
knife ssh 'role:load_balancer' 'tail -f /var/log/nginx/*.log | grep 502' 

# Tail the web app logs across all servers.
knife ssh 'role:web_app' 'tail -f /opt/web_app/logs/production.log' 

#
</pre>
<h2>Sort nodes across a role</h2>
<p>Get a glance at the state of servers with a particular role:</p>
<pre class="brush: bash; title: ; notranslate">
# Sort by 5min load average
knife ssh 'role:transcoder' 'cat /proc/loadavg | awk &quot;{print $2}&quot;' | sort -n -k 2

# Sort by uptime
knife ssh 'role:web_app' 'uptime' | sort -n -k 4

#
</pre>
<p>The other day I had the pleasure of asking Adam Jacob and Chris Brown a few questions about Chef.  Chef as a tool is great, but technical changes are easier than cultural changes, since a single person can implement technical change while the entire team has to buy in to cultural change.  Handing off Chef to the dev team, I had a question for Adam and Chris: <strong>"Should everybody on the team learn knife?"</strong>.  Their answer was <strong>"Yes."</strong>  Nobody wants to learn a new tool just for the sake of it, but knife has some pretty awesome capabilities, and learning a little might go a long way.</p>
<p>What knife tricks do you have?</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.nuclearrooster.com/2011/06/30/greppin-logs-with-knife/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Simple Chef Cookbook to Install Jenkins</title>
		<link>http://dev.nuclearrooster.com/2011/05/18/simple-chef-cookbook-to-install-jenkins/</link>
		<comments>http://dev.nuclearrooster.com/2011/05/18/simple-chef-cookbook-to-install-jenkins/#comments</comments>
		<pubDate>Wed, 18 May 2011 16:48:59 +0000</pubDate>
		<dc:creator>nick.stielau</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[abstraction]]></category>
		<category><![CDATA[Chef]]></category>
		<category><![CDATA[ci]]></category>
		<category><![CDATA[devops]]></category>
		<category><![CDATA[jenkins]]></category>

		<guid isPermaLink="false">http://dev.nuclearrooster.com/?p=711</guid>
		<description><![CDATA[Cookbooks Require Tweaking Chef Cookbooks are a great way to define server resources. You can abstract configuration across Linux distributions, creates a standardized format for defining resources, and has plenty of flexibility for configuration. Chef is pretty new on the scene, and a lot of best-practices are still being defined and refined. Here are a [...]]]></description>
			<content:encoded><![CDATA[<h3>Cookbooks Require Tweaking</h3>
<p>Chef Cookbooks are a great way to define server resources.  You can abstract configuration across Linux distributions, creates a standardized format for defining resources, and has plenty of flexibility for configuration. Chef is pretty new on the scene, and a lot of best-practices are still being defined and refined.  Here are a reason I end up tweaking all but the most trivial cookbooks.  </p>
<p><strong>1) Appropriate abstraction</strong><br />
The sweet-spot of abstraction for Chef cookbooks is a best-practice that is still unknown.  The official <a href="http://github.com/opscode/cookbooks">Opscode cookbooks</a> are meant to work for everyone, across distros, which means they are full of case statements for Fedora, RHEL, Debian, Ubuntu, etc.  This cross-distro abstraction serves a purpose, but in my world it only adds clutter.  </p>
<p>Take the Opscode Java cookbook for example, which had known bugs and oddities relating to installing OpenJDK vs. the Sun JDK.  For most circumstances, you'll only run one JDK across your entire system, and dealing with bugs to configure the Sun JDK over the default is a waste of time.  Take joy in excising unnecessary recipe abstraction.</p>
<p>Many third-party cookbooks aren't abstract enough, intermingling configuration of dependencies that you have already pulled into a separate, configurable cookbook. </p>
<p><strong>2) They run as root</strong><br />
 Additionally, you should really take a good look at anything that will run as root on your system.  </p>
<p><strong>3) My inner sysadmin is getting particular</strong><br />
Configure enough systems, and you start to get particular.  I, for example, dislike creating non-system users (users with home directories) for applications.  /home is for humans, if you ask me.  Anyway, right or wrong, I browse through new cookbooks, editing away things that would work, but don't suit to my style.</p>
<h3>Bare-bones Jenkins</h3>
<p>I wanted to install Jenkins, but the only cookbook I could find violated all three of these principles (extra clutter, runs-as-root, and did stuff I didn't like).  Granted the other cookbook has more features, but this is a good place to get started.</p>
<p><script src="https://gist.github.com/978920.js?file=default.rb"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://dev.nuclearrooster.com/2011/05/18/simple-chef-cookbook-to-install-jenkins/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Sending metrics to StatsD with a Shell One-liner</title>
		<link>http://dev.nuclearrooster.com/2011/05/11/sending-metrics-to-statsd-from-bash/</link>
		<comments>http://dev.nuclearrooster.com/2011/05/11/sending-metrics-to-statsd-from-bash/#comments</comments>
		<pubDate>Wed, 11 May 2011 17:04:25 +0000</pubDate>
		<dc:creator>nick.stielau</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[deploy]]></category>
		<category><![CDATA[devops]]></category>
		<category><![CDATA[etsy]]></category>
		<category><![CDATA[metrics]]></category>
		<category><![CDATA[release tracking]]></category>
		<category><![CDATA[statsd]]></category>

		<guid isPermaLink="false">http://dev.nuclearrooster.com/?p=694</guid>
		<description><![CDATA[Etsy's great post about tracking every release has some good tips about tracking releases with statsd and graphite (including some essential graphite config tweaks). I was wondering how to do this from within a shell script, and I had to dig through lots of StatsD code and examples to find this snippet. I forget where [...]]]></description>
			<content:encoded><![CDATA[<p>Etsy's great post about <a href="http://codeascraft.etsy.com/2010/12/08/track-every-release/">tracking every release</a> has some good tips about tracking releases with <a href="https://github.com/etsy/statsd">statsd</a> and <a href="http://graphite.wikidot.com/">graphite</a> (including some essential graphite config tweaks).  I was wondering how to do this from within a shell script, and I had to dig through lots of StatsD code and examples to find this snippet.  I forget where I eventually found it, and thought it'd make it easier to find.</p>
<p>Deploy scripts are just one place where a concise and safe way to record a metric/event in important.  From Etsy's blog, using vertical lines to represent distinct events (code deployments) to give more context to the login trends:<br />
<img src="http://etsycodeascraft.files.wordpress.com/2010/12/logins3.png?w=500&#038;h=300"/></p>
<p>Sending a metric from the command line, with netcat or curl, is just one bit of  'glue' that is essential for pulling together a complete metrics solution.  This is essentially the base-case, the lowest-common-denominator that all metrics collection can be built upon.</p>
<p>While short-and-sweet, this snippit contains two measures of protection.  First, it limits the run duration to a single second so it don't have to worry about it hanging, and secondly, it uses UDP, so you don't need to worry about the remote server being performant or even up.  True fire-and-forget, so you can recklessly drop this in scripts left and right.</p>
<p>And the bash one-liner:<br />
<script src="https://gist.github.com/966835.js?file=send_metric_to_statsd.sh"></script></p>
<p>What metrics can you collect with a one-liner?  Add some in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.nuclearrooster.com/2011/05/11/sending-metrics-to-statsd-from-bash/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Chef: Notifying and Logging Updated Resources</title>
		<link>http://dev.nuclearrooster.com/2011/05/10/chef-notifying-and-logging-updated-resources/</link>
		<comments>http://dev.nuclearrooster.com/2011/05/10/chef-notifying-and-logging-updated-resources/#comments</comments>
		<pubDate>Tue, 10 May 2011 18:03:38 +0000</pubDate>
		<dc:creator>nick.stielau</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Chef]]></category>
		<category><![CDATA[devops]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[ops]]></category>
		<category><![CDATA[OpsCode]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://dev.nuclearrooster.com/?p=688</guid>
		<description><![CDATA[Chef already logs a quite a bit of information, but it's not that useful to me, since it is difficult to wade through, and is located on each individual node. You could log to syslog and collect it centrally, but that still doesn't have the fine grain I'm looking for. Ideally, I could have an [...]]]></description>
			<content:encoded><![CDATA[<p>Chef already logs a quite a bit of information, but it's not that useful to me, since it is difficult to wade through, and is located on each individual node.  You could log to syslog and collect it centrally, but that still doesn't have the fine grain I'm looking for.  Ideally, I could have an <strong>easy way to look at watch actions were actually executed</strong> on which resources for a particular node.</p>
<p>With Chef's flexible reporting handlers and knife plugins, it's a breeze.  Kallistec pointed me towards <a href="https://github.com/danielsdeleo/nom_nom_nom">Nom Nom Nom</a>, a report-handler and redis-backed-sinatra server to collect information about a Chef-client runs.  It looks pretty nice, but Redis and Sinatra seem extraneous when Chef is already running CouchDB and a web app.</p>
<h3>Report Handler</h3>
<p>The report handler gets any resources that were updated in that Chef-client run (i.e., Chef executed commands to converge these resource), and persists some information about those resources under the node[:log] attribute.  By default it stores info about the last 10 updated resources.<br />
<script src="https://gist.github.com/964946.js?file=update_handler.rb"></script></p>
<h3>Example client.rb</h3>
<p>Here's an example client to use the new report handler.  Check out <a href="http://wiki.opscode.com/display/chef/Exception+and+Report+Handlers">the Opscode wiki page</a> for more info.<br />
<script src="https://gist.github.com/964946.js?file=example_client.rb"></script></p>
<h3>Knife Plugin</h3>
<p>Now that our nodes are persisting the data, we can use <a href="http://wiki.opscode.com/display/chef/Knife+Plugins">Chef 0.10.0's handle Knife plguins</a> to create a simple command line tool to query a node's update log.<br />
<script src="https://gist.github.com/964946.js?file=knife_log_plugin.rb"></script></p>
<h3>Ta da!</h3>
<p>And, we're logging node updates, for easy debugging.  The command line output is nicely formatted with Highline.</p>
<p>I'm also playing around with using a similar report handler to Jabber the Ops chatroom to notify about executed actions, but I'd like a little more control over what resources report changes, and haven't found a good way yet.  </p>
<p><script src="https://gist.github.com/964946.js?file=Bash%20example"></script></p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.nuclearrooster.com/2011/05/10/chef-notifying-and-logging-updated-resources/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Graylog2 is the Bee&#8217;s Knees</title>
		<link>http://dev.nuclearrooster.com/2011/04/24/graylog2-is-the-bees-knees/</link>
		<comments>http://dev.nuclearrooster.com/2011/04/24/graylog2-is-the-bees-knees/#comments</comments>
		<pubDate>Sun, 24 Apr 2011 08:07:28 +0000</pubDate>
		<dc:creator>nick.stielau</dc:creator>
				<category><![CDATA[open source]]></category>
		<category><![CDATA[devops]]></category>
		<category><![CDATA[Graylog2]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[loggly]]></category>
		<category><![CDATA[MongoDB]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[syslog]]></category>

		<guid isPermaLink="false">http://dev.nuclearrooster.com/?p=636</guid>
		<description><![CDATA[Graylog2 is a log management solution handling log collection, analytics, alerting and more. Graylog2 embodies the DevOps mentality: it combines the best parts of tried-and-true syslog with rich features for application logging, and does it all under the watchful eye of a yeti wearing a birthday hat. Graylog2 consists of a tastefully designed Rails web-interface [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.graylog2.org/">Graylog2</a> is a log management solution handling log collection, analytics, alerting and more.  Graylog2 embodies the DevOps mentality: it combines the best parts of tried-and-true <a href="http://en.wikipedia.org/wiki/Syslog">syslog</a> with rich features for application logging, and does it all under the watchful eye of a yeti wearing a birthday hat.</p>
<p><img class="aligncenter" width="310" src="http://dev.nuclearrooster.com/wp-content/uploads/2011/04/graylog2_logo.png" alt="rarrr" title="rar" /></p>
<p>Graylog2 consists of a tastefully designed Rails web-interface and a Java-based TCP/UDP log collector, using <a href="http://www.mongodb.org/">MongoDB</a> to store the log messages and application data.  Rails is a clear choice for a convenient, easy-to-extend web interface, and Java is efficient for high-traffic message collection and forwarding.  The real magic (aside from the core team) is MongoDB, which elegantly ties everything together .</p>
<p><img src="http://dev.nuclearrooster.com/wp-content/uploads/2011/04/graylog2_dash.png" class="aligncenter" width="355" alt="Graylog2 mini Dashboard" title="Graylog2 mini Dashboard"/></p>
<p>The polyglot approach, another DevOps tactic, utilizes the best tool for the job-at-hand.  Graylog2 chooses Ruby and Rails for rapid web UI development, and Java where speed and memory profile are important.  With that flexibility in mind, Graylog2 accepts messages over TCP or UDP, whichever protocol suits your needs. MongoDB makes ployglot easy, with a collection of a <a href="http://www.mongodb.org/display/DOCS/Drivers">dozen supported drivers</a> for languages from C to Scala. For Graylog2, this mean Rails and Java can talk to the same data store using updated, documented libraries.  Good clean drivers help <a href="https://github.com/Graylog2/graylog2-server/commits/master">downright</a> <a href="https://github.com/Graylog2/graylog2-web-interface/commits/master">speedy</a> development.</p>
<p><img src="http://dev.nuclearrooster.com/wp-content/uploads/2011/04/graylog2_spread.png" class="aligncenter" width="220" alt="Graylog2 Message Spread over Hosts" title="Graylog2 Message Spread over Hosts"/></p>
<p>As of version 0.9.5 Graylog2 has ditched MySQL entirely in favor MongoDB, streamlining the installation process and slimming the code base. Reducing the friction during installation is key to driving adoption for any product, and Graylog2's got a <a href="http://www.graylog2.org/download">few good options</a> for a speedy install.  MongoDB is a snap to install, too, and has a user-friendly shell, which makes it familiar for users coming from a SQL background (no required map-reduce or erlang stacktraces, Bob). If you really don't want to install MongoDB, you don't even have to thanks to <a href="https://mongohq.com/home">multiple</a> <a href="https://mongolab.com/home/">hosting</a> <a href="http://mongomachine.com/">providers</a>.</p>
<p><img src="http://dev.nuclearrooster.com/wp-content/uploads/2011/04/graylog2_entry_trend.png" alt="Graylog2 Log Entry Trends" title="Graylog2 Log Entry Trends" width="451" class="aligncenter" /></p>
<p>The Graylog Extended Log Format (<a href="http://www.graylog2.org/about/gelf">GELF</a>) improves on the standard syslog entry (a 1024 byte string) by adding the ability to specify arbitrary metadata with the log message.  This data could be the application environment, server details, debugging data, or anything else.  Mongo's document storage handles storing and indexing this data without any fuss (or awkward code forcing a schema upon arbitrary data).  No rigid schema means fewer development roadblocks and simpler upgrades, while structured data allows for advanced querying (and indexing).  It's the best of both worlds.  Check out how Graylog2's 'Quick Filter' exposes these queries:</p>
<p><img src="http://dev.nuclearrooster.com/wp-content/uploads/2011/04/graylog2_quickfilter.png" alt="Graylog2 QuickFilter Structured Data" title="Graylog2 QuickFilter Structured Data" width="418" class="aligncenter" /></p>
<p>The collection keeps a fixed number of log entries around, a text-book use-case of MongoDB's capped collection.  This means you don't have to worry about cleaning up old entries or overflowing disks.  Sure, it isn't <em>that hard</em> write a script to cleanup old entries, but the fewer moving parts, the fewer things to remember, the better (not to mention that capped-collection writes are blazing fast).  Another DevOpsy tenant: "Don't use the braintrust".  That is, if you are relying on individuals remembering issues and edge-cases, you're headed for trouble.  With Graylog2, I have to remember a whole lot less (ssh passwords, log file location, log rotation) to know the state of my apps and servers.  Graylog2's use of capped-collections gives me even less to remember (soon, there might even be room left for remembering my childhood).</p>
<p><img src="http://dev.nuclearrooster.com/wp-content/uploads/2011/04/Screen-shot-2011-04-24-at-12.15.49-AM.png" alt="Graylog2 MongoDB Capped Collection" title="Graylog2 MongoDB Capped Collection" class="aligncenter size-full" /></p>
<p>A true log-management solution, Graylog2 organizes messages into user-defined 'streams', effectively blacklists noisy messages, forwards messages to external resources, and generally makes your logs actionable.  <strong>Don't send your logs to files so they can die, send them to Graylog2 so they can come to life.</strong></p>
<p>Check out the <a href="http://www.graylog2.org/">Graylog2 website</a> or <a href="https://github.com/Graylog2">dig into the code</a>.  Hope on IRC (#graylog2 on freenode) or the mailing list (http://groups.google.com/group/graylog2?hl=en) if you need a hand getting Graylog2 configured.  </p>
<p>YETI PARTY!</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.nuclearrooster.com/2011/04/24/graylog2-is-the-bees-knees/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

