<?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>EdVoncken.NET</title>
	<atom:link href="http://edvoncken.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://edvoncken.net</link>
	<description>(beta)</description>
	<lastBuildDate>Tue, 15 May 2012 21:01:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Happy Birthday, Koetje ;-)</title>
		<link>http://edvoncken.net/2012/05/happy-birthday-koetje/</link>
		<comments>http://edvoncken.net/2012/05/happy-birthday-koetje/#comments</comments>
		<pubDate>Tue, 15 May 2012 21:01:12 +0000</pubDate>
		<dc:creator>Ed Voncken</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://edvoncken.net/?p=1554</guid>
		<description><![CDATA[<p>Vandaag viert Koetje alweer haar tweede verjaardag &#8211; de tijd vliegt.</p>
<p>Ze hangt wel eens in de gordijnen, soms probeert ze Bommel te vangen maar eigenlijk is ze heel lief. Blacky en Koetje kunnen het heel erg goed vinden, dus het is een gezellige beestenboel met onze 3 katten&#8230;</p>
<p></p>
<p>Hier is ze in de weer met een duivenveer die ze in de tuin gevonden heeft &#8211; blijkbaar héél interessant!</p>
<p>♫ Happy Birthday to Koe,
Happy Birthday to Koe&#8230; ♫</p>
]]></description>
			<content:encoded><![CDATA[<p>Vandaag viert Koetje alweer haar tweede verjaardag &#8211; de tijd vliegt.</p>
<p>Ze hangt wel eens in de gordijnen, soms probeert ze Bommel te vangen maar eigenlijk is ze heel lief. Blacky en Koetje kunnen het heel erg goed vinden, dus het is een gezellige beestenboel met onze 3 katten&#8230;</p>
<p><a href="http://edvoncken.net/wp-content/uploads/2012/05/IMG_31501.jpg"><img class="alignnone size-large wp-image-1557" title="IMG_3150" src="http://edvoncken.net/wp-content/uploads/2012/05/IMG_31501-1024x767.jpg" alt="" width="100%" /></a></p>
<p>Hier is ze in de weer met een duivenveer die ze in de tuin gevonden heeft &#8211; blijkbaar héél interessant!</p>
<p>♫ Happy Birthday to Koe,<br />
Happy Birthday to Koe&#8230; ♫</p>
]]></content:encoded>
			<wfw:commentRss>http://edvoncken.net/2012/05/happy-birthday-koetje/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Workaround for Nagios check_linux_raid failure in RHEL / CentOS 6.2</title>
		<link>http://edvoncken.net/2012/05/workaround-for-nagios-check_linux_raid-failure-in-rhel-centos-6-2/</link>
		<comments>http://edvoncken.net/2012/05/workaround-for-nagios-check_linux_raid-failure-in-rhel-centos-6-2/#comments</comments>
		<pubDate>Tue, 08 May 2012 19:18:27 +0000</pubDate>
		<dc:creator>Ed Voncken</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[nagios]]></category>
		<category><![CDATA[Red Hat]]></category>
		<category><![CDATA[selinux]]></category>

		<guid isPermaLink="false">http://edvoncken.net/?p=1547</guid>
		<description><![CDATA[<p>I recently stumbled upon another Nagios plugin that no longer works with SELinux under RHEL / CentOS 6.2: check_linux_raid.</p>
<p>Just like the check_disk plugin, it has the nagios_checkdisk_plugin_exec_t SELinux type. As of May 2012, this problem has not yet been fixed.</p>
<p>The workaround is simple, as with the check_disk plugin:</p>

chcon -t nagios_unconfined_plugin_exec_t /usr/lib64/nagios/plugins/check_linux_raid

<p>Or, for 32-bit systems:</p>

chcon -t nagios_unconfined_plugin_exec_t /usr/lib/nagios/plugins/check_linux_raid

]]></description>
			<content:encoded><![CDATA[<p>I recently stumbled upon another Nagios plugin that no longer works with SELinux under RHEL / CentOS 6.2: <tt>check_linux_raid</tt>.</p>
<p>Just like the check_disk plugin, it has the <tt>nagios_checkdisk_plugin_exec_t</tt> SELinux type. As of May 2012, this problem has not yet been fixed.</p>
<p>The workaround is simple, as with the <tt>check_disk</tt> plugin:</p>
<blockquote>
<pre>chcon -t nagios_unconfined_plugin_exec_t /usr/lib64/nagios/plugins/check_linux_raid</pre>
</blockquote>
<p>Or, for 32-bit systems:</p>
<blockquote>
<pre>chcon -t nagios_unconfined_plugin_exec_t /usr/lib/nagios/plugins/check_linux_raid</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://edvoncken.net/2012/05/workaround-for-nagios-check_linux_raid-failure-in-rhel-centos-6-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FreeNAS on HP ProLiant MicroServer N40L</title>
		<link>http://edvoncken.net/2012/05/freenas-on-hp-proliant-microserver-n40l/</link>
		<comments>http://edvoncken.net/2012/05/freenas-on-hp-proliant-microserver-n40l/#comments</comments>
		<pubDate>Tue, 01 May 2012 19:44:00 +0000</pubDate>
		<dc:creator>Ed Voncken</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[EN]]></category>
		<category><![CDATA[FreeNAS]]></category>
		<category><![CDATA[Tech@Home]]></category>

		<guid isPermaLink="false">http://edvoncken.net/?p=1525</guid>
		<description><![CDATA[<p>After the NLUUG presentation on FreeNAS, I bit the bullet and bought the HP MicroServer N40L for experimentation. A small and quiet server, with 4 HDD slots that make for a nice NAS setup. Of course, the system has limited CPU power but it should be enough for basic file serving.</p>
Hardware
<p>I decided to install a low-profile Intel NIC and upgrade the RAM memory to run ZFS comfortably.</p>
<p>HP have published some videos on (dis-)assembling the server, making the job a lot easier. There was only one issue: the mini-SAS connector is a pain to remove. Some Googling later, I found this <i>[...]<p>Continue reading <a href="http://edvoncken.net/2012/05/freenas-on-hp-proliant-microserver-n40l/">FreeNAS on HP ProLiant MicroServer N40L</a></p></i>]]></description>
			<content:encoded><![CDATA[<p>After the NLUUG presentation on FreeNAS, I bit the bullet and bought the HP MicroServer N40L for experimentation. A small and quiet server, with 4 HDD slots that make for a nice NAS setup. Of course, the system has limited CPU power but it should be enough for basic file serving.</p>
<h2>Hardware</h2>
<p>I decided to install a low-profile Intel NIC and upgrade the RAM memory to run ZFS comfortably.</p>
<p>HP have <a title="HP Support Center - Part Replacement Instructions / Videos" href="https://h20565.www2.hp.com/portal/site/hpsc/public/psi/partReplaceResults/?sp4ts.oid=4248009" target="_blank">published some videos</a> on (dis-)assembling the server, making the job a lot easier. There was only one issue: the mini-SAS connector is a pain to remove. Some Googling later, I found <a href="http://slickdeals.net/forums/showpost.php?s=10b8ec1590e7f63e7b933be7eae2d57b&amp;p=46667098&amp;postcount=156" target="_blank">this post</a>:</p>
<p><em>    To unplug a Mini-SAS x4 cable, squeeze the clip on the plug, then push the plug in before pulling it out.</em> (Source: <a title="Unplugging the mini-SAS connector" href="http://docs.oracle.com/cd/E19591-01/820-4932/installation.html" rel="nofollow" target="_blank">Oracle</a>)</p>
<p>ZFS is very RAM-hungry, so I installed 2x 4GB Unregistered ECC DIMMs, giving me the maximum supported 8GB configuration:</p>
<pre>    Crucial 4GB 240-pin DIMM 512Mx72 DDR3 PC3-10600 ECC (CT51272BA1339)</pre>
<p>The Crucial DIMMs were detected without problems. It is possible to use standard non-ECC memory, but I wanted the extra reliability offered by having RAM with Error Correction.</p>
<h2>Software</h2>
<p>There are two ways to run FreeNAS: bare metal, or in a virtual machine. If you want to go the virtual route, HP has made a <a title="HP ProLiant customized VMware ESXi 5" href="https://h20392.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=HPVM09" target="_blank">customized version</a> of VMware ESXi 5 available for ProLiant servers. To minimize complexity, I run FreeNAS on bare metal. This avoids having to deal with raw device passthrough in VMware and ensures maximum performance.</p>
<h2>FreeNAS installation</h2>
<p>Installation was a breeze. I created a bootable USB stick (4GB, but 2GB should be fine) using VMware Fusion on my Mac; create a new VMware guest (FreeBSD 8, 64-bit) and set it to boot from the ISO image. Connect the USB stick to the VM; the FreeNAS installer will detect it and ask if you want to install to the USB drive. After installation, shut down the VM and plug the USB stick into the internal USB-port in the MicroServer. Done.</p>
<p>Next, you&#8217;ll want to add your harddisks and create a ZFS Volume. I enabled the &#8220;4k sectors&#8221; option for my 2TB Western Digital drives.</p>
<p>You can simply share this entire volume, or create ZFS Datasets within the ZFS Volume. This gives you more fine-grained control over permissions and sharing.</p>
<p>I mainly use NFS and SMB (CIFS) shares at the moment. They can be used from Mac OSX without problems. Having a central LDAP directory (or perhaps even NIS) helps when setting the correct ownership and permission.</p>
<h2>Practical experience</h2>
<p>So far, I&#8217;m quite happy with FreeNAS performance and ease of use.</p>
<p>FreeNAS 8.2.0-BETA3 appears quite stable; I haven&#8217;t found any major bugs yet.</p>
<h2>Links</h2>
<ul>
<li><a title="ZFS Evil Tuning Guide" href="http://www.solarisinternals.com/wiki/index.php/ZFS_Evil_Tuning_Guide" target="_blank">ZFS Evil Tuning Guide</a></li>
<li><a title="Running ZFS over NFS as a VMware store" href="http://blog.laspina.ca/ubiquitous/running-zfs-over-nfs-as-a-vmware-store" target="_blank">Running ZFS over NFS as a VMware store</a></li>
<li><a href="http://constantin.glez.de/blog/2011/02/frequently-asked-questions-about-flash-memory-ssds-and-zfs" target="_blank">Frequently Asked Questions About Flash Memory (SSDs) and ZFS</a></li>
</ul>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://edvoncken.net/2012/05/freenas-on-hp-proliant-microserver-n40l/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>PNP4Nagios with SElinux on CentOS / RHEL 6</title>
		<link>http://edvoncken.net/2012/02/pnp4nagios-with-selinux-on-centos-rhel-6/</link>
		<comments>http://edvoncken.net/2012/02/pnp4nagios-with-selinux-on-centos-rhel-6/#comments</comments>
		<pubDate>Mon, 13 Feb 2012 15:19:21 +0000</pubDate>
		<dc:creator>Ed Voncken</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[EN]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[nagios]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[selinux]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://edvoncken.net/?p=1501</guid>
		<description><![CDATA[<p>PNP4Nagios is commonly used to add performance graphs to a Nagios installation.</p>
<p>For additional security, SElinux is enabled on the monitoring host. There is no standard SElinux policy for applications like PNP4Nagios, so we need to develop a custom policy. This sounds harder than it actually is:</p>

Run the software as you normally would (SElinux will interfere, so prepare for errors)
Extract audit messages and use them to create or update a local SElinux policy for the software
Repeat until everything works

<p>In this example, I am running Nagios 3.2.3 with PNP4Nagios 0.6.16 on EL6, 64-bit.</p>
<p>After configuring Nagios and PNP4Nagios integration in Synchronous Mode (see <i>[...]<p>Continue reading <a href="http://edvoncken.net/2012/02/pnp4nagios-with-selinux-on-centos-rhel-6/">PNP4Nagios with SElinux on CentOS / RHEL 6</a></p></i>]]></description>
			<content:encoded><![CDATA[<p><a title="PNP4Nagios" href="http://pnp4nagios.org/" target="_blank">PNP4Nagios</a> is commonly used to add performance graphs to a <a title="Nagios" href="http://www.nagios.org/" target="_blank">Nagios</a> installation.</p>
<p>For additional security, SElinux is enabled on the monitoring host. There is no standard SElinux policy for applications like PNP4Nagios, so we need to develop a custom policy. This sounds harder than it actually is:</p>
<ul>
<li>Run the software as you normally would (SElinux will interfere, so prepare for errors)</li>
<li>Extract audit messages and use them to create or update a local SElinux policy for the software</li>
<li>Repeat until everything works</li>
</ul>
<p>In this example, I am running Nagios 3.2.3 with PNP4Nagios 0.6.16 on EL6, 64-bit.</p>
<p>After configuring Nagios and PNP4Nagios integration in Synchronous Mode (see <a title="PNP4Nagios 0.6.x Documentation" href="http://docs.pnp4nagios.org/pnp-0.6/start" target="_blank">documentation</a>), I noticed that PNP4Nagios is not logging any performance data to <tt>/var/lib/pnp4nagios/</tt>.</p>
<p>Normally, PNP4Nagios should automatically create directories and files under <tt>/var/lib/pnp4nagios</tt> as performance data is received by Nagios. This smells of an SElinux issue, so check <tt>/var/log/audit/audit.log</tt> for suspicious messages. Sure enough, several audit messages have been logged. They look like this:</p>
<blockquote>
<pre>type=AVC msg=audit(1329129875.344:198212): avc:  denied  { getattr } for  pid=26692 comm="process_perfdat" \
    path="/var/lib/pnp4nagios/orac/Root_Partition.xml.26692" dev=dm-0 ino=1444378 \
    scontext=unconfined_u:system_r:nagios_t:s0 tcontext=unconfined_u:object_r:var_lib_t:s0 tclass=file
type=SYSCALL msg=audit(1329129875.344:198212): arch=c000003e syscall=5 success=no exit=-13 a0=3 a1=25440a0 \
    a2=25440a0 a3=0 items=0 ppid=26691 pid=26692 auid=0 uid=498 gid=498 euid=498 suid=498 fsuid=498 egid=498 \
    sgid=498 fsgid=498 tty=(none) ses=14942 comm="process_perfdat" exe="/usr/bin/perl" subj=unconfined_u:system_r:nagios_t:s0 key=(null)</pre>
</blockquote>
<h3>Create a policy</h3>
<p>You can run the &#8220;<tt>audit2allow</tt>&#8221; command (part of the <tt>policycoreutils-python</tt> RPM) to display suggested policy improvements based on the audit log:</p>
<blockquote>
<pre>audit2allow -a</pre>
</blockquote>
<p>The output can be saved in a file, for example <tt>local_nagios.te</tt>:</p>
<blockquote>
<pre>grep nagios_t /var/log/audit/audit.log | audit2allow -l -v -m local_nagios &gt; local_nagios.te</pre>
</blockquote>
<p>This generates an output file suitable for compiling into a custom SElinux module.</p>
<p><em><strong>Note</strong>: ALWAYS prefix the policy name with something like local_ to prevent overwriting system policies!<br />
</em></p>
<h3>Test and refine the policy</h3>
<p>Compile and load the SElinux policy module:</p>
<blockquote>
<pre>checkmodule -M -m -o local_nagios.mod local_nagios.te
semodule_package -o local_nagios.pp -m local_nagios.mod
semodule -v -i local_nagios.pp</pre>
</blockquote>
<p><em><strong>Note</strong>: The above tools can be found in the <tt>checkpolicy</tt> and <tt>policycoreutils</tt> RPMs.</em></p>
<p>Re-run the software and check for SElinux audit messages. New issues can be captured and translated into a new policy:</p>
<blockquote>
<pre>grep nagios_t /var/log/audit/audit.log | audit2allow -l -v -m local_nagios &gt; local_nagios.te_NEW</pre>
</blockquote>
<p>Merge the new results (in <tt>local_nagios.te_NEW</tt>) with your existing policy (in <tt>local_nagios.te</tt>). Compile and reload the module.</p>
<p>Lather, rinse, repeat <img src='http://edvoncken.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<h3>Results</h3>
<p>After some iterations, your <tt>local_nagios.te</tt> file will look something like this:</p>
<blockquote>
<pre>module local_nagios 1.0;

require {
    type nagios_t;
    type var_log_t;
    type var_lib_t;
    class dir { write create add_name remove_name };
    class file { create getattr ioctl lock open read rename unlink write };
}

#============= nagios_t ==============
allow nagios_t var_lib_t:dir { add_name create remove_name write };
allow nagios_t var_lib_t:file { create getattr ioctl lock open read rename unlink write };
allow nagios_t var_log_t:file { read rename unlink };</pre>
</blockquote>
<p>If all is well, the <tt>audit.log</tt> should not show any new messages for <tt>nagios_t</tt>:</p>
<blockquote>
<pre>clear;tail -f /var/log/audit/audit.log |grep nagios_t</pre>
</blockquote>
<p><em><strong>Note</strong>: The new SElinux policy will survive reboots; it is automatically copied to <tt>/etc/selinux/targeted/modules/active/modules/local_nagios.pp</tt>.</em></p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://edvoncken.net/2012/02/pnp4nagios-with-selinux-on-centos-rhel-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Workaround for Nagios check_disk failure in RHEL / CentOS 6.2</title>
		<link>http://edvoncken.net/2012/01/workaround-for-nagios-check_disk-failure-in-rhel-centos-6-2/</link>
		<comments>http://edvoncken.net/2012/01/workaround-for-nagios-check_disk-failure-in-rhel-centos-6-2/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 12:40:14 +0000</pubDate>
		<dc:creator>Ed Voncken</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[nagios]]></category>
		<category><![CDATA[Red Hat]]></category>
		<category><![CDATA[selinux]]></category>

		<guid isPermaLink="false">http://edvoncken.net/?p=1497</guid>
		<description><![CDATA[<p>After updating from EL 6.1 to 6.2, the Nagios &#8220;check_disk&#8221; plugin suddenly stopped working with &#8220;Permission denied&#8221; errors. This problem is related to the SElinux policy (you *are* running with SElinux enabled, aren&#8217;t you?).</p>
<p>By default, these AVC denials are not logged in /var/log/audit/audit.log which makes this problem harder to spot (if you want, you can enable all audit-messages by running semodule -DB).</p>
<p>There are at least two relevant entries in Bugzilla:</p>

Bug 771245 &#8211; nagios-plugins-disk fails when checking /boot on RHEL6.2 boxes
Bug 768055 &#8211; SELinux silent denials of Nagios NRPE check of /boot

<p>Fortunately, there is a simple workaround while we wait for an updated <i>[...]<p>Continue reading <a href="http://edvoncken.net/2012/01/workaround-for-nagios-check_disk-failure-in-rhel-centos-6-2/">Workaround for Nagios check_disk failure in RHEL / CentOS 6.2</a></p></i>]]></description>
			<content:encoded><![CDATA[<p>After updating from EL 6.1 to 6.2, the Nagios &#8220;<tt>check_disk</tt>&#8221; plugin suddenly stopped working with &#8220;Permission denied&#8221; errors. This problem is related to the SElinux policy (you *are* running with SElinux enabled, aren&#8217;t you?).</p>
<p>By default, these AVC denials are not logged in <tt>/var/log/audit/audit.log</tt> which makes this problem harder to spot (if you want, you can enable all audit-messages by running <tt>semodule -DB</tt>).</p>
<p>There are at least two relevant entries in Bugzilla:</p>
<ul>
<li><a href="https://bugzilla.redhat.com/show_bug.cgi?id=771245"><strong>Bug 771245</strong></a> &#8211; nagios-plugins-disk fails when checking /boot on RHEL6.2 boxes</li>
<li><a href="https://bugzilla.redhat.com/show_bug.cgi?id=768055"><strong>Bug 768055</strong></a> &#8211; SELinux silent denials of Nagios NRPE check of /boot</li>
</ul>
<p>Fortunately, there is a simple workaround while we wait for an updated <tt>selinux-policy</tt> package. As root, do the following:</p>
<blockquote>
<pre>chcon -t nagios_unconfined_plugin_exec_t /usr/lib64/nagios/plugins/check_disk</pre>
</blockquote>
<p>Or, for 32-bit systems:</p>
<blockquote>
<pre>chcon -t nagios_unconfined_plugin_exec_t /usr/lib/nagios/plugins/check_disk</pre>
</blockquote>
<p>No need to restart anything; just wait until Nagios re-checks the service and the problem should be gone. Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://edvoncken.net/2012/01/workaround-for-nagios-check_disk-failure-in-rhel-centos-6-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Controlling the Foscam FI8919W IP Camera</title>
		<link>http://edvoncken.net/2012/01/controlling-the-foscam-fi8919w-ip-camer/</link>
		<comments>http://edvoncken.net/2012/01/controlling-the-foscam-fi8919w-ip-camer/#comments</comments>
		<pubDate>Mon, 02 Jan 2012 22:01:38 +0000</pubDate>
		<dc:creator>Ed Voncken</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Home Security]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[shell scripting]]></category>

		<guid isPermaLink="false">http://edvoncken.net/?p=1475</guid>
		<description><![CDATA[<p>The Foscam FI8919W Pan-Tilt camera supports a number of preset locations, or Presets.</p>
<p>The onboard web interface does not seem to offer a way to configure these presets &#8211; but there is another way!</p>
<p>I have written a couple of small shell scripts (for Linux or Mac OS X) that allow you to set a preset, move to a preset and even take a snapshot right from the command line.</p>
<p>The first script stores the current camera position into the specified preset.</p>
<p>You need to open a web browser or camera app (my favorite: Live Cams Pro on iPad/iPhone) and set the camera position.</p>
<p>Then, <i>[...]<p>Continue reading <a href="http://edvoncken.net/2012/01/controlling-the-foscam-fi8919w-ip-camer/">Controlling the Foscam FI8919W IP Camera</a></p></i>]]></description>
			<content:encoded><![CDATA[<p><a href="http://edvoncken.net/wp-content/uploads/2012/01/foscam_fi8918w_white.png"><img class="alignright size-thumbnail wp-image-1491" title="foscam_fi8918w_white" src="http://edvoncken.net/wp-content/uploads/2012/01/foscam_fi8918w_white-150x150.png" alt="Foscam FI8918W IP Camera, white" width="150" height="150" /></a>The Foscam FI8919W Pan-Tilt camera supports a number of <a title="Foscam IP-Camera Presets" href="http://foscam.us/forum/fi8918w-preset-monitoring-surveillance-t236.html" target="_blank">preset locations, or Presets</a>.</p>
<p>The onboard web interface does not seem to offer a way to configure these presets &#8211; but there is another way!</p>
<p>I have written a couple of small shell scripts (for Linux or Mac OS X) that allow you to set a preset, move to a preset and even take a snapshot right from the command line.</p>
<p>The first script stores the current camera position into the specified preset.</p>
<p>You need to open a web browser or camera app (my favorite: <a title="App Store: Live Cams Pro" href="http://itunes.apple.com/nl/app/live-cams-pro/id428145132?mt=8" target="_blank">Live Cams Pro</a> on iPad/iPhone) and set the camera position.</p>
<p>Then, run this script, specifying the preset number (for example, &#8220;<tt>foscam_set 0</tt>&#8221; to set the first preset):</p>
<blockquote>
<pre>#!/bin/bash
# Store current camera position in specified preset (0..16)

# Commandline handling
#
preset=$1
if [ -z $preset ];
then
    echo "Syntax: $0 &lt;preset&gt;, where preset is a number (0..16)"
    exit 1
fi

# Address (or address:port number) where to reach the camera
# Username / password to access camera functions
#
CAMERA=192.168.1.2
USERNAME=theUsername
PASSWORD=thePassword

# Presets are set using URL with command (30 + preset*2), and recalled using URL with command (31 + preset*2)
#
command=$((30 + 2*$preset))
echo "Storing current camera position in preset ${preset} (command = ${command})"
wget -O - http://${CAMERA}/decoder_control.cgi?command=${command}\&amp;user=${USERNAME}\&amp;pwd=${PASSWORD}</pre>
</blockquote>
<p>Next, a script to move the camera to a specified preset (for example, &#8220;<tt>foscam_go 3</tt>&#8220;:</p>
<blockquote>
<pre>#!/bin/bash
# Move camera to specified preset (0..16)

# Commandline handling
#
preset=$1
if [ -z $preset ];
then
    echo "Syntax: $0 &lt;preset&gt;, where preset is a number (0..16)"
    exit 1
fi

# Address (or address:port number) where to reach the camera
# Username / password to access camera functions
#
CAMERA=192.168.1.2
USERNAME=theUsername
PASSWORD=thePassword

# Presets are set using URL with command (30 + preset*2), and recalled using URL with command (31 + preset*2)
#
command=$((31 + 2*$preset))
echo "Moving camera to preset ${preset} (command = ${command})"
wget -O - http://${CAMERA}/decoder_control.cgi?command=${command}\&amp;user=${USERNAME}\&amp;pwd=${PASSWORD}</pre>
</blockquote>
<p>Finally, a demo script that moves the camera to a preset, takes a snapshot and stores it locally (based on <a title="Foscam Forum" href="http://foscam.us/forum/fi8918w-preset-monitoring-surveillance-t236.html#p979" target="_blank">a post by 1994MGoBlue</a>):</p>
<blockquote>
<pre>#!/bin/bash
# Take snapshots of certain preset camera locations

# Address (or address:port number) where to reach the camera
# Username / password to access camera functions
#
CAMERA=192.168.1.2
USERNAME=theUsername
PASSWORD=thePassword

# The camera should normally be in this position
DEFAULT_PRESET=3

# Seconds to sleep after issuing a camera move command, allow it to reach new position.
# You may have to change this value to your needs
DELAY=10

# Presets are set using URL with command (30 + preset*2), and recalled using URL with command (31 + preset*2)
#
for preset in 0 1 2 3 4;
do
    command=$((31 + 2*$preset))
    echo "Taking snapshot in preset ${preset} (command = ${command})"

    # Move camera, delay, take snapshot (stored in /tmp/)
    wget -O - http://${CAMERA}/decoder_control.cgi?command=${command}\&amp;user=${USERNAME}\&amp;pwd=${PASSWORD}
    sleep ${DELAY}
    wget -O /tmp/preset-${preset}.jpg http://${CAMERA}/snapshot.cgi?user=${USERNAME}\&amp;pwd=${PASSWORD}
done

# Done, send camera back to default position
command=$((31 + 2*$DEFAULT_PRESET))
wget -O - http://${CAMERA}/decoder_control.cgi?command=${command}\&amp;user=${USERNAME}\&amp;pwd=${PASSWORD}</pre>
</blockquote>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://edvoncken.net/2012/01/controlling-the-foscam-fi8919w-ip-camer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>It&#8217;s 2012! Happy New Year!</title>
		<link>http://edvoncken.net/2012/01/its-2012-happy-new-year/</link>
		<comments>http://edvoncken.net/2012/01/its-2012-happy-new-year/#comments</comments>
		<pubDate>Sat, 31 Dec 2011 22:01:42 +0000</pubDate>
		<dc:creator>Ed Voncken</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://edvoncken.net/?p=1470</guid>
		<description><![CDATA[<p>Een gelukkig en vooral gezond 2012!</p>
<p></p>
<p>&#8230; ook namens onze veestapel, Bommel, Blacky en Koetje  </p>
]]></description>
			<content:encoded><![CDATA[<p>Een gelukkig en vooral gezond 2012!</p>
<p><a href="http://edvoncken.net/wp-content/uploads/2011/12/bommel.jpg"><img class="alignnone size-large wp-image-1471" title="bommel" src="http://edvoncken.net/wp-content/uploads/2011/12/bommel-1024x768.jpg" alt="Een gezond en gelukkig 2012" width="100%" height="100%" /></a></p>
<p><span style="color: #999999;"><em>&#8230; ook namens onze veestapel, Bommel, Blacky en Koetje <img src='http://edvoncken.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </em></span></p>
]]></content:encoded>
			<wfw:commentRss>http://edvoncken.net/2012/01/its-2012-happy-new-year/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Assembling the JeeLabs OOK433 Plug, part 1</title>
		<link>http://edvoncken.net/2011/12/assembling-the-jeelabs-ook433-plug-part-1/</link>
		<comments>http://edvoncken.net/2011/12/assembling-the-jeelabs-ook433-plug-part-1/#comments</comments>
		<pubDate>Tue, 27 Dec 2011 18:47:48 +0000</pubDate>
		<dc:creator>Ed Voncken</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[EN]]></category>
		<category><![CDATA[jeelabs]]></category>

		<guid isPermaLink="false">http://edvoncken.net/?p=1443</guid>
		<description><![CDATA[<p>I got some KAKU (Klik Aan Klik Uit) switches to control lighting etc. These can be remote controlled using a JeeNode with the OOK433 Plug.</p>
<p>This plug contains a separate receiver and transmitter board. After consulting the schematic, it appears that the receiver is hooked up to the AIO pin, while the transmitter is connected to the DIO pin. This information is needed when reconfiguring the software for the actual Port socket you plugged the OOK433 into.</p>
<p>There are two solder jumpers that need to be made (marked in the picture on the right):</p>

The upper one selects supply voltage. According to current <i>[...]<p>Continue reading <a href="http://edvoncken.net/2011/12/assembling-the-jeelabs-ook433-plug-part-1/">Assembling the JeeLabs OOK433 Plug, part 1</a></p></i>]]></description>
			<content:encoded><![CDATA[<p><a href="http://edvoncken.net/wp-content/uploads/2011/12/OOK433-001.jpg"><img class="alignright size-medium wp-image-1445" title="OOK433 Plug" src="http://edvoncken.net/wp-content/uploads/2011/12/OOK433-001-300x199.jpg" alt="JeeLabs OOK433 Plug" width="300" height="199" /></a>I got some KAKU (Klik Aan Klik Uit) switches to control lighting etc. These can be remote controlled using a JeeNode with the OOK433 Plug.</p>
<p>This plug contains a separate receiver and transmitter board. After consulting <a title="JeeLabs OOK433 Plug Schematic (PDF)" href="http://jeelabs.net/attachments/833/jlpcb-125.pdf" target="_blank">the schematic</a>, it appears that the receiver is hooked up to the AIO pin, while the transmitter is connected to the DIO pin. This information is needed when reconfiguring the software for the actual Port socket you plugged the OOK433 into.</p>
<p>There are two solder jumpers that need to be made (marked in the picture on the right):</p>
<ul>
<li>The upper one selects supply voltage. According to <a title="JeeLabs OOK433 Plug Documentation" href="http://jeelabs.net/projects/hardware/wiki/OOK_433_Plug" target="_blank">current documentation</a>, the rightmost two pads need to be bridged, selecting +3V.</li>
<li>The lower solder jumper should always be bridged (except if a resistor R1 is to be installed)</li>
</ul>
<p>Note that the Receiver and Transmitter modules have &#8220;+5V&#8217; and &#8220;+12V&#8221; markings on them &#8211; apparently, they also work at this much lower voltage.</p>
<p><a href="http://edvoncken.net/wp-content/uploads/2011/12/OOK433-002.jpg"><img class="alignright size-medium wp-image-1447" title="OOK433 Plug with Header" src="http://edvoncken.net/wp-content/uploads/2011/12/OOK433-002-300x199.jpg" alt="JeeLabs OOK433 Plug with Header" width="300" height="199" /></a>After making these two solder jumpers, continue assembly. I soldered a 6-pin header (not included with the kit)  to the Port connector so I can plug it straight into a JeeNode.</p>
<p>The trick here is to apply some solder to one pad and one pin first. Then, hold the header in place while re-heating the solder on that pad. The remaining pads can now be soldered properly. The picture shows the solder jumpers I made, as well as the preparations for soldering the 6-pin header in place.</p>
<p>Make sure you get shiny solder joints that are properly heated (lead-free solder tends to shine a bit less than the 60/40 I use).</p>
<p>Next up: the transmitter module. Note that when soldering, you usually work from &#8220;lowest&#8221; to &#8220;highest&#8221; component. This makes life easier. Simply insert the transmitter module into the 3 holes and solder it. Note that the module has an antenna connector (marked &#8220;ANT&#8221;) for adding a straight-wire antenna, approx. 17cm in length. This corresponds to 1/4 wavelength at 433MHz.</p>
<p><a href="http://edvoncken.net/wp-content/uploads/2011/12/OOK433-003.jpg"><img class="alignright size-medium wp-image-1452" title="OOK433 Plug with Transmitter module" src="http://edvoncken.net/wp-content/uploads/2011/12/OOK433-003-300x199.jpg" alt="OOK433 Plug with Transmitter module" width="300" height="199" /></a>Finally, the receiver module. Insert it into the 4 holes and solder it. This module also has an antenna connector, you may want to add a 17cm straight-wire antenna here as well.</p>
<p>The end result is in the picture below. Now for the moment of truth: trying to make it work with a JeeNode and a software sketch.</p>
<p>This is where my trouble began. I used various sketches with my new KAKU remote, to no avail:</p>
<ul>
<li>kaku_demo</li>
<li><a title="KAKU demo code by MichelV" href="http://forum.jeelabs.net/files/KlikAanKlikUit_A_type.pde_.txt" target="_blank">KlikAanKlikUit_A_type</a></li>
<li>ookRelay</li>
<li>ookScope2</li>
<li>recv433_test</li>
</ul>
<p>I searched the <a title="Google - site:jeelabs.org OOK433" href="http://www.google.nl/search?q=site%3Ajeelabs.org+ook433" target="_blank">blog</a> and <a title="Google - site:jeelabs.net OOK433" href="http://www.google.nl/search?q=site%3Ajeelabs.net+ook433" target="_blank">forums</a> using Google (&#8220;site:jeelabs.net OOK433&#8243;) and found several people struggling to make the OOK433 Plug work. Several issues appear to be at play here:</p>
<ol>
<li><strong>Confusion regarding the correct supply voltage; it seems that +3V is not enough.</strong><br />
<em>This means that you would need to bridge the leftmost two pads on the upper solder jumper, instead of the rightmost two pads.</em></li>
<li><strong>Confusion regarding port numbers / Arduino pin numbers.</strong><br />
<em>The KlikAanKlikUit_A_type sketch is the only one that seems to clearly document where the Plug is expected to be for the sketch to work.</em></li>
<li><strong>Confusion regarding the antennas being &#8220;optional&#8221; or not.</strong><br />
<em>I have no antennas connected at the moment, but I&#8217;m using the remote at close range so it should not be a problem.</em></li>
<li><strong>Confusion regarding the different KAKU protocols out there.</strong><br />
<em>I think I have the most recent protocol, with house code (A-D on my remote). The old protocol apparently does not have that.</em></li>
</ol>
<p>All in all, quite a few variables <img src='http://edvoncken.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>I decided to go ahead with the ookScope2.ino sketch &#8211; that appears to be a fairly recent sketch; hopefully that code works as expected. First hurdle: determining which port to plug the OOK433 Plug into&#8230;</p>
<p>The code contains this line:</p>
<blockquote><p><code>#define OOK_PIN   2   // this is the input pin with the signal to be analyzed</code></p></blockquote>
<p>This might refer to AVR pin PD2, Arduino pin &#8220;Digital 2&#8243; but that would mean it&#8217;s <a title="Pins, damned pins and JeeNodes" href="http://jeelabs.org/2011/11/10/pins-damned-pins-and-jeenodes/" target="_blank">connected to the RFM12B INT line</a>! Not very likely&#8230; I tried the code, and apart from the [ookScope] identifier, nothing happened. So, where does that OOK433 Plug need to go for the sketch to work?</p>
<p>OK, back to the schematic I talked about at the start of this post. The OOK433 receiver module appears to be connected to the AIO pin. If I want to use the plug in Port 3, I need to find the proper value for AIO3. That would be Analog 2 / Digital 16 (hey, &#8217;2&#8242; looks familiar but it didn&#8217;t work).</p>
<p>I then tried seting OOK_PIN to 16 (Digital 16), plugged the OOK433 into Port 3 and behold! The sketch starts, and emits binary garbage on the serial output! This is promising!</p>
<p>Next up: install the JeeRev / JeeMon software on my Mac <a title="JeeMon for early birds" href="http://jeelabs.org/2011/11/25/jeemon-for-early-birds/" target="_blank">according to instructions</a>. Unfortunately, that didn&#8217;t result in a nice bar graph display &#8211; the bars remain at zero, even though I pressed the remote buttons. Perhaps the ookScope2.ino sketch doesn&#8217;t work with this version of the JeeMon software? What&#8217;s next? Debugging the JeeMon installation? Nah&#8230;</p>
<p>Anyway, my head hurts after reading through the various forum and blog posts &#8211; once I get this working I&#8217;ll post &#8220;part 2&#8243; of this adventure <img src='http://edvoncken.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p><a href="http://edvoncken.net/wp-content/uploads/2011/12/OOK433-004.jpg"><img class="alignnone size-large wp-image-1456" title="JeeLabs OOK433 Plug, completely assembled" src="http://edvoncken.net/wp-content/uploads/2011/12/OOK433-004-1024x682.jpg" alt="JeeLabs OOK433 Plug, completely assembled" width="100%" height="100%" /></a></p>
<p>P.S.: I think we as a community should work on improving the &#8220;Out of Box Experience&#8221; for the JeeLabs hardware. Detailed assembly instructions, a simple test sketch with clear instructions on setting up the test bed &#8211; life would be so much easier <img src='http://edvoncken.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  If possible, add a low-level hardware diagnostics mode in that test sketch to help isolate the cause of any hardware-related problems. For example, try communicating over the SPI / I2C bus. If that doesn&#8217;t work, you might have to inspect your soldering. And most importantly: find a way to reduce @JCW&#8217;s workload &#8211; it would not be realistic to expect him to do all the work on documentation / test sketches etc.</p>
<p>Still massively enjoying the JeeLabs learning experience, one (steep) step at a time <img src='http://edvoncken.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Onwards!</p>
]]></content:encoded>
			<wfw:commentRss>http://edvoncken.net/2011/12/assembling-the-jeelabs-ook433-plug-part-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Assembling the JeeLabs LCD Plug</title>
		<link>http://edvoncken.net/2011/12/assembling-the-jeelabs-lcd-plug/</link>
		<comments>http://edvoncken.net/2011/12/assembling-the-jeelabs-lcd-plug/#comments</comments>
		<pubDate>Thu, 22 Dec 2011 19:35:24 +0000</pubDate>
		<dc:creator>Ed Voncken</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[EN]]></category>
		<category><![CDATA[jeelabs]]></category>

		<guid isPermaLink="false">http://edvoncken.net/?p=1417</guid>
		<description><![CDATA[<p>Today I received my new items from JeeLabs &#8211; an LCD Plug and a set of stacking headers.</p>
<p>After soldering the control board to the LCD display,I tried compiling the lcd_demo.ino demo sketch. No luck &#8211; it seems that the code no longer compiled with Arduino 1.0.</p>
<p>I added the include-file that was missing:</p>

#include &#60;PortsLCD.h&#62;

<p>and suddenly&#8230; nothing happened.</p>
<p>I verified the connections &#8211; everything looked good. Oh well &#8211; &#8220;if all else fails, read the manual&#8221;. There were no detailed assembly instructions for this kit, so I had to search through various posts to help debug the issue.</p>
<p>Turns out that you have to <i>[...]<p>Continue reading <a href="http://edvoncken.net/2011/12/assembling-the-jeelabs-lcd-plug/">Assembling the JeeLabs LCD Plug</a></p></i>]]></description>
			<content:encoded><![CDATA[<p><a href="http://edvoncken.net/wp-content/uploads/2011/12/JeeLabs-LCD-Plug-1.jpg"><img class="size-medium wp-image-1418 alignright" title="Assembled the JeeLabs LCD Plug" src="http://edvoncken.net/wp-content/uploads/2011/12/JeeLabs-LCD-Plug-1-300x143.jpg" alt="Assembled the JeeLabs LCD Plug" width="300" height="143" /></a>Today I received my new items from <a title="JeeLabs" href="http://jeelabs.org/" target="_blank">JeeLabs</a> &#8211; an LCD Plug and a set of stacking headers.</p>
<p>After soldering the control board to the LCD display,I tried compiling the lcd_demo.ino demo sketch. No luck &#8211; it seems that the code <a title="lcd_demo.ino problem with Arduino 1.0" href="http://forum.jeelabs.net/node/749" target="_blank">no longer compiled</a> with Arduino 1.0.</p>
<p>I added the include-file that was missing:</p>
<blockquote>
<pre>#include &lt;PortsLCD.h&gt;</pre>
</blockquote>
<p>and suddenly&#8230; nothing happened.</p>
<p><a href="http://edvoncken.net/wp-content/uploads/2011/12/JeeLabs-LCD-Plug-2-annotated.jpg"><img class="size-medium wp-image-1425 alignleft" title="JeeLabs LCD Plug 2 annotated" src="http://edvoncken.net/wp-content/uploads/2011/12/JeeLabs-LCD-Plug-2-annotated-300x129.jpg" alt="JeeLabs LCD Plug 2 annotated" width="300" height="129" /></a>I verified the connections &#8211; everything looked good. Oh well &#8211; &#8220;if all else fails, read the manual&#8221;. There were no detailed assembly instructions for this kit, so I had to search through <a title="JeeLabs LCD Plug" href="http://jeelabs.org/2009/11/01/lcd-plug/" target="_blank">various</a> <a title="LCD display voltages" href="http://jeelabs.org/2010/06/04/lcd-display-voltages/" target="_blank">posts</a> to help debug the issue.</p>
<p>Turns out that you have to set two solder jumpers (Logic to 3v3, Backlight to 3v3) as well as short out a current limiting resistor (which is not actually present on the board). Click the annotated image on the left for a (blurry) close-up.</p>
<p>This still did not seem to solve the problem &#8211; the backlight worked, but still no text on the display. After <a title="Hardware - LCD Plug" href="http://jeelabs.net/projects/hardware/wiki/LCD_Plug" target="_blank">adjusting the contrast level</a> with the trimpot (near the read arrow in the image), the display finally sprang to life. I had to rotate it completely counter-clockwise.</p>
<p>The test assembly looks like this &#8211; battery holder on top, JeeNode in the middle, LCD Plug at the bottom of the image. The LCD Plug is connected to Port 1 on the JeeNode.</p>
<p style="text-align: center;"><a href="http://edvoncken.net/wp-content/uploads/2011/12/JeeLabs-LCD-Plug-3.jpg"><img class="aligncenter size-large wp-image-1420" title="LCD Plug test assembly" src="http://edvoncken.net/wp-content/uploads/2011/12/JeeLabs-LCD-Plug-3-1024x768.jpg" alt="LCD Plug test assembly, running off a battery" width="100%" /></a><a href="http://edvoncken.net/wp-content/uploads/2011/12/JeeLabs-LCD-Plug-3.jpg"><br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://edvoncken.net/2011/12/assembling-the-jeelabs-lcd-plug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making Cobbler work with SElinux on CentOS / RHEL 6</title>
		<link>http://edvoncken.net/2011/12/making-cobbler-work-with-selinux-on-centos-rhel-6/</link>
		<comments>http://edvoncken.net/2011/12/making-cobbler-work-with-selinux-on-centos-rhel-6/#comments</comments>
		<pubDate>Mon, 19 Dec 2011 14:53:17 +0000</pubDate>
		<dc:creator>Ed Voncken</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[Cobbler]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Provisioning]]></category>
		<category><![CDATA[selinux]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://edvoncken.net/?p=1323</guid>
		<description><![CDATA[<p>By default, Cobbler will not work properly on a CentOS / RHEL 6 machine with SElinux enabled. The easy way out is to disable SElinux entirely, but I prefer to write a custom policy instead &#8211; it is not that difficult.</p>
<p>The basic approach is this:</p>

Use Cobbler as you normally would (you will trigger several SElinux denials, so expect errors)
Extract the relevant SElinux audit messages; convert them into a local policy
Load your local policy
Repeat steps 1..3 until everything works as expected

<p>First attempt: the &#8220;cobbler import&#8221; command fails; rsync cannot access files on the mounted DVD ISO. Time to start writing a <i>[...]<p>Continue reading <a href="http://edvoncken.net/2011/12/making-cobbler-work-with-selinux-on-centos-rhel-6/">Making Cobbler work with SElinux on CentOS / RHEL 6</a></p></i>]]></description>
			<content:encoded><![CDATA[<p>By default, Cobbler will not work properly on a CentOS / RHEL 6 machine with SElinux enabled. The easy way out is to disable SElinux entirely, but I prefer to write a custom policy instead &#8211; it is not that difficult.</p>
<p>The basic approach is this:</p>
<ol>
<li>Use Cobbler as you normally would (you will trigger several SElinux denials, so expect errors)</li>
<li>Extract the relevant SElinux audit messages; convert them into a local policy</li>
<li>Load your local policy</li>
<li>Repeat steps 1..3 until everything works as expected</li>
</ol>
<p>First attempt: the &#8220;<tt>cobbler import</tt>&#8221; command fails; <tt>rsync</tt> cannot access files on the mounted DVD ISO. Time to start writing a local policy!</p>
<p>The following command generates a basic SElinux policy from the SElinux audit messages:</p>
<pre>  cat /var/log/audit/audit.log | audit2allow -l -v -m local &gt; local.te</pre>
<p>The resulting <tt>local.te</tt> file (ASCII, open it in your favorite editor) will list various items, some if which are not related to the Cobbler / Rsync operations. Edit the file to taste. Now, compile and load that policy:</p>
<pre>  checkmodule -M -m -o local.mod local.te
  semodule_package -o local.pp -m local.mod
  semodule -v -i local.pp</pre>
<p>Note: every invocation of &#8220;<tt>audit2allow -l</tt>&#8221; will overwrite your <tt>local.te</tt> policy file with new events since the last time a policy module was loaded. This is why you should keep backup copies of the previous versions so you can merge new events in with the existing ones.</p>
<p>In the end, you will end up with a policy in <tt>local.te</tt> like this:</p>
<blockquote>
<pre>module local 1.0;

require {
    type cobblerd_t;
    type cobbler_var_lib_t;
    type iso9660_t;
    type public_content_t;
    type rpm_var_lib_t;
    type rsync_etc_t;
    type security_t;
    type tmp_t;
    class capability { sys_module fsetid };
    class dir { add_name create getattr open read remove_name rmdir search write };
    class file { create getattr open read unlink write };
    class lnk_file create;
    class unix_dgram_socket create;
}

#============= cobblerd_t ==============
allow cobblerd_t cobbler_var_lib_t:lnk_file create;
allow cobblerd_t iso9660_t:dir { open read search getattr };
allow cobblerd_t iso9660_t:file { open read getattr };
allow cobblerd_t public_content_t:dir { write rmdir remove_name };
allow cobblerd_t rpm_var_lib_t:dir { open read search getattr write };
allow cobblerd_t rsync_etc_t:file create;
allow cobblerd_t security_t:dir read;
allow cobblerd_t self:capability fsetid;
allow cobblerd_t self:unix_dgram_socket create;
allow cobblerd_t tmp_t:dir { add_name create remove_name rmdir write };
allow cobblerd_t tmp_t:file { create getattr open read unlink write };</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://edvoncken.net/2011/12/making-cobbler-work-with-selinux-on-centos-rhel-6/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

