<?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/"
	>

<channel>
	<title>arfore dot com</title>
	<atom:link href="http://arfore.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://arfore.com/blog</link>
	<description>welcome to the foremind</description>
	<pubDate>Thu, 18 Dec 2008 01:55:35 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>VNC on the AppleTV</title>
		<link>http://arfore.com/blog/2008/12/10/vnc-on-the-appletv/</link>
		<comments>http://arfore.com/blog/2008/12/10/vnc-on-the-appletv/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 02:49:26 +0000</pubDate>
		<dc:creator>Andy Fore</dc:creator>
		
		<category><![CDATA[Apple TV]]></category>

		<guid isPermaLink="false">http://arfore.com/blog/?p=142</guid>
		<description><![CDATA[Over Thanksgiving break I bought an Apple TV.  Like any good geek I wanted to expand the capability of the unit beyond the default setup.
After installing Firefox and getting USB keyboard and mouse support going, I realized that it would be tremendously cool if I could control it from my iPhone instead of using a [...]]]></description>
			<content:encoded><![CDATA[<p>Over Thanksgiving break I bought an Apple TV.  Like any good geek I wanted to expand the capability of the unit beyond the default setup.</p>
<p>After installing Firefox and getting USB keyboard and mouse support going, I realized that it would be tremendously cool if I could control it from my iPhone instead of using a wired keyboard.</p>
<p>To begin with I installed OSXvnc.  The only problem was that I needed to store a password.  After reading a the <a title="Working VNC: AppleTV 2.3, aTV Flash 3.4.1, iPhone 2.2 (5G77)" href="http://forum.atvflash.com/viewtopic.php?f=6&amp;t=707" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://forum.atvflash.com/viewtopic.php?f=6&amp;t=707');">VNC post on the aTV Flash forum</a>, I successfully conquered that.  However, I had the same problem that iMattUK had: you had to use an ssh connection to start it.</p>
<p>To conquer this I wrote a launchd plist to launch OSXvnc for me at system startup.  Below is the process I used to get it all working.</p>
<h3>Install OSXvnc</h3>
<ol>
<li>Download <a title="Vine Server project page" href="http://sourceforge.net/projects/osxvnc/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://sourceforge.net/projects/osxvnc/');">Vine Server (OSXvnc)</a>.</li>
<li>SFTP/FTP/SCP Vine Server.app to the Documents directory in /Users/frontrow/ on the Apple TV.</li>
<li>SSH to the Apple TV and run the following commands:
<ol>
<li>cd Documents</li>
<li>cd Vine\ Server.app</li>
<li>./storepasswd YOURPASSWORD /Users/frontrow/vncpasswd</li>
<li>cp Contents/Resources/OSXvnc-server /Users/frontrow/Applications</li>
</ol>
</li>
</ol>
<h3>Setup Autostart</h3>
<p>This next part is a little complicated if you haven&#8217;t done it before.  On OS X 10.4 Apple did away with the traditional Unix methods of starting daemons at system start.  The new method they implemented is called <a title="Getting Started with launchd" href="http://developer.apple.com/MacOsX/launchd.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://developer.apple.com/MacOsX/launchd.html');">launchd</a>.</p>
<p>What you need to do is to create a launchd plist to start the VNC server.  Since vi is not included on the Apple TV you will need to create this file on your computer and upload it.</p>
<p>Here&#8217;s the meaty content of my launchd plist:</p>
<p>&lt;key&gt;Label&lt;/key&gt;<br />
&lt;string&gt;com.arfore.VNC&lt;/string&gt;<br />
&lt;key&gt;OnDemand&lt;/key&gt;<br />
&lt;false/&gt;<br />
&lt;key&gt;RunAtLoad&lt;/key&gt;<br />
&lt;true /&gt;<br />
&lt;key&gt;ProgramArguments&lt;/key&gt;<br />
&lt;array&gt;<br />
&lt;string&gt;/Users/frontrow/Applications/OSXvnc-server&lt;/string&gt;<br />
&lt;string&gt;-protocol&lt;/string&gt;<br />
&lt;string&gt;3.3&lt;/string&gt;<br />
&lt;string&gt;-rendezvous&lt;/string&gt;<br />
&lt;string&gt;Y&lt;/string&gt;<br />
&lt;string&gt;-rfbauth&lt;/string&gt;<br />
&lt;string&gt;/Users/frontrow/vncpasswd&lt;/string&gt;<br />
&lt;/array&gt;</p>
<p>Here&#8217;s the entire plist:</p>
<p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;<br />
&lt;!DOCTYPE plist PUBLIC &#8220;-//Apple Computer//DTD PLIST 1.0//EN&#8221; &#8220;http://www.apple.com/DTDs/PropertyList-1.0.dtd&#8221;&gt;<br />
&lt;plist version=&#8221;1.0&#8243;&gt;<br />
&lt;dict&gt;<br />
&lt;key&gt;Label&lt;/key&gt;<br />
&lt;string&gt;com.arfore.VNC&lt;/string&gt;<br />
&lt;key&gt;OnDemand&lt;/key&gt;<br />
&lt;false/&gt;<br />
&lt;key&gt;RunAtLoad&lt;/key&gt;<br />
&lt;true /&gt;<br />
&lt;key&gt;ProgramArguments&lt;/key&gt;<br />
&lt;array&gt;<br />
&lt;string&gt;/Users/frontrow/Applications/OSXvnc-server&lt;/string&gt;<br />
&lt;string&gt;-protocol&lt;/string&gt;<br />
&lt;string&gt;3.3&lt;/string&gt;<br />
&lt;string&gt;-rendezvous&lt;/string&gt;<br />
&lt;string&gt;Y&lt;/string&gt;<br />
&lt;string&gt;-rfbauth&lt;/string&gt;<br />
&lt;string&gt;/Users/frontrow/vncpasswd&lt;/string&gt;<br />
&lt;/array&gt;<br />
&lt;/dict&gt;<br />
&lt;/plist&gt;</p>
<p><a title="OSXvnc server launchd plist" href="http://arfore.com/files/com.OSXvnc.plist.zip" onclick="javascript:pageTracker._trackPageview('/files/files/com.OSXvnc.plist.zip');">Download the plist here.</a></p>
<p>Here&#8217;s how to put it in place:</p>
<ol>
<li>Take the text above and save it in a file called <strong>com.OSXvnc.plist</strong></li>
<li>SFTP/FTP/SCP the file to the Documents directory in /Users/frontrow/ on the Apple TV</li>
<li>SSH into the Apple TV and run the following commands:
<ol>
<li>sudo cp /Users/frontrow/com.OSXvnc.plist /System/Library/LaunchDaemons/</li>
<li>sudo reboot</li>
</ol>
</li>
</ol>
<p>At this point your Apple TV will be rebooted.  After it comes back up use the VNC viewer of your choice to connect to AppleTV.local on port 5900.  You should see the screen.</p>
<p>This is not really useful to control the FrontRow interface, but it works great to control Firefox or EyeTV.</p>
<p><em>Thanks to iMattUK for the tip on storing the password for OSXvnc-server.</em></p>
<p><em><strong>Update (2008-12-17):</strong></em> The problem that was plaguing Bill has to do with the difference between the filesystem view when using FTP vs. SFTP.  When logging in via FTP you don&#8217;t actually get access to the whole filesystem.  In order to access the /System/Library/LaunchDaemons/ directory you have to use SFTP.</p>
]]></content:encoded>
			<wfw:commentRss>http://arfore.com/blog/2008/12/10/vnc-on-the-appletv/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Migrating WordPress</title>
		<link>http://arfore.com/blog/2008/11/17/migrating-wordpress/</link>
		<comments>http://arfore.com/blog/2008/11/17/migrating-wordpress/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 03:37:38 +0000</pubDate>
		<dc:creator>Andy Fore</dc:creator>
		
		<category><![CDATA[arfore.com]]></category>

		<guid isPermaLink="false">http://arfore.com/blog/?p=140</guid>
		<description><![CDATA[As some of you might have noticed, I have just recently moved my WordPress installation into a subdirectory of arfore.com.
There are several reasons for this, the main one being that I would like for my blog to become a component of my website rather than the blog being the entire site.
Moving the WordPress installation itself [...]]]></description>
			<content:encoded><![CDATA[<p>As some of you might have noticed, I have just recently moved my WordPress installation into a subdirectory of arfore.com.</p>
<p>There are several reasons for this, the main one being that I would like for my blog to become a component of my website rather than the blog being the entire site.</p>
<p>Moving the WordPress installation itself was quite simple, and there are many pages out there describing the process as well as the pitfalls of doing it incorrectly, so I won&#8217;t repeat them here.</p>
<p>What was less easy to find was the proper changes to put in the <code>.htaccess</code> file to ensure that any existing links would get redirected to the proper location in the moved WordPress setup.</p>
<p>I have my permalinks configured to create a URL like follows:</p>
<p style="padding-left: 30px;"><code>http://arfore.com/blog/2008/10/12/foo-bar-baz/</code></p>
<p>In order to add the subdirectory blog to the front of the URL I used the following rule in my <code>.htaccess</code> file:</p>
<p style="padding-left: 30px;"><code>RewriteRule ^([0-9](.*))$ http://arfore.com/blog/$1 [R=301,L]</code></p>
<p>Similarly, to redirect the categories I used the following:</p>
<p style="padding-left: 30px;"><code>RewriteRule ^category/(.*)$ http://arfore.com/blog/category/$1 [R=301,L]</code></p>
<p>Now this may not be the most correct method to accomplish the goal, so if it needs correcting by all means let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://arfore.com/blog/2008/11/17/migrating-wordpress/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Checking OS X services using Nagios</title>
		<link>http://arfore.com/blog/2008/11/07/checking-os-x-services-using-nagios/</link>
		<comments>http://arfore.com/blog/2008/11/07/checking-os-x-services-using-nagios/#comments</comments>
		<pubDate>Fri, 07 Nov 2008 13:29:07 +0000</pubDate>
		<dc:creator>Andy Fore</dc:creator>
		
		<category><![CDATA[Mac OS X Server]]></category>

		<category><![CDATA[Nagios]]></category>

		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://arfore.com/?p=139</guid>
		<description><![CDATA[My last two posts, Starting NRPE via launchd and Nagios NRPE on OS X Server 10.5, concerned getting NRPE to run on OS X Server 10.5 and having it startup at system boot.
However, this is only part of the battle.  Once you have Nagios monitoring setup on your server you also need to have some [...]]]></description>
			<content:encoded><![CDATA[<p>My last two posts, <a href="http://arfore.com/2008/10/12/starting-nrpe-via-launchd/" >Starting NRPE via launchd</a> and <a href="http://arfore.com/2008/09/25/nagios-nrpe-on-os-x-server-105/" >Nagios NRPE on OS X Server 10.5</a>, concerned getting NRPE to run on OS X Server 10.5 and having it startup at system boot.</p>
<p>However, this is only part of the battle.  Once you have Nagios monitoring setup on your server you also need to have some nice options for checking the availability of your running services.</p>
<p>Tim Wilson from the <a href="http://technosavvy.org/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://technosavvy.org/');">Savvy Technologist</a>, wrote an NRPE plugin that helps out with this.  The plugin <a href="http://www.nagiosexchange.org/cgi-bin/page.cgi?g=Detailed%2F1497.html;d=1" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.nagiosexchange.org/cgi-bin/page.cgi?g=Detailed%2F1497.html;d=1');">check_osx_services</a> does an excellent job of checking on the status for many services running on 10.5 Server.</p>
<p>The documentation on the plugin at the NagiosExchange site is pretty thorough.  One thing that is not mentioned is that you will need to run the check_osx_services script as superuser since it calls the system level command <em>serveradmin</em> which must be run as root.</p>
]]></content:encoded>
			<wfw:commentRss>http://arfore.com/blog/2008/11/07/checking-os-x-services-using-nagios/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Starting NRPE via launchd</title>
		<link>http://arfore.com/blog/2008/10/12/starting-nrpe-via-launchd/</link>
		<comments>http://arfore.com/blog/2008/10/12/starting-nrpe-via-launchd/#comments</comments>
		<pubDate>Sun, 12 Oct 2008 16:33:01 +0000</pubDate>
		<dc:creator>Andy Fore</dc:creator>
		
		<category><![CDATA[Mac OS X Server]]></category>

		<category><![CDATA[Nagios]]></category>

		<guid isPermaLink="false">http://arfore.com/?p=138</guid>
		<description><![CDATA[Last week I posted on how to setup NRPE on Mac OS X Server.  Here is what you need to do to make it start up at system boot.
On a Linux or Solaris machine you can just include the call to the daemon in an init script like rc.local and it will be started when [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I posted on how to <a href="http://arfore.com/2008/09/25/nagios-nrpe-on-os-x-server-105/" >setup NRPE on Mac OS X Server</a>.  Here is what you need to do to make it start up at system boot.</p>
<p>On a Linux or Solaris machine you can just include the call to the daemon in an init script like rc.local and it will be started when the OS boots.  Unfortunately, Apple has made this a little more difficult on Mac OS X with Tiger and Leopard.  The standard startup processes (cron, inetd, xinetd, etc.) have been rolled into a single process known as launchd.</p>
<p><span id="more-138"></span></p>
<p>The first step is to create a symbolic link to the NRPE config file from the default location to the root of the NRPE directory.</p>
<ol>
<li>cd /usr/local/nagios/</li>
<li>ln -s etc/nrpe.cfg nrpe.cfg</li>
</ol>
<p>The next setp is to ensure that the NRPE daemon will be able to connect with Nagios server.  There are two ways to do this.  One way is to add a line to the <code>/etc/services</code> file to allow for an open port for NRPE.  The second way is to open the port as part of the launchd process.</p>
<p>Method One - edit the /etc/services file</p>
<ol>
<li>cd /etc/</li>
<li>sudo vi /etc/services</li>
<li>add the following line to the end of the file:<br />
5666/tcp # Nagios NRPE client</li>
</ol>
<p>Method Two - use the launchd process</p>
<p>This method involves including a dictionary key into the launchd plist file that sets the socket type and port number for the NRPE service to use for listening.  The plist code is shown below:</p>
<p>&lt;key&gt;Sockets&lt;/key&gt;<br />
&lt;dict&gt;<br />
&lt;key&gt;Listeners&lt;/key&gt;<br />
&lt;dict&gt;<br />
&lt;key&gt;SockServiceName&lt;/key&gt;<br />
&lt;string&gt;5666&lt;/string&gt;<br />
&lt;key&gt;SockType&lt;/key&gt;<br />
&lt;string&gt;stream&lt;/string&gt;<br />
&lt;key&gt;SockFamily&lt;/key&gt;<br />
&lt;string&gt;IPv4&lt;/string&gt;<br />
&lt;/dict&gt;<br />
&lt;/dict&gt;</p>
<p>The rest of setting up the plist is required to make the process work.  Here is a copy of my entire plist:</p>
<p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;<br />
&lt;!DOCTYPE plist PUBLIC &#8220;-//Apple//DTD PLIST 1.0//EN&#8221; &#8220;http://www.apple.com/DTDs/PropertyList-1.0.dtd&#8221;&gt;<br />
&lt;plist version=&#8221;1.0&#8243;&gt;<br />
&lt;dict&gt;<br />
&lt;key&gt;KeepAlive&lt;/key&gt;<br />
&lt;dict&gt;<br />
&lt;key&gt;NetworkState&lt;/key&gt;<br />
&lt;true/&gt;<br />
&lt;/dict&gt;<br />
&lt;key&gt;UserName&lt;/key&gt;<br />
&lt;string&gt;nagios&lt;/string&gt;<br />
&lt;key&gt;GroupName&lt;/key&gt;<br />
&lt;string&gt;nagios&lt;/string&gt;<br />
&lt;key&gt;Program&lt;/key&gt;<br />
&lt;string&gt;/usr/local/nagios/bin/nrpe&lt;/string&gt;<br />
&lt;key&gt;ProgramArguments&lt;/key&gt;<br />
&lt;array&gt;<br />
&lt;string&gt;-c&lt;/string&gt;<br />
&lt;string&gt;/usr/local/nagios/etc/nrpe.cfg&lt;/string&gt;<br />
&lt;string&gt;-i&lt;/string&gt;<br />
&lt;/array&gt;<br />
&lt;key&gt;Sockets&lt;/key&gt;<br />
&lt;dict&gt;<br />
&lt;key&gt;Listeners&lt;/key&gt;<br />
&lt;dict&gt;<br />
&lt;key&gt;SockServiceName&lt;/key&gt;<br />
&lt;string&gt;5666&lt;/string&gt;<br />
&lt;key&gt;SockType&lt;/key&gt;<br />
&lt;string&gt;stream&lt;/string&gt;<br />
&lt;key&gt;SockFamily&lt;/key&gt;<br />
&lt;string&gt;IPv4&lt;/string&gt;<br />
&lt;/dict&gt;<br />
&lt;/dict&gt;<br />
&lt;key&gt;inetdCompatibility&lt;/key&gt;<br />
&lt;dict&gt;<br />
&lt;key&gt;Wait&lt;/key&gt;<br />
&lt;false/&gt;<br />
&lt;/dict&gt;<br />
&lt;key&gt;Label&lt;/key&gt;<br />
&lt;string&gt;org.nagios.nrpe&lt;/string&gt;<br />
&lt;/dict&gt;<br />
&lt;/plist&gt;</p>
<p>Copy the above code into a text file and name it nrpe.plist and copy it into the /Library/LaunchDaemons/ directory.  You can manually start the service by executing the following commands:</p>
<ol>
<li>sudo launchctl load /Library/LaunchDaemons/nrpe.plist</li>
<li>sudo launchctl start org.nagios.nrpe</li>
</ol>
<p><a href="http://arfore.com/files/nrpe.plist.zip" onclick="javascript:pageTracker._trackPageview('/files/files/nrpe.plist.zip');">Download the plist file here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://arfore.com/blog/2008/10/12/starting-nrpe-via-launchd/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Nagios NRPE on OS X Server 10.5</title>
		<link>http://arfore.com/blog/2008/09/25/nagios-nrpe-on-os-x-server-105/</link>
		<comments>http://arfore.com/blog/2008/09/25/nagios-nrpe-on-os-x-server-105/#comments</comments>
		<pubDate>Thu, 25 Sep 2008 16:39:02 +0000</pubDate>
		<dc:creator>Andy Fore</dc:creator>
		
		<category><![CDATA[Mac OS X Server]]></category>

		<category><![CDATA[Nagios]]></category>

		<guid isPermaLink="false">http://arfore.com/?p=137</guid>
		<description><![CDATA[Recently I was tasked to install the Nagios add-on NRPE on two OS X 10.5 servers.
I read a little on the &#8216;net about it, but no one actually had much in the way of a walkthrough, so I thought I would fill the void.
The basic steps involve compiling the NRPE source, but doing so involves [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I was tasked to install the Nagios add-on NRPE on two OS X 10.5 servers.</p>
<p>I read a little on the &#8216;net about it, but no one actually had much in the way of a walkthrough, so I thought I would fill the void.</p>
<p>The basic steps involve compiling the NRPE source, but doing so involves altering some of the code.</p>
<p><span id="more-137"></span></p>
<h5>Prerequisites</h5>
<ol>
<li>Mac OS X Developer Tools</li>
</ol>
<h5>Requirements</h5>
<ol>
<li>NRPE source code</li>
<li>Nagios Plugin source code</li>
</ol>
<h5>Setup the environment</h5>
<ol>
<li>Install OS X Developer Tools</li>
<li>Create the nagios user using Workgroup Manager</li>
<li>Create the nagios group using Workgroup Manager</li>
<li>Change the primary group for the nagios user to be nagios</li>
</ol>
<h5>Compile and Install the Nagios Plugins</h5>
<ol>
<li>Open Terminal (/Applications/Utilities/Terminal.app)</li>
<li>cd ~/Downloads/ <em>- see note 1</em></li>
<li>Extract the Nagios plugins source code tarball
<ul>
<li>tar xvf nagios-plugins-1.4.13.tar.gz</li>
<li>cd nagios-plugins-1.4.13</li>
</ul>
</li>
<li>Compile and install the plugins
<ul>
<li>./configure</li>
<li>make</li>
<li>sudo make install</li>
</ul>
</li>
<li>Update the permissions on the directories
<ul>
<li>sudo chown nagios:nagios /usr/local/nagios</li>
<li>sudo chown -R nagios:nagios /usr/local/nagios/libexec</li>
</ul>
</li>
</ol>
<h5>Compile and Install the NRPE daemon</h5>
<ol>
<li>cd ~/Downloads/ <em>- see note 1</em></li>
<li>Extract the NRPE source code tarball
<ul>
<li>tar xvf nrpe-2.12.tar.gz</li>
<li>cd nrpe-2.12</li>
</ul>
</li>
<li>Update the configure file for Mac OS X compatibility
<ul>
<li>vim ./configure</li>
<li>on line 6673 change the text to read
<ul>
<li>if test -f &#8220;$dir/libssl.dylib&#8221;; then</li>
</ul>
</li>
</ul>
</li>
<li>Compile the NRPE daemon
<ul>
<li>./configure</li>
<li>make all</li>
</ul>
</li>
<li>Install the NRPE plugin, dameon and example config file
<ul>
<li>sudo make install-plugin</li>
<li>sudo make install-daemon</li>
<li>sudo make install-daemon-config</li>
</ul>
</li>
</ol>
<p>At this point you will have the NRPE daemon itself correctly installed.  To run it just execute the following in a terminal:</p>
<p style="padding-left: 30px;">/usr/local/nagios/bin/nrpe -c path/to/config -d</p>
<p>This will start the daemon using your config file in daemon mode, instead of xinetd mode.</p>
<p>In order to get the daemon to startup at system boot you will need to create a launchd plist.  I will be writing this up for post later today.</p>
]]></content:encoded>
			<wfw:commentRss>http://arfore.com/blog/2008/09/25/nagios-nrpe-on-os-x-server-105/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
