<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.3" -->
<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/"
	>

<channel>
	<title>AsynchronousBlog</title>
	<link>http://www.asynchronous.org/blog</link>
	<description>Random stuff for search engines to index.</description>
	<pubDate>Thu, 16 Oct 2008 22:22:51 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.3</generator>
	<language>en</language>
			<item>
		<title>configuring tomcat6 for https with cargo</title>
		<link>http://www.asynchronous.org/blog/archives/2008/10/16/configuring-tomcat6-for-https-with-cargo</link>
		<comments>http://www.asynchronous.org/blog/archives/2008/10/16/configuring-tomcat6-for-https-with-cargo#comments</comments>
		<pubDate>Thu, 16 Oct 2008 22:22:51 +0000</pubDate>
		<dc:creator>jsled</dc:creator>
		
		<category><![CDATA[~/stuff/misc]]></category>

		<category><![CDATA[~/stuff/programming]]></category>

		<category><![CDATA[~/stuff/work/mysql]]></category>

		<guid isPermaLink="false">http://www.asynchronous.org/blog/archives/2008/10/16/configuring-tomcat6-for-https-with-cargo</guid>
		<description><![CDATA[cargo is a nifty tool for launching containers from, say, ant.  While it doesn&#8217;t contain official support for Tomcat6, the Tomcat5 support works just fine with Tomcat6.

There is a property, cargo.protocol, where you can specify https, however, the resulting server.xml that it generates will not be quite correct.  A hack-fix is to edit [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://cargo.codehaus.org/">cargo</a> is a nifty tool for launching containers from, say, ant.  While it doesn&#8217;t contain official support for Tomcat6, the Tomcat5 support works just fine with Tomcat6.</p>

<p>There is a property, <code>cargo.protocol</code>, where you can specify <code>https</code>, however, the resulting server.xml that it generates will not be quite correct.  A hack-fix is to edit <code>org/codehaus/cargo/container/internal/resources/tomcat5x/server.xml</code> in the jar file to include «SSLEnabled=&#8221;true&#8221;».  As well, you might want to add the appropriate attributes for the relevant keyfile-path, otherwise, it seemed to use <code>$(HOME)/.keystore</code>, which I was happy to provide.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.asynchronous.org/blog/archives/2008/10/16/configuring-tomcat6-for-https-with-cargo/feed</wfw:commentRss>
		</item>
		<item>
		<title>Champlain Valley water analysis, Spring 2008</title>
		<link>http://www.asynchronous.org/blog/archives/2008/07/28/champlain-valley-water-analysis-spring-2008</link>
		<comments>http://www.asynchronous.org/blog/archives/2008/07/28/champlain-valley-water-analysis-spring-2008#comments</comments>
		<pubDate>Tue, 29 Jul 2008 00:14:42 +0000</pubDate>
		<dc:creator>jsled</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.asynchronous.org/blog/archives/2008/07/28/champlain-valley-water-analysis-spring-2008</guid>
		<description><![CDATA[As a South Burlington homeowner (water-bill-payer, really), the Champlain Water District sends me a report about how their water is the best water. Of note to me as a homebrewer is the analysis of certain chemical properties of the water. Since a few google searches for this information basically turned up my previous post and [...]]]></description>
			<content:encoded><![CDATA[<p>As a South Burlington homeowner (water-bill-payer, really), the <a href="http://www.cwd-h2o.org/">Champlain Water District</a> sends me a report about how their water is the best water. Of note to me as a homebrewer is the analysis of certain chemical properties of the water. Since a few google searches for this information basically turned up my previous post and not <a href="http://www.cwd-h2o.org/publications.html">the actual source of the data</a>, here&#8217;s the data:</p>

<ul>
<li>aluminum: &lt; 0.06ppm</li>
<li>color: 2 units</li>
<li>alkalinity: 57-74 ppm as CaCO3</li>
<li>calcium hardness: 45-56 ppm as CaCO3</li>
<li>total hardness: 61 ppm as CaCO3</li>
<li>chloride: 17ppm</li>
<li>foaming agents: &lt; 0.1 ppm</li>
<li>total organic carbon: 2.04 pm (1.49-2.61)</li>
<li>conductivity: 192 micro-S/cm (156-194)</li>
<li><p>pH: 7.62 (7.39-7.79)</p></li>
<li><p>total disolved solids: 113 ppm</p></li>
<li>iron: &lt; 0.01ppm</li>
<li>manganese: .007ppm</li>
<li>sodium: 7.5ppm</li>
<li>potassium: 1.31 ppm</li>
<li>sulfate: 15 ppm</li>
<li>silver: &lt; 0.05ppm</li>
<li>silica: 1.4ppm</li>
<li>silicon: 0.67 ppm</li>
<li>bromide: &lt; 0.010 ppm</li>
<li>iodide: &lt; 1 ppm</li>
<li>flouride: 1.01 ppm (0.74 - 1.28)</li>
<li>ammonium ion: 0.15 ppm (0.01 - 0.32)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.asynchronous.org/blog/archives/2008/07/28/champlain-valley-water-analysis-spring-2008/feed</wfw:commentRss>
		</item>
		<item>
		<title>Champlain Valley water anlysis, 2007</title>
		<link>http://www.asynchronous.org/blog/archives/2007/10/29/champlain-valley-water-anlysis-2007</link>
		<comments>http://www.asynchronous.org/blog/archives/2007/10/29/champlain-valley-water-anlysis-2007#comments</comments>
		<pubDate>Tue, 30 Oct 2007 03:06:03 +0000</pubDate>
		<dc:creator>jsled</dc:creator>
		
		<category><![CDATA[~/stuff/homebrew]]></category>

		<guid isPermaLink="false">http://www.asynchronous.org/blog/?p=86</guid>
		<description><![CDATA[Since the previous water analysis from 2005, I&#8217;ve since bought a house, which means the Champlain Water District sends me a report about how their water is the best water.  Of note to me as a homebrewer is the analysis of certain chemical properties of the water.  Since a few google searches for [...]]]></description>
			<content:encoded><![CDATA[<p>Since <a href="/blog/archives/2005/01/27/winooski_vt_water_mineral_content_analysis.html">the previous water analysis from 2005</a>, I&#8217;ve since bought a house, which means the <a href="http://www.cwd-h2o.org/">Champlain Water District</a> sends me a report about how their water is the best water.  Of note to me as a homebrewer is the analysis of certain chemical properties of the water.  Since a few google searches for this information basically turned up my previous post and not <a href="http://www.cwd-h2o.org/publications.html">the actual source of the data</a>, here&#8217;s the data:</p>

<ul>
<li>aluminum: &lt; 0.06ppm</li>
<li>color: 2 units</li>
<li>alkalinity: 42-56 ppm as CaCO3</li>
<li>calcium hardness: 45-56 ppm as CaCO3</li>
<li>total hardness: 61 ppm as CaCO3</li>
<li>chloride: 17ppm</li>
<li>foaming agents: &lt; 0.1 ppm</li>
<li>total organic carbon: 2.22 pm (1.60-3.1)</li>
<li>conductivity: 189 micro-S/cm (163-208)</li>
<li>pH: 7.56 (7.29 - 7.89)</li>
<li>total disolved solids: 113 ppm</li>
<li>iron: &lt; 0.01ppm</li>
<li>manganese: .007ppm</li>
<li>sodium: 7.5ppm</li>
<li>potassium: 1.31 ppm</li>
<li>sulfate: 15 ppm</li>
<li>silver: &lt; 0.05ppm</li>
<li>silica: 1.4ppm</li>
<li>silicon: 0.67 ppm</li>
<li>bromide: &lt; 0.010 ppm</li>
<li>iodide: &lt; 1 ppm</li>
<li>flouride: 0.97 ppm (0.71 - 1.21)</li>
<li>ammonium ion: 0.20 ppm (0.04 - 0.048)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.asynchronous.org/blog/archives/2007/10/29/champlain-valley-water-anlysis-2007/feed</wfw:commentRss>
		</item>
		<item>
		<title>java array iteration</title>
		<link>http://www.asynchronous.org/blog/archives/2007/10/04/java-array-iteration</link>
		<comments>http://www.asynchronous.org/blog/archives/2007/10/04/java-array-iteration#comments</comments>
		<pubDate>Fri, 05 Oct 2007 00:08:00 +0000</pubDate>
		<dc:creator>jsled</dc:creator>
		
		<category><![CDATA[~/stuff/programming]]></category>

		<guid isPermaLink="false">http://www.asynchronous.org/blog/?p=85</guid>
		<description><![CDATA[Java5 now has language support for iteration of the form:

for (Type var : someIterable) { ... }


As well, there is now an Iterable&#60;t&#62; interface, and Arrays are directly iterable, allowing you to write:

String[] thingys = {"a","b","c"};
for (String thingy : thingys) { ... }


At work, we have a collection of utility iterators, most written before these [...]]]></description>
			<content:encoded><![CDATA[<p>Java5 now has language support for iteration of the form:</p>

<pre><code>for (Type var : someIterable) { ... }
</code></pre>

<p>As well, there is now an <code>Iterable&lt;t&gt;</code> interface, and Arrays are directly iterable, allowing you to write:</t></p>

<pre><code>String[] thingys = {"a","b","c"};
for (String thingy : thingys) { ... }
</code></pre>

<p>At work, we have a collection of utility iterators, most written before these were available.  As such, we have an ArrayIter utility, and a ZipIterator, inspired by Python&#8217;s <a href="http://docs.python.org/lib/itertools-functions.html#l2h-1061">itertools.izip</a>.</p>

<p>I&#8217;ve been going through these classes and their usages on a lazy basis to update them to the new syntax.  I finally got around to a usage of the ZipIterator, which happened to compose an ArrayIter &#8230; it zipped together an array of String names with the results of a test.</p>

<p>So, I changed it to:</p>

<pre><code>String[] names = { "foo", "bar", "baz" };
List results;
for (Object[] pair : new ZipIterator(names, results))
{
// ...
</code></pre>

<p>No dice, says Java:</p>

<pre><code>/home/jsled/stuff/work/[...]TestMumble.java:46: cannot find symbol
symbol  : constructor ZipIterator(java.lang.String[],java.util.List)
location: class com.spokesoftware.util.iterator.ZipIterator
for (Object pairObj : new ZipIterator(data, results))
</code></pre>

<p>WTF?  Okay, let me help you out:</p>

<pre><code>for (Object[] pair : new ZipIterator((Iterable)names, results))
// ...
</code></pre>

<p>FUCK YOU, says Java:</p>

<pre><code>/home/jsled/stuff/work/[...]/TestMumble.java:46: inconvertible types
found   : java.lang.String[]
required: java.lang.Iterable
for (Object pairObj : new ZipIterator((Iterable)data, results))
</code></pre>

<p>It turns out that the string &#8220;iter&#8221; isn&#8217;t even in the <a href="http://java.sun.com/docs/books/jls/third_edition/html/arrays.html#10.7">text of the section about Arrays in the Java Language Spec</a>.  Array instances aren&#8217;t Iterable.  They&#8217;re a <a href="http://java.sun.com/docs/books/jls/third_edition/html/statements.html#14.14.2">special case in the handling of the for-each loop syntax</a>.</p>

<p>This code ended up as:</p>

<pre><code>for (Object pair : new ZipIterator(Arrays.asList(names), results))
</code></pre>

<p>Java is totally shitrude.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.asynchronous.org/blog/archives/2007/10/04/java-array-iteration/feed</wfw:commentRss>
		</item>
		<item>
		<title>rstiki-1.1</title>
		<link>http://www.asynchronous.org/blog/archives/2007/02/05/rstiki-11</link>
		<comments>http://www.asynchronous.org/blog/archives/2007/02/05/rstiki-11#comments</comments>
		<pubDate>Tue, 06 Feb 2007 04:06:34 +0000</pubDate>
		<dc:creator>jsled</dc:creator>
		
		<category><![CDATA[~/stuff/misc]]></category>

		<guid isPermaLink="false">http://www.asynchronous.org/blog/?p=84</guid>
		<description><![CDATA[Felix Wiemann of docutils was kind enough to write and point out that docutils doesn&#8217;t protect against various kinds of malicious markup and content inclusion.  He notes that there are a couple of options to prevent such inclusion.

While I don&#8217;t intend to use rstiki on a public-facing web server, others might, and docutils makes [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ososo.de/">Felix Wiemann</a> of docutils was kind enough to write and point out that docutils doesn&#8217;t protect against various kinds of malicious markup and content inclusion.  He notes that there are <a href="http://docutils.sf.net/docs/howto/security.html">a couple of options to prevent such inclusion</a>.</p>

<p>While I don&#8217;t intend to use rstiki on a public-facing web server, others might, and docutils makes it very easy to disable such inclusion.  So, it does by default, now.</p>

<p><a href="/rstiki/">rstiki</a>-1.1 also sports a new link to the rST quickref.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.asynchronous.org/blog/archives/2007/02/05/rstiki-11/feed</wfw:commentRss>
		</item>
		<item>
		<title>rstiki - minimalist wiki using reStructuredText</title>
		<link>http://www.asynchronous.org/blog/archives/2007/02/03/rstiki-minimalist-wiki-using-restructuredtext</link>
		<comments>http://www.asynchronous.org/blog/archives/2007/02/03/rstiki-minimalist-wiki-using-restructuredtext#comments</comments>
		<pubDate>Sun, 04 Feb 2007 02:37:11 +0000</pubDate>
		<dc:creator>jsled</dc:creator>
		
		<category><![CDATA[~/stuff/misc]]></category>

		<guid isPermaLink="false">http://www.asynchronous.org/blog/?p=83</guid>
		<description><![CDATA[I used to use phpwiki for a personal, behind-the-firewall wiki.  It was simple, though it was many files, and gentoo packaged it.  Then, there was a version upgrade that required a database and lost all my (handful of) content.  I switched to pwyky because it was a single file, simple, and SBP [...]]]></description>
			<content:encoded><![CDATA[<p>I used to use phpwiki for a personal, behind-the-firewall wiki.  It was simple, though it was many files, and <a href="http://www.gentoo.org/">gentoo</a> packaged it.  Then, there was a version upgrade that required a database and lost all my (handful of) content.  I switched to <a href="http://infomesh.net/pwyky/">pwyky</a> because it was a single file, simple, and SBP wrote it.  But its syntax doesn&#8217;t support nested lists, and it&#8217;s not <a href="http://docutils.sourceforge.net/rst.html">reStructuredText</a>.</p>

<p><a href="/rstiki/">rstiki</a> is a minimalist single-file CGI wiki, in python, which uses docutils to render reStructuredText markup.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.asynchronous.org/blog/archives/2007/02/03/rstiki-minimalist-wiki-using-restructuredtext/feed</wfw:commentRss>
		</item>
		<item>
		<title>wish (x10dev) 2.1.5 ebuild</title>
		<link>http://www.asynchronous.org/blog/archives/2006/11/26/wish-x10dev-215-ebuild</link>
		<comments>http://www.asynchronous.org/blog/archives/2006/11/26/wish-x10dev-215-ebuild#comments</comments>
		<pubDate>Sun, 26 Nov 2006 16:53:32 +0000</pubDate>
		<dc:creator>jsled</dc:creator>
		
		<category><![CDATA[~/stuff/unix]]></category>

		<guid isPermaLink="false">http://www.asynchronous.org/blog/?p=82</guid>
		<description><![CDATA[I got frustrated last week and fixed the wish-2.1.3 ebuild to install the
/dev/x10 nodes into /lib/udev/devices/.  It was
relatively hard to find this out, but when traditional
mknod-created nodes are in this directory, they&#8217;ll be copied
into the otherwise-dynamic /dev tree at boot time.  As such,
wish finally boots cleanly.

In the course of trying to track down [...]]]></description>
			<content:encoded><![CDATA[<p>I got frustrated last week and fixed the wish-2.1.3 ebuild to install the
<code>/dev/x10</code> nodes into <code>/lib/udev/devices/</code>.  It was
relatively hard to find this out, but when traditional
<code>mknod</code>-created nodes are in this directory, they&#8217;ll be copied
into the otherwise-dynamic <code>/dev</code> tree at boot time.  As such,
wish finally boots cleanly.</p>

<p>In the course of trying to track down other system lockups, I upgraded to the 2.6.18 kernel, and wish-2.1.3 stopped building for me.  A devfs header file that it used was finally deprecated out of the module-building header directory.  Luckily, in the mean time, wish-2.1.5 was released without this dependence on devfs.  I re-generated the patches, and updated the bug to be an <a href="http://bugs.gentoo.org/show_bug.cgi?id=133631">ebuild for wish-2.1.5, a.k.a. x10dev</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.asynchronous.org/blog/archives/2006/11/26/wish-x10dev-215-ebuild/feed</wfw:commentRss>
		</item>
		<item>
		<title>Org-mode (vs. planner-mode)</title>
		<link>http://www.asynchronous.org/blog/archives/2006/11/24/org-mode-vs-planner-mode</link>
		<comments>http://www.asynchronous.org/blog/archives/2006/11/24/org-mode-vs-planner-mode#comments</comments>
		<pubDate>Fri, 24 Nov 2006 17:15:06 +0000</pubDate>
		<dc:creator>jsled</dc:creator>
		
		<category><![CDATA[~/stuff/unix]]></category>

		<guid isPermaLink="false">http://www.asynchronous.org/blog/?p=81</guid>
		<description><![CDATA[Yesterday I switched from using
planner-mode to using
Org-Mode, both
emacs note-tasking and todo-task
management apps.  I&#8217;ve been using planner-mode for the last year and a half,
and rely on it pretty extensively to track upcoming todo items, in both
personal and work contexts.

I&#8217;ve read in the last couple of months, however, that Org-Mode is already in
emacs-cvs, and will be [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I switched from using
<a href="http://www.emacswiki.org/cgi-bin/wiki/PlannerMode">planner-mode</a> to using
<a href="http://staff.science.uva.nl/~dominik/Tools/org/">Org-Mode</a>, both
<a href="http://www.gnu.org/software/emacs/">emacs</a> note-tasking and todo-task
management apps.  I&#8217;ve been using planner-mode for the last year and a half,
and rely on it pretty extensively to track upcoming todo items, in both
personal and work contexts.</p>

<p>I&#8217;ve read in the last couple of months, however, that Org-Mode is already in
emacs-cvs, and will be part of the standard distribution of emacs-22.  I
decided to try it out, was quickly impressed, and transitioned over.</p>

<p>Both support the same basic data model: files of mixed notes and todo-items,
where the items are simply specially-formatted lines in the file.  Items have
an optional due date and an optional priority (ABC). For example, in
planner-mode, they appear:</p>

<h1>A  _ Write up planner-/org-mode post (2006.11.24)</h1>

<h1>B  X Make faux-chicken dinner for Thanksgiving (2006.11.23)</h1>

<p>For Org-mode:</p>

<p>** TODO [#A] Write up planner-/org-mode post
SCHEDULED: <2006-11-24>
** DONE Make faux-chicken dinner for Thanksgiving
SCHEDULED: <2006-11-23>
CLOSED: [2006-11-23 Thu]</p>

<p>Both support the same basic execution flow: when requested, the package looks
through the special files to find lines that fit the pattern, and constructs
another file (planner) or a transient view (Org) over past-due and
presently-due items.  There are operations for creating items, scheduling
them on a particular date, transitioning them closed, jumping from the item
to associated notes, &amp;c.  As well, both support some form of
unidirectional publishing of the content to HTML, ostensibly to serve as some
public project-planning status.</p>

<p>Org-mode, I&#8217;ve discovered, goes far beyond planner-mode in terms of features.</p>

<ul>
<li>Core</li>
<li>It is based on outliner-mode, and its documents are inherently foldable, hierarchical documents.</li>
<li><p>It uses file extension (&#8221;.org&#8221;) for mode-selection, so planning document can live next-to or within projects.</p></li>
<li><p>Todo</p></li>
<li>There&#8217;s a bit more latitude where items can be placed in the notes documents.</li>
<li>It supports &#8212; separately from the scheduled to-do time for a task &#8212; a deadline, which is brought up differently in the &#8220;now&#8221; view.</li>
<li>Overdue items are indicated more clearly.</li>
<li>Items can be scheduled for a range of time.</li>
<li>Items can be <a href="http://staff.science.uva.nl/~dominik/Tools/org/org.html#index-tags-323">tagged</a> arbitrarily and searched/viewed by tags (&#8221;WORK&#8221;, &#8220;STORE&#8221;, &#8220;@LAPTOP&#8221;, &#8230;)</li>
<li>Supports <a href="http://staff.science.uva.nl/~dominik/Tools/org/org.html#Progress-logging">progress logging</a></li>
<li><p>Supports <a href="http://staff.science.uva.nl/~dominik/Tools/org/org.html#Breaking-down-tasks">hierarchical sub-tasks</a> (yay!)</p></li>
<li><p>Linking</p></li>
<li>Explicit linking rather than CamelCase (though CamelCase is an option), which was the major problem I was having with planner-mode (it starts to become <em>really</em> slow for large documents).</li>
<li><p>Patterned links (&#8221;bugs:1234&#8243;, &#8220;http://bugs/show_bug.cgi?id=%s&#8221; &rarr; &#8220;[&#8230;]?id=1234&#8243;) are supported.</p></li>
<li><p>Other</p></li>
<li>Has a table/spreadsheet editor.  The table-editing part appears similar to <a href="http://table.sourceforge.net/">table.el</a>, but the spreadsheet functionality is just pure awesome.</li>
</ul>

<hr />

<blockquote>
  <p><em>Update</em> Mon 2006-11-27: after being contacted by Carten Dominik, the author of org-mode, I&#8217;ve revised the comment at the end about the table/spreadsheet editor.</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.asynchronous.org/blog/archives/2006/11/24/org-mode-vs-planner-mode/feed</wfw:commentRss>
		</item>
		<item>
		<title>Oscar handler</title>
		<link>http://www.asynchronous.org/blog/archives/2006/11/20/oscar-handler</link>
		<comments>http://www.asynchronous.org/blog/archives/2006/11/20/oscar-handler#comments</comments>
		<pubDate>Tue, 21 Nov 2006 06:05:12 +0000</pubDate>
		<dc:creator>jsled</dc:creator>
		
		<category><![CDATA[~/stuff/unix]]></category>

		<guid isPermaLink="false">http://www.asynchronous.org/blog/?p=80</guid>
		<description><![CDATA[Were you the Telepathy project, what would you name your Oscar protocol handler subproject?  Why, Wilde, of course.  Yuck yuck yuck.
]]></description>
			<content:encoded><![CDATA[<p>Were you the <a href="http://telepathy.freedesktop.org/wiki/">Telepathy</a> project, what would you name your <a href="http://en.wikipedia.org/wiki/OSCAR_Protocol">Oscar protocol</a> handler subproject?  Why, <a href="http://projects.collabora.co.uk/darcs/telepathy/telepathy-wilde">Wilde</a>, of course.  Yuck yuck yuck.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.asynchronous.org/blog/archives/2006/11/20/oscar-handler/feed</wfw:commentRss>
		</item>
		<item>
		<title>creating many graph instances in cacti</title>
		<link>http://www.asynchronous.org/blog/archives/2006/11/17/creating-many-graph-instances-in-cacti</link>
		<comments>http://www.asynchronous.org/blog/archives/2006/11/17/creating-many-graph-instances-in-cacti#comments</comments>
		<pubDate>Sat, 18 Nov 2006 00:56:43 +0000</pubDate>
		<dc:creator>jsled</dc:creator>
		
		<category><![CDATA[~/stuff/unix]]></category>

		<guid isPermaLink="false">http://www.asynchronous.org/blog/?p=79</guid>
		<description><![CDATA[cacti&#95;db.py is a script which
will clone an existing data-template and graph-template for multiple
(host,rrd&#95;file,template) instances.

In the scenario it was created for, data is (externally) collected into a
(directory) tree of RRD files.  While there are only a handful of unique RRD
file and graph types, there are a large number of instances of those
templates.  Good examples [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://asynchronous.org/2006/11/cacti_db.py">cacti&#95;db.py</a> is a script which
will clone an existing data-template and graph-template for multiple
(host,rrd&#95;file,template) instances.</p>

<p>In the scenario it was created for, data is (externally) collected into a
(directory) tree of RRD files.  While there are only a handful of unique RRD
file and graph <em>types</em>, there are a large number of <em>instances</em> of those
templates.  Good examples of this are:</p>

<ul>
<li>cpu load</li>
<li>1,5,15 minute averages</li>
<li>1 per machine</li>
<li>disk util</li>
<li>avail, used, free</li>
<li>~5 per machine</li>
<li>cache stats</li>
<li>(hit, miss, size) stats</li>
<li>2 .. 20 caches/&#8221;node&#8221;, depending type.</li>
</ul>

<p>This collected data might exist in the following tree of RRD files:</p>

<p>/servers/hostA/cpu.rrd
/servers/hostA/disk/root.rrd
/servers/hostA/disk/usr.rrd
/servers/hostA/disk/data/logs.rrd
/node/nodeA/<em>cache/foo.rrd
/node/nodeA/</em>cache/bar.rrd
[&#8230;15 more caches&#8230;]</p>

<p>Cacti has the following templates manually configured:</p>

<p>/servers/<em>/cpu
/servers/</em>/disk
/node/*/_cache</p>

<p>The script, then, knows how to relate RRD files of the regex pattern
<code>r'''/servers/([^/]+)/cpu'''</code> to the template(s) &#8220;/servers/*/cpu&#8221;, using the
regexp group 1 as the name of the host; edit the &#8216;<code>rrd&#95;types</code>&#8216; global to suit
your scenario.</p>

<p>Instances are named as their RRD file name (yes, skipping Cacti&#8217;s own
<code>|template&#95;formatting|</code>).</p>

<p>The script will delete instances with the same name, allowing you to re-run
it pretty liberally to pick up new rrd files, changes in templates, &amp;c.</p>

<p>The process of cloning is as follows; see
&#8216;<code>execute&#95;plan&#95;alpha(...)</code>&#8216; in the script for the gory details.</p>

<ul>
<li>find the host in table &#8216;<code>host</code>&#8216;.</li>
<li>data template instantiation</li>
<li>find the data template id (by name) in &#8216;<code>data&#95;template</code>&#8216;.</li>
<li>if an instance with the name already exists: delete it.</li>
<li>insert into data&#95;local, get new (autoinc) id for the instance.</li>
<li>get the list of rrd DSes from the template (from &#8216;<code>data&#95;template&#95;rrd</code>&#8216;)</li>
<li>copy each, maintaining the instance -> template id map.</li>
<li>instantiate the data&#95;template itself (&#8217;<code>data&#95;template&#95;data</code>&#8216;)</li>
<li>copy the RRAs as well (&#8217;<code>data&#95;template&#95;data&#95;rra</code>&#8216;)</li>
<li>graph instantiation</li>
<li>get the graph&#95;template&#95;id (by name) from &#8216;<code>graph&#95;templates</code>&#8216;</li>
<li>insert into &#8216;<code>graph&#95;local</code>&#8216;, get autoinc id.</li>
<li>instantiate graph (&#8217;<code>graph&#95;template</code>&#8216;).</li>
<li>copy &#8216;<code>graph&#95;instance&#95;item</code>&#8217;s, as this is where the graph-ds/rrd-ds mapping is stored, run the relevant ids through the map retained earlier.</li>
</ul>

<p>For details on Cacti 0.8&#8217;s rather atrocious database schema, see <a href="http://forums.cacti.net/about11932.html">Cacti
Forums: Database schema&#8230; WTF?</a> and
<a href="http://forums.cacti.net/about16374.html">Cacti Forums: Cacti data relationship diagram</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.asynchronous.org/blog/archives/2006/11/17/creating-many-graph-instances-in-cacti/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
