<?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>Brain Matters &#187; arcana</title>
	<atom:link href="http://blog.agoragames.com/tag/arcana/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.agoragames.com</link>
	<description></description>
	<lastBuildDate>Mon, 16 Aug 2010 19:36:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Watching Trees</title>
		<link>http://blog.agoragames.com/2010/02/23/watching-trees/</link>
		<comments>http://blog.agoragames.com/2010/02/23/watching-trees/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 13:43:00 +0000</pubDate>
		<dc:creator>Jason LaPorte</dc:creator>
				<category><![CDATA[Engineering]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[arcana]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://blog.agoragames.com/?p=474</guid>
		<description><![CDATA[As a SysAdmin, my job more-or-less exists by knowing miscellaneous arcana that most software engineers aren&#8217;t aware of.
When a particular co-worker here at Agora has a problem with his Linux machine, I provide advice and show him how to fix it. Some months after he had joined Agora, I discovered that after each troubleshooting session, [...]]]></description>
			<content:encoded><![CDATA[<p>As a SysAdmin, my job more-or-less exists by knowing miscellaneous arcana that most software engineers aren&#8217;t aware of.</p>
<p>When a particular co-worker here at Agora has a problem with his Linux machine, I provide advice and show him how to fix it. Some months after he had joined Agora, I discovered that after each troubleshooting session, he copy-and-pastes the entire text terminal log into a text file that he keeps on his desktop. He has dozens of transcripts at this point; I bet if I were to look through it, it would read something like the Tao te Ching or Bhagavad Gita, only concerning UNIX instead of right living.</p>
<p>(Of course, there&#8217;s not much of a difference between UNIX and right living, but that&#8217;s a topic for another day.)</p>
<p>In the spirit of allowing you to build your own little collection, here is a simple trick that came in handy to me yesterday.</p>
<p><span id="more-474"></span>Last night, the cron jobs powering one of our managed sites stopped running. I had stopped them, cleaned up, and restarted them, but I wanted to watch the system and see if they had started running again so I could monitor that they were doing their job.</p>
<p>UNIX has a well-known command called &#8220;<a href="http://linux.die.net/man/1/top" target="_blank">top</a>,&#8221; which shows superlative processes running on your system: which ones are consuming the most CPU time, which ones are consuming the most RAM, which ones have been running the longest, and so on. It&#8217;s a very useful tool, but if you&#8217;re trying to track down processes over time that don&#8217;t necessarily consume very many resources, then it&#8217;s not the tool you&#8217;re looking for.</p>
<p>However, our Linux distribution (and, indeed, most others) provide a useful graphical tool for mapping the current state of the system: &#8220;<a href="http://linux.die.net/man/1/pstree" target="_blank">pstree</a>.&#8221; This command will give you a list of processes (much like the &#8220;<a href="http://linux.die.net/man/1/ps" target="_blank">ps</a>&#8221; command), except that instead of generating a list, it will draw a little tree showing the state of the system. This is perfect for seeing exactly what is going on: which daemons are running, who is on the system and what they&#8217;re executing, and so on. However, it doesn&#8217;t show you what is happening over time; it merely lists what is happening at this moment.</p>
<p>However, our Linux distribution (and, indeed, most others) provides yet another useful tool: &#8220;<a href="http://linux.die.net/man/1/watch" target="_blank">watch</a>.&#8221; It runs a program every 2 seconds (by default) and displays the result to your screen. This allows you to make a ghetto clock by writing something like &#8220;watch <a href="http://linux.die.net/man/1/date" target="_blank">date</a>;&#8221; in our case, we could make a ghetto graphical &#8220;top&#8221; by writing the simple &#8220;watch pstree.&#8221; You can now watch your virtual trees rustle in the wind.</p>
<p>It kept us on top of the cron job, and things were back to normal in no time.</p>
<p>For more information, RTFM. :)</p>




	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fblog.agoragames.com%2F2010%2F02%2F23%2Fwatching-trees%2F&amp;title=Watching%20Trees" title="Reddit"><img src="http://blog.agoragames.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fblog.agoragames.com%2F2010%2F02%2F23%2Fwatching-trees%2F&amp;title=Watching%20Trees&amp;bodytext=As%20a%20SysAdmin%2C%20my%20job%20more-or-less%20exists%20by%20knowing%20miscellaneous%20arcana%20that%20most%20software%20engineers%20aren%27t%20aware%20of.%0D%0A%0D%0AWhen%20a%20particular%20co-worker%20here%20at%20Agora%20has%20a%20problem%20with%20his%20Linux%20machine%2C%20I%20provide%20advice%20and%20show%20him%20how%20to%20fix%20it.%20So" title="Digg"><img src="http://blog.agoragames.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fblog.agoragames.com%2F2010%2F02%2F23%2Fwatching-trees%2F&amp;title=Watching%20Trees&amp;notes=As%20a%20SysAdmin%2C%20my%20job%20more-or-less%20exists%20by%20knowing%20miscellaneous%20arcana%20that%20most%20software%20engineers%20aren%27t%20aware%20of.%0D%0A%0D%0AWhen%20a%20particular%20co-worker%20here%20at%20Agora%20has%20a%20problem%20with%20his%20Linux%20machine%2C%20I%20provide%20advice%20and%20show%20him%20how%20to%20fix%20it.%20So" title="del.icio.us"><img src="http://blog.agoragames.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblog.agoragames.com%2F2010%2F02%2F23%2Fwatching-trees%2F&amp;t=Watching%20Trees" title="Facebook"><img src="http://blog.agoragames.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fblog.agoragames.com%2F2010%2F02%2F23%2Fwatching-trees%2F&amp;t=Watching%20Trees&amp;s=As%20a%20SysAdmin%2C%20my%20job%20more-or-less%20exists%20by%20knowing%20miscellaneous%20arcana%20that%20most%20software%20engineers%20aren%27t%20aware%20of.%0D%0A%0D%0AWhen%20a%20particular%20co-worker%20here%20at%20Agora%20has%20a%20problem%20with%20his%20Linux%20machine%2C%20I%20provide%20advice%20and%20show%20him%20how%20to%20fix%20it.%20So" title="Tumblr"><img src="http://blog.agoragames.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Watching%20Trees%20-%20http%3A%2F%2Fblog.agoragames.com%2F2010%2F02%2F23%2Fwatching-trees%2F" title="Twitter"><img src="http://blog.agoragames.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://blog.agoragames.com/2010/02/23/watching-trees/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->