<?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>Chris Hellyar&#039;s Blog</title>
	<atom:link href="https://www.trash.co.nz/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.trash.co.nz</link>
	<description></description>
	<lastBuildDate>Mon, 07 Nov 2022 10:57:31 +0000</lastBuildDate>
	<language>en-NZ</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>Rapaki to Christchurch Adventure Park</title>
		<link>https://www.trash.co.nz/2022/11/rapaki-to-christchurch-adventure-park/</link>
					<comments>https://www.trash.co.nz/2022/11/rapaki-to-christchurch-adventure-park/#respond</comments>
		
		<dc:creator><![CDATA[Chris H]]></dc:creator>
		<pubDate>Mon, 07 Nov 2022 10:57:30 +0000</pubDate>
				<category><![CDATA[Mountain Biking]]></category>
		<guid isPermaLink="false">https://www.trash.co.nz/?p=2165</guid>

					<description><![CDATA[Rapaki to Christchurch Adventure Park We&#8217;re really lucky in Christchurch to have a good number of quite well maintained tracks right on the back doorstep of the city. A couple of weeks ago I took on my first decent sized mountain bike ride after suffering a ruptured Achilles tendon in my left leg back in... <a class="more-link" href="https://www.trash.co.nz/2022/11/rapaki-to-christchurch-adventure-park/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[
<p>Rapaki to Christchurch Adventure Park</p>



<figure class="wp-block-embed is-type-rich is-provider-embed-handler wp-block-embed-embed-handler wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe title="Rapaki to CAP" width="780" height="439" src="https://www.youtube.com/embed/VqdAzVsVnyM?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div></figure>



<p>We&#8217;re really lucky in Christchurch to have a good number of quite well maintained tracks right on the back doorstep of the city.</p>



<p>A couple of weeks ago I took on my first decent sized mountain bike ride after suffering a ruptured Achilles tendon in my left leg back in January. That&#8217;s a whole other painful story which I do intend to write up a bit but in the mean time, enjoy some random youtube.</p>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.trash.co.nz/2022/11/rapaki-to-christchurch-adventure-park/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>xFiles a Factor in icinga2 Graphite graphs</title>
		<link>https://www.trash.co.nz/2018/12/xfiles-a-factor-in-icinga2-graphite-graphs/</link>
					<comments>https://www.trash.co.nz/2018/12/xfiles-a-factor-in-icinga2-graphite-graphs/#comments</comments>
		
		<dc:creator><![CDATA[Chris H]]></dc:creator>
		<pubDate>Sat, 01 Dec 2018 03:34:52 +0000</pubDate>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Linux Geekery]]></category>
		<guid isPermaLink="false">https://www.trash.co.nz/?p=522</guid>

					<description><![CDATA[It seems I celebrated a little too soon after figuring out how to add extra archives into the whisper DB files behind graphite for icinga2.]]></description>
										<content:encoded><![CDATA[
<p>It seems I celebrated a little too soon after figuring out how to add extra archives into the whisper DB files behind graphite for icinga2.</p>



<p>This blog post is a bit of a ramble and may not make 100% sense if you didn&#8217;t read my other icinga2 graphite post first. <a href="https://www.trash.co.nz/2018/11/icinga2-graph-data-retention/">Check that out here</a>.</p>



<p>The flaw in my plan wasn&#8217;t apparent because I was only looking at the output of the ping4 plug-in in my testing, whereas I should have been checking some other graphs as well.</p>



<figure class="wp-block-image"><img decoding="async" loading="lazy" width="665" height="355" src="https://www.trash.co.nz/wp-content/uploads/2018/12/pingok.jpg" alt="5 days of ping history" class="wp-image-534" srcset="https://www.trash.co.nz/wp-content/uploads/2018/12/pingok.jpg 665w, https://www.trash.co.nz/wp-content/uploads/2018/12/pingok-300x160.jpg 300w, https://www.trash.co.nz/wp-content/uploads/2018/12/pingok-500x267.jpg 500w, https://www.trash.co.nz/wp-content/uploads/2018/12/pingok-150x80.jpg 150w, https://www.trash.co.nz/wp-content/uploads/2018/12/pingok-400x214.jpg 400w, https://www.trash.co.nz/wp-content/uploads/2018/12/pingok-200x107.jpg 200w" sizes="(max-width: 665px) 100vw, 665px" /><figcaption>Five days of ping history from archive 1 shows the retention is working.</figcaption></figure>



<p>Here we have a ping graph for five days of history on a server at work and it&#8217;s clearly working better than before as I only had one day of history originally.</p>



<p>This five day graph represents data in Archive 1 of the whisper file.  In this particular instance I&#8217;m keeping 10 minute increments for a week which is different from my example in my first blog but the end result is essentially the same.</p>



<figure class="wp-block-image"><img decoding="async" loading="lazy" width="658" height="357" src="https://www.trash.co.nz/wp-content/uploads/2018/12/sixmonthsping.jpg" alt="Six months of Ping" class="wp-image-535" srcset="https://www.trash.co.nz/wp-content/uploads/2018/12/sixmonthsping.jpg 658w, https://www.trash.co.nz/wp-content/uploads/2018/12/sixmonthsping-300x163.jpg 300w, https://www.trash.co.nz/wp-content/uploads/2018/12/sixmonthsping-500x271.jpg 500w, https://www.trash.co.nz/wp-content/uploads/2018/12/sixmonthsping-150x81.jpg 150w, https://www.trash.co.nz/wp-content/uploads/2018/12/sixmonthsping-400x217.jpg 400w, https://www.trash.co.nz/wp-content/uploads/2018/12/sixmonthsping-200x109.jpg 200w" sizes="(max-width: 658px) 100vw, 658px" /><figcaption>Archive 2 data showing six months history for Ping</figcaption></figure>



<p>The six month view gives us a look at the data from Archive 2, which is set to 30 minute increments for a year and gave me a false sense of success up till the point I looked at some other services graphite was presenting into icingaweb2.</p>



<figure class="wp-block-image"><img decoding="async" loading="lazy" width="670" height="352" src="https://www.trash.co.nz/wp-content/uploads/2018/12/load1day.jpg" alt="Load one day" class="wp-image-536" srcset="https://www.trash.co.nz/wp-content/uploads/2018/12/load1day.jpg 670w, https://www.trash.co.nz/wp-content/uploads/2018/12/load1day-300x158.jpg 300w, https://www.trash.co.nz/wp-content/uploads/2018/12/load1day-500x263.jpg 500w, https://www.trash.co.nz/wp-content/uploads/2018/12/load1day-150x79.jpg 150w, https://www.trash.co.nz/wp-content/uploads/2018/12/load1day-400x210.jpg 400w, https://www.trash.co.nz/wp-content/uploads/2018/12/load1day-200x105.jpg 200w" sizes="(max-width: 670px) 100vw, 670px" /><figcaption>One day history for load also looks fine</figcaption></figure>



<p>Load for 1 day is looking good and represents the one minute resolution records for a day in Archive 0, but when we view a graph that requires either of the other two archives the date range is clearly supported but the data is somewhat lacking.</p>



<figure class="wp-block-image"><img decoding="async" loading="lazy" width="662" height="361" src="https://www.trash.co.nz/wp-content/uploads/2018/12/load3days.jpg" alt="Load three days" class="wp-image-537" srcset="https://www.trash.co.nz/wp-content/uploads/2018/12/load3days.jpg 662w, https://www.trash.co.nz/wp-content/uploads/2018/12/load3days-300x164.jpg 300w, https://www.trash.co.nz/wp-content/uploads/2018/12/load3days-500x273.jpg 500w, https://www.trash.co.nz/wp-content/uploads/2018/12/load3days-150x82.jpg 150w, https://www.trash.co.nz/wp-content/uploads/2018/12/load3days-400x218.jpg 400w, https://www.trash.co.nz/wp-content/uploads/2018/12/load3days-200x109.jpg 200w" sizes="(max-width: 662px) 100vw, 662px" /><figcaption>Load graphs for three days with a sad lack of data</figcaption></figure>



<h3>Delve into the details<br></h3>



<p>I dug a little deeper into the world of .wsp files to get an understanding of what was happening and rather than using a shovel for the excavation I used the whisper-dump utility.</p>



<p>Whisper-dump does what it says on the label and dumps all of the data in a .wsp file out in a relatively human readable format.</p>



<p>The dump output consists of the header information which I extracted with whisper-info in my first post and then a raw dump of the data for as many archives as you have created in the file.</p>



<pre class="wp-block-code"><code>Meta data:
  aggregation method: average
  max retention: 31536000
  xFilesFactor: 0.5

Archive 0 info:
  offset: 52
  seconds per point: 60
  points: 1440
  retention: 86400
  size: 17280

Archive 1 info:
  offset: 17332
  seconds per point: 600
  points: 1008
  retention: 604800
  size: 12096

Archive 2 info:
  offset: 29428
  seconds per point: 1800
  points: 17520
  retention: 31536000
  size: 210240

Archive 0 data:
0: 1543097400, 0.0015430000000000001006417171822704404
1: 1543443060, 0.0016889999999999999631683511580604318
2: 1543097520, 0.0016540000000000000882072193064686871
3: 1543443180, 0.00154600000000000006514233596988106
....... (1440 lines of data)

Archive 1 data:
0: 1543104000, 0.0016808000000000003059524855686390765
1: 1543104600, 0.0018087999999999999477945378245635766
2: 1543105200, 0.001638599999999999822300478236059007
3: 1543105800, 0.0016849999999999996491001352794114609
........ (1008 lines of data)

Archive 2 data:
0: 1543104000, 0.0017094000000000000253491672097538867
1: 1543105800, 0.0018563333333333330993353271765045065
2: 1543107600, 0.0016944000000000002028460732717007886
3: 1543109400, 0.0018723333333333334882464527026968426
........ (17520 lines of data)</code></pre>



<p>The header confirms the archive structure we created using whisper-resize in the <a href="https://www.trash.co.nz/2018/11/icinga2-graph-data-retention/">first blog post</a> and the rest of the output is about 20,000 lines of text which I&#8217;ve cropped down for the sake of readability.</p>



<p>For Archive 0 there are 1,440 rows, which is the number of minutes in 24 hours.&nbsp; Similarly Archive 1 has 1008 lines for 10 minute resolution across a week and Archive 2 is 17,520 lines giving 30 minute resolution over a year.</p>



<p>The data points are recorded as a record ID, Unix epoch time stamp and then the data value which in this case is ping return time in seconds.</p>



<p>Unix epoch time stamps are the number of seconds since 00:00:00 on January 1st, 1970 UTC for those not familiar with the dark arts.</p>



<p>Looking at that data you might have quickly realised that the ID column and timestamps are not in sync for Archive 0 which is because the whisper file writing &#8220;wraps around &#8221; after a day and we don&#8217;t have one point of data per record.&nbsp; More on that later.</p>



<p>Archive 1 and 2 are sequential though as they have not wrapped yet and there is always a data point for them as they are an aggregate of Archive 0 and 1 respectively.&nbsp; In this case the average. <br></p>



<p>To make slightly more sense of the raw data I imported it into LibreOffice Calc and sorted by the time stamp.<br></p>



<figure class="wp-block-image"><img decoding="async" loading="lazy" width="848" height="288" src="https://www.trash.co.nz/wp-content/uploads/2018/12/pingsorted.jpg" alt="Ping Data sorted" class="wp-image-538" srcset="https://www.trash.co.nz/wp-content/uploads/2018/12/pingsorted.jpg 848w, https://www.trash.co.nz/wp-content/uploads/2018/12/pingsorted-300x102.jpg 300w, https://www.trash.co.nz/wp-content/uploads/2018/12/pingsorted-768x261.jpg 768w, https://www.trash.co.nz/wp-content/uploads/2018/12/pingsorted-500x170.jpg 500w, https://www.trash.co.nz/wp-content/uploads/2018/12/pingsorted-150x51.jpg 150w, https://www.trash.co.nz/wp-content/uploads/2018/12/pingsorted-400x136.jpg 400w, https://www.trash.co.nz/wp-content/uploads/2018/12/pingsorted-800x272.jpg 800w, https://www.trash.co.nz/wp-content/uploads/2018/12/pingsorted-200x68.jpg 200w" sizes="(max-width: 848px) 100vw, 848px" /><figcaption>The Ping data, sorted by Unix time stamp</figcaption></figure>



<p>If you&#8217;re really quick at maths you&#8217;ll notice that the Archive 0 data points are actually 120 second apart but for clarity I added the &#8220;diff s&#8221; column.&nbsp; </p>



<p>This is because I&#8217;m only pinging things once every two minutes. Other than that little anomaly everything is good with Archive 1 and 2 showing average values so it still wasn&#8217;t obvious what was broken just yet.</p>



<h3>Eureka!</h3>



<p>Once I&#8217;d done the same import and conversion with the load service raw data and I had a eureka moment but only because I&#8217;d just spent more time reading the graphite documentation than I&#8217;m prepared to admit in polite company.</p>



<figure class="wp-block-image"><img decoding="async" loading="lazy" width="814" height="296" src="https://www.trash.co.nz/wp-content/uploads/2018/12/loaddatasorted.jpg" alt="Load data sorted" class="wp-image-539" srcset="https://www.trash.co.nz/wp-content/uploads/2018/12/loaddatasorted.jpg 814w, https://www.trash.co.nz/wp-content/uploads/2018/12/loaddatasorted-300x109.jpg 300w, https://www.trash.co.nz/wp-content/uploads/2018/12/loaddatasorted-768x279.jpg 768w, https://www.trash.co.nz/wp-content/uploads/2018/12/loaddatasorted-500x182.jpg 500w, https://www.trash.co.nz/wp-content/uploads/2018/12/loaddatasorted-150x55.jpg 150w, https://www.trash.co.nz/wp-content/uploads/2018/12/loaddatasorted-400x145.jpg 400w, https://www.trash.co.nz/wp-content/uploads/2018/12/loaddatasorted-800x291.jpg 800w, https://www.trash.co.nz/wp-content/uploads/2018/12/loaddatasorted-200x73.jpg 200w" sizes="(max-width: 814px) 100vw, 814px" /><figcaption>Sorted load data does not look so good</figcaption></figure>



<p>The data points are 300 seconds apart which makes sense as I&#8217;m only checking processor load every five minutes.  If I were to optimise the whisper files for every service I&#8217;d probably use whisper-resize and carbon-cache storage settings to set all of the load files to 5 minute resolution in Archive 0.<br></p>



<p>The reality of that is that the time/cost benefit for me while rolling out icinga2 is not really there and even at work with 20,000 + graphed items in graphite / icinga2 so far it&#8217;s only a few GB of disk space being consumed.</p>



<h3>What went wrong?<br></h3>



<p>So at this point we need to refer back to the graphite, or more specifically carbon-cache documentation.  The value of the xFilesFactor setting in the .wsp is where we need to be looking.</p>



<blockquote class="wp-block-quote"><p>&#8220;xFilesFactor should be a floating point number between 0 and 1, and specifies what fraction of the previous retention level’s slots must have non-null values in order to aggregate to a non-null value. The default is 0.5.&#8221;</p><cite>ref: <a href="https://graphite.readthedocs.io/en/latest/config-carbon.html">https://graphite.readthedocs.io/en/latest/config-carbon.html</a><br></cite></blockquote>



<p>What that means is if you want the aggregation of data to flow to the lower resolution archives in your whisper file by default you need to have 50% coverage of possible data points.&nbsp;  In this example that means five data points out of the ten possible for each 10 minute slot to be averaged out and land in Archive 1.<br></p>



<p>This worked out on ping4 because the resolution of the Archive 0 was one minute and I was doing the ping every two minuets for 50% coverage. </p>



<p>To state it a different way:  If I&#8217;d been pinging every 3 minutes I&#8217;d only have 30% coverage and the aggregation would not have worked.&nbsp; Pinging every minute would give 100% coverage.<br></p>



<figure class="wp-block-image"><img decoding="async" loading="lazy" width="847" height="279" src="https://www.trash.co.nz/wp-content/uploads/2018/12/pingsortedcolour.jpg" alt="Sorted ping data with colour coding" class="wp-image-540" srcset="https://www.trash.co.nz/wp-content/uploads/2018/12/pingsortedcolour.jpg 847w, https://www.trash.co.nz/wp-content/uploads/2018/12/pingsortedcolour-300x99.jpg 300w, https://www.trash.co.nz/wp-content/uploads/2018/12/pingsortedcolour-768x253.jpg 768w, https://www.trash.co.nz/wp-content/uploads/2018/12/pingsortedcolour-500x165.jpg 500w, https://www.trash.co.nz/wp-content/uploads/2018/12/pingsortedcolour-150x49.jpg 150w, https://www.trash.co.nz/wp-content/uploads/2018/12/pingsortedcolour-400x132.jpg 400w, https://www.trash.co.nz/wp-content/uploads/2018/12/pingsortedcolour-800x264.jpg 800w, https://www.trash.co.nz/wp-content/uploads/2018/12/pingsortedcolour-200x66.jpg 200w" sizes="(max-width: 847px) 100vw, 847px" /><figcaption>The ping4 data showing how it&#8217;s averaged to the lower archives</figcaption></figure>



<p>This was an accident though, as at that stage I had read just enough of the graphite documentation to make it work and having precisely 50% was good luck, not good management. </p>



<p>For load however I&#8217;m not even close to the default 50% when you look at the available data for aggregation down to the ten minute resolution of Archive 1 there are only two of the possible ten points available which is 20%.</p>



<figure class="wp-block-image"><img decoding="async" loading="lazy" width="815" height="295" src="https://www.trash.co.nz/wp-content/uploads/2018/12/loadcolouredfail.jpg" alt="Load data fail" class="wp-image-542" srcset="https://www.trash.co.nz/wp-content/uploads/2018/12/loadcolouredfail.jpg 815w, https://www.trash.co.nz/wp-content/uploads/2018/12/loadcolouredfail-300x109.jpg 300w, https://www.trash.co.nz/wp-content/uploads/2018/12/loadcolouredfail-768x278.jpg 768w, https://www.trash.co.nz/wp-content/uploads/2018/12/loadcolouredfail-500x181.jpg 500w, https://www.trash.co.nz/wp-content/uploads/2018/12/loadcolouredfail-150x54.jpg 150w, https://www.trash.co.nz/wp-content/uploads/2018/12/loadcolouredfail-400x145.jpg 400w, https://www.trash.co.nz/wp-content/uploads/2018/12/loadcolouredfail-800x290.jpg 800w, https://www.trash.co.nz/wp-content/uploads/2018/12/loadcolouredfail-200x72.jpg 200w" sizes="(max-width: 815px) 100vw, 815px" /><figcaption>The load data only has 20% coverage so the aggregation does not work</figcaption></figure>



<h3>Fixing things up<br></h3>



<p>There&#8217;s two possible ways you can fix this problem; create individual rules in /etc/carbon-cache/storage-schemas.conf for each metric you keep in graphite / icinga2 to match your polling periods, or just hit it with a sledgehammer as I did and set xFilesFactor = 0 for everything.</p>



<p>If you had a small icinga2 installation you might consider polling everything every minute as well if all of the hosts were on one LAN and performance was not a concern.</p>



<p>Even with the modest config I run for my home office deployment I&#8217;m how over 800 services monitored on 38 hosts.&nbsp; There&#8217;s even two remote monitoring zones across VPN&#8217;s to AWS and Linode.</p>



<p>Many of those monitored services are things like backup completion which you only need to check on once an hour at most.&nbsp; Other things like available patches, SSL certificate expiration only needs to he checked once a day, maybe less.<br></p>



<p>On a larger deployment you&#8217;ll quickly have thousands of monitored services. The processor load and network bandwidth consumed to monitor things every minute can becomes a major issue.<br></p>



<p>So, with that in mind I kept my mix of monitoring periods and just changed all of my whisper xFilesFactors to be 0.&nbsp; This means that you only need one data point per period in Archive 1 in Archive 0 for the aggregation to work.<br></p>



<p>To make this change I modified my default rule for new whisper files in /etc/carbon-cache/storage-schemas.conf to be:</p>



<pre class="wp-block-code"><code>[default]
pattern = .*
xFilesFactor = 0
retentions=60s:1d,5m:1w,15m:1y</code></pre>



<p>And then re-ran a slightly updated bit of find-foo to update the existing files and ran it across the server again.</p>



<pre class="wp-block-code"><code># cd /var/lib/graphite/whisper/icinga2
# find . -name *wsp -exec whisper-resize --xFilesFactor=0 '{}' 60s:1d 5m:1w 15m:1y \;
# chown -R _graphite:_graphite *</code></pre>



<p>After a restart of carbon-cache and waiting a couple of days I now have Archives populating and graphs graphing.</p>



<figure class="wp-block-image"><img decoding="async" loading="lazy" width="674" height="367" src="https://www.trash.co.nz/wp-content/uploads/2018/12/load3daysworking.jpg" alt="Load thee days working" class="wp-image-543" srcset="https://www.trash.co.nz/wp-content/uploads/2018/12/load3daysworking.jpg 674w, https://www.trash.co.nz/wp-content/uploads/2018/12/load3daysworking-300x163.jpg 300w, https://www.trash.co.nz/wp-content/uploads/2018/12/load3daysworking-500x272.jpg 500w, https://www.trash.co.nz/wp-content/uploads/2018/12/load3daysworking-150x82.jpg 150w, https://www.trash.co.nz/wp-content/uploads/2018/12/load3daysworking-400x218.jpg 400w, https://www.trash.co.nz/wp-content/uploads/2018/12/load3daysworking-200x109.jpg 200w" sizes="(max-width: 674px) 100vw, 674px" /><figcaption>Three days of load graph after fixing xFilesFactor.</figcaption></figure>



<p>In typical software-demo style there is a big glitch in that graph.&nbsp; That was caused by a power cut last night for longer than my home UPS could hold the hypervisor up.<br></p>



<p>The graph however, is now a thing of beauty.<br></p>



<p>I&#8217;ve updated <a href="https://www.trash.co.nz/2018/11/icinga2-graph-data-retention/">my original blog post</a> to include references to xFilesFactor, so if you use the example settings from there you&#8217;ll be fine as well.&nbsp; Post a comment below if you find any glaring errors or found this useful.<br></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.trash.co.nz/2018/12/xfiles-a-factor-in-icinga2-graphite-graphs/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Icinga2 graph data retention</title>
		<link>https://www.trash.co.nz/2018/11/icinga2-graph-data-retention/</link>
					<comments>https://www.trash.co.nz/2018/11/icinga2-graph-data-retention/#comments</comments>
		
		<dc:creator><![CDATA[Chris H]]></dc:creator>
		<pubDate>Sun, 25 Nov 2018 01:53:55 +0000</pubDate>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Linux Geekery]]></category>
		<guid isPermaLink="false">https://www.trash.co.nz/?p=503</guid>

					<description><![CDATA[Out with Nagios, in with icinga2 Note: I&#8217;ve updated this post since I originally posted it.&#160; See my post about xFilesFactor here which describes why I updated it. I&#8217;ve been on a bit of a journey over the last few months migrating from nagios to icinga2 for my systems, some customer stuff and the platforms... <a class="more-link" href="https://www.trash.co.nz/2018/11/icinga2-graph-data-retention/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[
<h3>Out with Nagios, in with icinga2</h3>



<p><em>Note: I&#8217;ve updated this post since I originally posted it.&nbsp; See my </em><a href="https://www.trash.co.nz/2018/12/xfiles-a-factor-in-icinga2-graphite-graphs/"><em>post about xFilesFactor here</em></a><em> which describes why I updated it.</em><br></p>



<p>I&#8217;ve been on a bit of a journey over the last few months migrating from nagios to <a href="https://icinga.com/products/icinga-2/">icinga2</a> for my systems, some customer stuff and the platforms at my day job after living through the love-hate that is nagios on and off for quite a few years now.</p>



<figure class="wp-block-image"><img decoding="async" loading="lazy" width="1024" height="459" src="https://www.trash.co.nz/wp-content/uploads/2018/11/icinga-1024x459.jpg" alt="Out with nagios, in with icinga2" class="wp-image-512" srcset="https://www.trash.co.nz/wp-content/uploads/2018/11/icinga-1024x459.jpg 1024w, https://www.trash.co.nz/wp-content/uploads/2018/11/icinga-300x135.jpg 300w, https://www.trash.co.nz/wp-content/uploads/2018/11/icinga-768x345.jpg 768w, https://www.trash.co.nz/wp-content/uploads/2018/11/icinga-500x224.jpg 500w, https://www.trash.co.nz/wp-content/uploads/2018/11/icinga-150x67.jpg 150w, https://www.trash.co.nz/wp-content/uploads/2018/11/icinga-1200x538.jpg 1200w, https://www.trash.co.nz/wp-content/uploads/2018/11/icinga-400x179.jpg 400w, https://www.trash.co.nz/wp-content/uploads/2018/11/icinga-800x359.jpg 800w, https://www.trash.co.nz/wp-content/uploads/2018/11/icinga-200x90.jpg 200w, https://www.trash.co.nz/wp-content/uploads/2018/11/icinga.jpg 1206w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>Icinga2 is so much nicer than nagios once set up.</figcaption></figure>



<p>On top of the base icinga2 / icingaweb2 install I added the graphite graphing module which essentially worked out of the box give or take a couple of typos on my part .&nbsp; You can find all the information you need for that part of the journey on the <a href="https://github.com/Icinga/icingaweb2-module-graphite">github page for the module</a>.</p>



<p>The <a href="https://graphiteapp.org/">graphite</a> module in the context of icinga2 has three moving parts:</p>



<ul><li>Carbon-cache, which receives the information from icinga2 and writes it out to disk as efficiently as possible</li><li>Whisper which is the database format used to store the metrics which can be thought of as a more modern and efficient version of the venerable <a href="https://en.wikipedia.org/wiki/RRDtool">RRD</a> which all sysadmins since Noah&#8217;s time probably have some sort of emotional response to.</li><li>Graphite which renders the metrics into pretty graphs into PNG format graphs.</li></ul>



<h3>The problem, only a day of data</h3>



<p>A few days back I discovered that despite a my fairly uneventful installation of the graphite module on my part the graphs, despite being very pretty were only keeping a day worth of data.</p>



<iframe loading="lazy" src="https://www.youtube.com/embed/JOyyt3_VlQI" allowfullscreen="allowfullscreen" width="560" height="315" frameborder="0"><span style="display: inline-block; width: 0px; overflow: hidden; line-height: 0;" data-mce-type="bookmark" class="mce_SELRES_start">﻿</span></iframe>



<span id="more-503"></span>



<p>So off to Google (Who is, for the record, not evil) I go and although
 I did find the solution it was scattered across separate documentation 
sites and forum posts.&nbsp; I also found that some of the information was a 
dated compared to the current versions of things I&#8217;m using so here&#8217;s a 
write up of my solution in one place in case anyone else is similarly 
searching for a one stop solution.</p>



<p>The symptom of the low 
retention time is best described with a video.&nbsp; Essentially you select 
anything larger than a one day period in the icingaweb2 interface and 
the graph does not get any bigger.&nbsp; Insert sad face here.</p>



<p>FYI: I&#8217;m
 writing this based on running Ubuntu 18.04LTS and icinga2 installed 
from the PPA.&nbsp; Icinga2 is version 2.10.2-1.bionic, graphite-carbon is 
1.0.2-1.</p>



<h3>Retention settings in carbon</h3>



<p>The retention settings for new graphs created by carbon are found in /etc/carbon/storage-schemas.conf and the default setting is:</p>



<pre class="wp-block-code"><code>[default_1min_for_1day] 
pattern = .*
retentions = 60s:1d</code></pre>



<p>That is basically saying keep one minute resolution of data for a day.</p>



<p>Settings in the file are processed from top to bottom until a match for &#8216;pattern&#8217; is found so if a metric matches the first pattern in the file that is the one used.&nbsp; The patterns are <a href="https://docs.python.org/3/howto/regex.html">python regex</a> format so&nbsp; &#8216;.*&#8217; in the default above matches everything.</p>



<p>Just like RRD, whisper can retain multiple &#8216;archives&#8217; of a metric with differing resolutions and time spans.&nbsp; In the storage-schemas file for carbon cache that is represented as comma separated pairs of values in reducing resolution and increasing time span.</p>



<p>By way of example <strong>60s:1d,5m:1w,15m:1y</strong> would keep a one minute resolution for a day, five minute averages for a week, and 15 minute averages data for a year.</p>



<p>The new entry in the config file for that would look like:</p>



<pre class="wp-block-code"><code>[default]
pattern = .*
xFilesFactor = 0
retentions = 60s:1d,5m:1w,15m:1y</code></pre>



<p>Note that [default] just has to be unique, the actual text is kinda irrelevant but if you have two [billybob] entries in the file you&#8217;ll get an odd-ball error when you restart carbon.</p>



<p><em>Note the xFilesFactor setting as well.&nbsp; My second blog post about Graphite and Icinga2 graphing describes what&#8217;s going on there.&nbsp; </em><a href="https://www.trash.co.nz/2018/12/xfiles-a-factor-in-icinga2-graphite-graphs/"><em>Read that post here.</em></a><br></p>



<h3>Fixing existing graphs<br></h3>



<p>After you re-start carbon you&#8217;ll find that it only affects newly created whisper files, not your existing ones.</p>



<p>You could just delete all of the whisper files and let the system re-create them, or you can fix them up using the whisper-resize tool shipped in the graphite-carbon package.&nbsp; To apply our new rule to a single file you could use the following incantation:</p>



<pre class="wp-block-code"><code>whisper-resize &lt;filename>.wsp --xFilesFactor=0 60s:1d 5m:1w 15m:1y</code></pre>



<p>Note that whisper-resize uses spaces instead of commas like the config file.</p>



<p><em>Note the xFilesFactor = 0 setting as well.&nbsp; My second blog post about Graphite and Icinga2 graphing describes what&#8217;s going on there.&nbsp; </em><a href="https://www.trash.co.nz/2018/12/xfiles-a-factor-in-icinga2-graphite-graphs/"><em>Read that post here.</em></a></p>



<p>All of the whisper files live under /var/lib/graphite/whisper/icinga2/ in a directory structure representing the metric names.&nbsp; In the following example we&#8217;re working with the response time for a tcp check on port 80 to a machine called mailhost.vpn in icinga2.</p>



<p>If you&#8217;ve got this far and realise you don&#8217;t know what I&#8217;m on about can I suggest you back out slowly now and get your head around icinga2 before messing with tuning graphite&#8230;</p>



<p>In all of the command-line copy&#8217;n&#8217;paste I&#8217;ve put a pwd at the top and cropped the paths as they were waaaaay too wide for a blog post.</p>



<pre class="wp-block-code"><code>root@icinga: # pwd
/var/lib/graphite/whisper/icinga2/mailhost_vpn/services/http:80/tcp/perfdata/time
root@icinga: # ls -l
total 40
-rw-r--r-- 1 _graphite _graphite 17308 Nov 25 11:04 max.wsp
-rw-r--r-- 1 _graphite _graphite 17308 Nov 25 11:04 value.wsp
root@icinga: # whisper-resize value.wsp --xFilesFactor=0 60s:1d 5m:1w 15m:1y
Retrieving all data from the archives
Creating new whisper database: value.wsp.tmp
Created: value.wsp.tmp (462004 bytes)
Migrating data without aggregation...
Renaming old database to: value.wsp.bak
Renaming new database to: value.wsp
root@icinga: # ls -l
total 492
-rw-r--r-- 1 _graphite _graphite 17308 Nov 25 11:09 max.wsp
-rw-r--r-- 1 root root 462004 Nov 25 11:11 value.wsp
-rw-r--r-- 1 _graphite _graphite 17308 Nov 25 11:09 value.wsp.bak
root@icinga: # chown _graphite:_graphite *
root@icinga: #</code></pre>



<p><strong><em>Note:</em></strong> you need to change the owner of the file back to _graphite:_graphite after you make changes as root, or &#8216;sudo -u _graphite&#8217; the commands.</p>



<p>You&#8217;ll see that the wsp file has grown out to 462k from 17k. That might be an issue for your system if you are tracking a lot of metrics.&nbsp; On my test icinga2 instance I have 3,700 .wsp files so that equates to the wsp files expanding out to take 1.6GB of disk.</p>



<p>You can check the before and after using whisper-info:</p>



<p><strong>Before:</strong></p>



<pre class="wp-block-code"><code>root@icinga: # whisper-info value.wsp.bak
maxRetention: 86400
xFilesFactor: 0.5
aggregationMethod: average
fileSize: 17308

Archive 0
retention: 86400
secondsPerPoint: 60
points: 1440
size: 17280
offset: 28</code></pre>



<p><strong>After:</strong></p>



<pre class="wp-block-code"><code>root@icinga: # whisper-info value.wsp
maxRetention: 31536000
xFilesFactor: 0
aggregationMethod: average
fileSize: 462004

Archive 0
retention: 86400
secondsPerPoint: 60
points: 1440
size: 17280
offset: 52

Archive 1
retention: 604800
secondsPerPoint: 300
points: 2016
size: 24192
offset: 17332

Archive 2
retention: 31536000
secondsPerPoint: 900
points: 35040
size: 420480
offset: 41524</code></pre>



<p>The &#8216;After&#8217;&nbsp; shows the three separate archives with different settings in seconds.&nbsp; Did you know that there were 31,536,000 seconds in a year?</p>



<p>Obviously with 3,700 files to modify if I wanted the retention the same all round it&#8217;d take ages to manually modify all the files so find and a little testing gave me:</p>



<pre class="wp-block-code"><code># find /var/lib/graphite/whisper/icinga2 -name *wsp -exec whisper-resize '{}' --xFilesFactor=0 60s:1d 5m:1w 15m:1y \; 
# chown -R _graphite:_graphite /var/lib/graphite/whisper/icinga2</code></pre>



<p>Run from the host folder /var/lib/graphite/whisper/icinga2/mailhost_vpn changes all of the graphs for that single host, or you can go a level up and do everything in one shot.</p>



<p>If you&#8217;re concerned about resources and think a system wide re-size will kill things, this was my experience; the test system has 37 hosts with 785 services, 3,700 wsp files.&nbsp; It&#8217;s running on a VM with two cores on a 2.8Ghz i5 and 1GB of ram. It took a shade over two minutes and disk space usage for graphite went from 72MB to 1.6GB when the .bak files were cleaned up.</p>



<h3>Being Selective<br></h3>



<figure class="wp-block-image"><img decoding="async" loading="lazy" width="675" height="373" src="https://www.trash.co.nz/wp-content/uploads/2018/11/udpatesavailable.jpg" alt="Updates Available" class="wp-image-507" srcset="https://www.trash.co.nz/wp-content/uploads/2018/11/udpatesavailable.jpg 675w, https://www.trash.co.nz/wp-content/uploads/2018/11/udpatesavailable-300x166.jpg 300w, https://www.trash.co.nz/wp-content/uploads/2018/11/udpatesavailable-500x276.jpg 500w, https://www.trash.co.nz/wp-content/uploads/2018/11/udpatesavailable-150x83.jpg 150w, https://www.trash.co.nz/wp-content/uploads/2018/11/udpatesavailable-400x221.jpg 400w, https://www.trash.co.nz/wp-content/uploads/2018/11/udpatesavailable-200x111.jpg 200w" sizes="(max-width: 675px) 100vw, 675px" /><figcaption>No point in 1 minute increments for this one.</figcaption></figure>



<p>If you&#8217;ve running a large system monitoring many thousands of metrics you probably don&#8217;t want, or need the same resolution for all metrics.</p>



<p>Carbon allows you to apply patterns in the storage-schemas file and the first match for a new graph wins, so to speak.</p>



<p>An example would be using the &#8216;apt&#8217; check within icinga2 which I run every 12 hours on Debian and Ubuntu systems.&nbsp; There is simply no point in recording data at any higher resolution than say 1 hour for that graph but the nice default we just applied to all of the whisper files has it storing thousands of useless data points.</p>



<p>As well as the disk space concerns, having multiple archives in the whisper files substantially increases processing overheads for carbon as it has to average data out and write it to each of the successively lower resolution archives in the file each time it writes a check.</p>



<p>That might not be an issue for a system with 700 metrics, but what about 70,000?&nbsp; In larger systems it would quickly be justified putting graphite on a separate host for that reason, but I&#8217;m running everything on the one small VM.</p>



<p>Checking the name for the whisper files for the apt plugin we find:</p>



<pre class="wp-block-code"><code>root@icinga:/var/lib/graphite/whisper/icinga2/mailhost_vpn# find . | grep apt 
./services/apt
./services/apt/apt
./services/apt/apt/perfdata
./services/apt/apt/perfdata/available_upgrades
./services/apt/apt/perfdata/available_upgrades/value.wsp ./services/apt/apt/perfdata/critical_updates
./services/apt/apt/perfdata/critical_updates/value.wsp
root@icinga:/var/lib/graphite/whisper/icinga2/mailhost_vpn#</code></pre>



<p>Taking that path information we can create a pattern regex match in the storage-schemas.conf file and apply a more sane retention for apt checks.</p>



<p>The metric names you&#8217;re matching on are the path in the whisper directory structure with &#8216;/&#8217; replaced with a &#8216;.&#8217; and without the .wsp on the end.&nbsp;</p>



<p>That makes the full name for one of the metrics above:</p>



<pre class="wp-block-code"><code>icinga2.mailhost_vpn.services.apt.apt.perfdata.available_upgrades.value</code></pre>



<p>All we need to do is match the end of that long mess to pick up everything for the apt plugin on all hosts.&nbsp; Lucky for those of us who are regex challenged that&#8217;s really easy using the &#8216;$&#8217; operator.&nbsp;</p>



<p>The resulting storage-schemes.conf would look like:</p>



<pre class="wp-block-code"><code>[apt-upgrades] 
pattern = available_upgrades.value$ 
retentions = 1h:1y 
[apt-critical] 
pattern = critical_updates.value$
retentions = 1h:1y 
[default] 
pattern = .* 
xFilesFactor = 0
retentions=60s:1d,5m:1w,15m:1y</code></pre>



<p>To check that this is working, and taking the example of another host (icinga.home) we check the original default-retention whisper file using whisper-info to find the single one minute / one day Archive:</p>



<pre class="wp-block-code"><code>root@icinga:# pwd /var/lib/graphite/whisper/icinga2/icinga_home/services/apt/apt/perfdata/available_upgrades 
root@icinga:# whisper-info value.wsp 
maxRetention: 86400 
xFilesFactor: 0.5 
aggregationMethod: 
average fileSize: 17308 

Archive 0
retention: 86400 
secondsPerPoint: 60 
points: 1440 
size: 17280 
offset: 28</code></pre>



<p>To test the carbon config change:</p>



<ul><li>Change the retention settings in carbon per the example above.</li><li>Restart carbon using &#8216;service carbon-cache restart&#8217;, or systemctl if that&#8217;s how you rock.</li><li>Delete the value.wsp file for your test host.</li><li>Re-run the check a couple of times using the icingaweb interface to force the re-creation of the wsp file.</li><li>check it again with whisper-info.</li></ul>



<p>Whisper-info should now return:</p>



<pre class="wp-block-code"><code># whisper-info value.wsp
maxRetention: 31536000
xFilesFactor: 0.5
aggregationMethod:
average fileSize: 105148

Archive 0
retention: 31536000
secondsPerPoint: 3600
points: 8760
size: 105120
offset: 28</code></pre>



<p>So only 100k of data to support a years worth of that metric and this will reduce the processor overhead of averaging and archiving data which is probably a larger concern if you&#8217;ve read down this far.</p>



<p>You can now apply this retention rule to all of your existing .wsp files using a little bit of find-grep-xargs-foo if you don&#8217;t want to delete the current history information.&nbsp; Run this, or a variation of it, in the appropriate folder to pick up one host or all of them.</p>



<pre class="wp-block-code"><code># find . -name *wsp | grep available_upgrades | xargs -n 1 -I % whisper-resize % 1h:1y 
# find . -name *wsp | grep critical_updates | xargs -n 1 -I % whisper-resize % 1h:1y 
# chown -R _graphite:_graphite /var/lib/graphite/whisper/icinga2</code></pre>



<p>As with all bash-foo I&#8217;d suggest replacing the whisper-resize command with &#8216;echo&#8217; until you&#8217;re happy that you&#8217;re not going to accidentally DDOS hotmail or cause a sudden loss of gravity in Jamaica taxi cabs.&nbsp; A backup before you take anything I type as advice wouldn&#8217;t be a bad idea either.</p>



<p>Once you&#8217;re happy with the results you can remove all of the .wsp.bak files as well to fee up a bit of space.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.trash.co.nz/2018/11/icinga2-graph-data-retention/feed/</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
			</item>
		<item>
		<title>Testing 123, SOTA on the lawn.</title>
		<link>https://www.trash.co.nz/2018/11/testing-123-sota-on-the-lawn/</link>
					<comments>https://www.trash.co.nz/2018/11/testing-123-sota-on-the-lawn/#comments</comments>
		
		<dc:creator><![CDATA[Chris H]]></dc:creator>
		<pubDate>Tue, 13 Nov 2018 11:24:02 +0000</pubDate>
				<category><![CDATA[Ham Radio]]></category>
		<guid isPermaLink="false">https://www.trash.co.nz/?p=488</guid>

					<description><![CDATA[Technically not really SOTA, because that would require a summit, but testing an Antenna I built for the purpose at least 18 months ago. SOTA, Summits on the air is a slightly crazy pursuit within the larger sphere of amateur radio involving lugging radio gear, including batteries and antennas, up a mountain or random hillock... <a class="more-link" href="https://www.trash.co.nz/2018/11/testing-123-sota-on-the-lawn/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p><div id="attachment_489" style="width: 177px" class="wp-caption alignright"><img aria-describedby="caption-attachment-489" decoding="async" loading="lazy" class="size-medium wp-image-489" src="https://www.trash.co.nz/wp-content/uploads/2018/11/181111-165712-3280-167x300.jpg" alt="Sota pole on the lawn" width="167" height="300" srcset="https://www.trash.co.nz/wp-content/uploads/2018/11/181111-165712-3280-167x300.jpg 167w, https://www.trash.co.nz/wp-content/uploads/2018/11/181111-165712-3280-768x1381.jpg 768w, https://www.trash.co.nz/wp-content/uploads/2018/11/181111-165712-3280-569x1024.jpg 569w, https://www.trash.co.nz/wp-content/uploads/2018/11/181111-165712-3280-500x899.jpg 500w, https://www.trash.co.nz/wp-content/uploads/2018/11/181111-165712-3280-150x270.jpg 150w, https://www.trash.co.nz/wp-content/uploads/2018/11/181111-165712-3280-400x719.jpg 400w, https://www.trash.co.nz/wp-content/uploads/2018/11/181111-165712-3280-800x1439.jpg 800w, https://www.trash.co.nz/wp-content/uploads/2018/11/181111-165712-3280-200x360.jpg 200w, https://www.trash.co.nz/wp-content/uploads/2018/11/181111-165712-3280.jpg 963w" sizes="(max-width: 167px) 100vw, 167px" /><p id="caption-attachment-489" class="wp-caption-text">SOTA pole on the lawn</p></div></p>
<p>Technically not really <a href="https://www.sota.org.uk/">SOTA</a>, because that would require a summit, but testing an Antenna I built for the purpose at least 18 months ago.</p>
<p>SOTA, Summits on the air is a slightly crazy pursuit within the larger sphere of amateur radio involving lugging radio gear, including batteries and antennas, up a mountain or random hillock to try and talk to other similarly afflicted amateur radio tragics around the country and around the world.</p>
<p>I made this antenna so long ago now I couldn&#8217;t rightly remember if it worked so before I venture out into the wild blue yonder over summer to try and scale the heights with a backpack of assorted technology I thought I should check it was working.</p>
<p>So there I am, lying on the lawn with the trusty FT857 and a LiPO battery from one of my model aircraft plugged into the back.</p>
<p>The dog is wondering what on earth I&#8217;m doing as he&#8217;s normally the one lying on the lawn on a sunny Saturday afternoon and he&#8217;s certainly not sure about the wire and string creation I&#8217;ve pegged up near the trampoline.</p>
<p><div id="attachment_490" style="width: 310px" class="wp-caption alignleft"><img aria-describedby="caption-attachment-490" decoding="async" loading="lazy" class="size-medium wp-image-490" src="https://www.trash.co.nz/wp-content/uploads/2018/11/181111-171535-3294-300x220.jpg" alt="Packed antenna." width="300" height="220" srcset="https://www.trash.co.nz/wp-content/uploads/2018/11/181111-171535-3294-300x220.jpg 300w, https://www.trash.co.nz/wp-content/uploads/2018/11/181111-171535-3294-768x564.jpg 768w, https://www.trash.co.nz/wp-content/uploads/2018/11/181111-171535-3294-1024x753.jpg 1024w, https://www.trash.co.nz/wp-content/uploads/2018/11/181111-171535-3294-500x367.jpg 500w, https://www.trash.co.nz/wp-content/uploads/2018/11/181111-171535-3294-150x110.jpg 150w, https://www.trash.co.nz/wp-content/uploads/2018/11/181111-171535-3294-1200x882.jpg 1200w, https://www.trash.co.nz/wp-content/uploads/2018/11/181111-171535-3294-400x294.jpg 400w, https://www.trash.co.nz/wp-content/uploads/2018/11/181111-171535-3294-800x588.jpg 800w, https://www.trash.co.nz/wp-content/uploads/2018/11/181111-171535-3294-200x147.jpg 200w, https://www.trash.co.nz/wp-content/uploads/2018/11/181111-171535-3294.jpg 2037w" sizes="(max-width: 300px) 100vw, 300px" /><p id="caption-attachment-490" class="wp-caption-text">Rolled up linked dipole with hand mic for scale.</p></div></p>
<p>A quick test with the analyzer puts the resonant point on 40m at a shade under 7.100 Mhz and 14.150 Mhz for 20m which are the key bands for SOTA here in ZL-Land although there&#8217;s taps for 15 and 10m as well.</p>
<p>Those upper bands are a little tricky at the current low-point of the solar cycle so not a priority and I was meant to be mowing the lawn, not lying down on it so I plugged in the rig and spun the dial.</p>
<p>There was a contest on somewhere well north of us as R0ML and a couple of other Russians were calling CQ in consummate contesting fashion although whispering with 25W into a low dipole was probably a bit of a stretch from my end although I did shout breathlessly at the microphone for a few minutes.</p>
<p>Then along comes Steve, ZL1PWR calling CQ on 14.215.&nbsp; At about 1,100km north up in the land of the Auck somewhere it was enough proof for me that the antenna is good and there&#8217;s always something a bit pixie-dust about portable HF operation even if it&#8217;s just on the front lawn.</p>
<p>After a bit of a rag chew I packed up and mowed the lawn leaving the dog content that order was restored in the shade under the trampoline.</p>
<p><iframe loading="lazy" src="https://www.youtube.com/embed/IAQDPs-pD6A" allowfullscreen="allowfullscreen" width="560" height="315" frameborder="0"></iframe></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.trash.co.nz/2018/11/testing-123-sota-on-the-lawn/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>On-board glow driver in 21st Century</title>
		<link>https://www.trash.co.nz/2017/11/on-board-glow-in-21st-century/</link>
					<comments>https://www.trash.co.nz/2017/11/on-board-glow-in-21st-century/#respond</comments>
		
		<dc:creator><![CDATA[Chris H]]></dc:creator>
		<pubDate>Sun, 26 Nov 2017 01:42:00 +0000</pubDate>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[R/C Models]]></category>
		<guid isPermaLink="false">http://www.trash.co.nz/?p=374</guid>

					<description><![CDATA[Ever since a near miss with a glow starter getting caught in a prop back in the nineties I&#8217;ve used on-board glow drivers in any model big enough to carry an extra ‘C’ cell around. As well as the safety aspect, not having to play with a glow starter around spinning props, most glow motors... <a class="more-link" href="https://www.trash.co.nz/2017/11/on-board-glow-in-21st-century/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>Ever since a near miss with a glow starter getting caught in a prop back in the nineties I&#8217;ve used on-board glow drivers in any model big enough to carry an extra ‘C’ cell around.</p>
<p>As well as the safety aspect, not having to play with a glow starter around spinning props, most glow motors idle more reliably with the glow plug lit. This is even more so with four strokes due to the time between induction strokes being longer than with a two stroke.</p>
<p>The incoming methanol has a catalytic reaction with the platinum on the glow plug coil which causes the coil to get hot, which ignites the mixture. The longer time between charges of methanol, oil and air entering the cylinder mean the plug can cool between compression strokes and the idle gets a bit rough around the edges.</p>
<p>The benefit of on-board glow is greater if the motor is inverted where oil and combustion by-products can collect around the plug making the idle worse and the transition to high speed lumpy as the gunk burns out from around the plug.</p>
<p><div id="attachment_376" style="width: 310px" class="wp-caption alignleft"><img aria-describedby="caption-attachment-376" decoding="async" loading="lazy" class="size-medium wp-image-376" src="https://www.trash.co.nz/wp-content/uploads/2017/11/four_stroke_blog-300x265.jpg" alt="Inverted four stroke" width="300" height="265" srcset="https://www.trash.co.nz/wp-content/uploads/2017/11/four_stroke_blog-300x265.jpg 300w, https://www.trash.co.nz/wp-content/uploads/2017/11/four_stroke_blog-500x441.jpg 500w, https://www.trash.co.nz/wp-content/uploads/2017/11/four_stroke_blog-150x132.jpg 150w, https://www.trash.co.nz/wp-content/uploads/2017/11/four_stroke_blog-400x353.jpg 400w, https://www.trash.co.nz/wp-content/uploads/2017/11/four_stroke_blog-200x176.jpg 200w, https://www.trash.co.nz/wp-content/uploads/2017/11/four_stroke_blog.jpg 553w" sizes="(max-width: 300px) 100vw, 300px" /><p id="caption-attachment-376" class="wp-caption-text">Inverted four stroke, screaming out for on-board glow driver.</p></div></p>
<p>A few weeks back I was lucky to add a beautiful quarter scale fly baby to my collection.</p>
<p>There is an unwritten law that large, slow flying, classically shaped models have to have a four stroke Engine.&nbsp; You can’t fight it, they are just not right with a screaming two stroke or the sterile urgency of brushless electric.</p>
<p>I bought a shiny new 1.2 ASP noise maker to fasten to the engine mount which of course needs an on-board driver. No problem; In a past life I ran a business that made 1,000’s of glow drivers so I was sure I’d have another one lying around somewhere.</p>
<p><div id="attachment_382" style="width: 310px" class="wp-caption alignright"><img aria-describedby="caption-attachment-382" decoding="async" loading="lazy" class="size-medium wp-image-382" src="https://www.trash.co.nz/wp-content/uploads/2017/11/ohmarkglow_blog-300x236.jpg" alt="" width="300" height="236" srcset="https://www.trash.co.nz/wp-content/uploads/2017/11/ohmarkglow_blog-300x236.jpg 300w, https://www.trash.co.nz/wp-content/uploads/2017/11/ohmarkglow_blog-500x393.jpg 500w, https://www.trash.co.nz/wp-content/uploads/2017/11/ohmarkglow_blog-150x118.jpg 150w, https://www.trash.co.nz/wp-content/uploads/2017/11/ohmarkglow_blog-400x314.jpg 400w, https://www.trash.co.nz/wp-content/uploads/2017/11/ohmarkglow_blog-200x157.jpg 200w, https://www.trash.co.nz/wp-content/uploads/2017/11/ohmarkglow_blog.jpg 600w" sizes="(max-width: 300px) 100vw, 300px" /><p id="caption-attachment-382" class="wp-caption-text">Ohmark Glow driver, Circa 1997 with switch and pot poking through the heatshrink.</p></div></p>
<p>After turning my workshop and garage upside down it appears the last functional one I had was destroyed in the violent arrival to terra-firma of my 1/5th scale cub. This allowed the model to fit in a much smaller space than it did before the start of the flight.</p>
<h3>Back to the drawing board.</h3>
<p>So, 20-ish years after I designed the first Ohmark on-board glow switch I went back to the drawing board.</p>
<p>Primarily because I didn’t want to wait for postage but also because I’m an electronics nerd and it would erk me to have to buy something simple that I can make.</p>
<p>In the original design I used a small dip switch and pot to set the point and direction of the throttle at which the glow would come on but that is so last century.</p>
<p>These days transmitters are capable of collating the census results for a small nation, never mind controlling a glow switch. Along with the transmitter improvements, eight plus channel receivers are now cheaper than a good servo rather costing more than the air-frames we put them in.</p>
<p>This means the magic can be handled from the comfort of the transmitter and the switch itself can be simpler.</p>
<p>Into the bits box I delved and came out about an hour or so later with a functional prototype using a small 8-pin micro, a few discrete components and MOSFET rated to switch 55 volts at 29 amps which is far more than the 1.5 volts and around three amps which is the maximum you’d expect from a cold glow plug.</p>
<p><div id="attachment_377" style="width: 310px" class="wp-caption alignleft"><img aria-describedby="caption-attachment-377" decoding="async" loading="lazy" class="size-medium wp-image-377" src="https://www.trash.co.nz/wp-content/uploads/2017/11/glow_driver_blog-300x208.jpg" alt="Vero board glow driver" width="300" height="208" srcset="https://www.trash.co.nz/wp-content/uploads/2017/11/glow_driver_blog-300x208.jpg 300w, https://www.trash.co.nz/wp-content/uploads/2017/11/glow_driver_blog-500x347.jpg 500w, https://www.trash.co.nz/wp-content/uploads/2017/11/glow_driver_blog-150x104.jpg 150w, https://www.trash.co.nz/wp-content/uploads/2017/11/glow_driver_blog-400x277.jpg 400w, https://www.trash.co.nz/wp-content/uploads/2017/11/glow_driver_blog-200x139.jpg 200w, https://www.trash.co.nz/wp-content/uploads/2017/11/glow_driver_blog.jpg 545w" sizes="(max-width: 300px) 100vw, 300px" /><p id="caption-attachment-377" class="wp-caption-text">New glow driver prototype on Veroboard</p></div></p>
<p>For a battery I found a tagged 3.3AH NiMh from Jaycar which was a refugee from another project and although the finished unit is a bit bulky because it’s built on strip board it’s only 50x10mm or so and weighs maybe two grams. If I need another one I’ll get some PCB’s done for them and surface mount it.</p>
<p>The previous owner had already fitted a remote glow lead so all I had to was put the arming switch and status LED through the cockpit floor, wrap things in foam and cable tie them into the model. Job Done.</p>
<p>On the transmitter side I used one of the three position switches of my Taranis 9XD to control the glow driver. The three positions are effectively engine off, engine run and engine with glow. Some would refer to the later as ‘engine start’ but in reality I fly with the glow always enabled and it turns on / off at a low throttle position.</p>
<p>In my experience a good quality NiMH C cell will give you a solid hour of flying with 5-6 starts and you could extend that by going to the ‘run’ position if you had an extended idle / taxi period.</p>
<h3>Programming for the Taranis</h3>
<p>The programming for this is to set up the throttle throw without trim you have the idle you want and the switch position at ‘Cut’ applies an override value to the the throttle servo which completely closes the throttle no matter where the stick is.</p>
<p><div id="attachment_378" style="width: 310px" class="wp-caption alignright"><img aria-describedby="caption-attachment-378" decoding="async" loading="lazy" class="size-medium wp-image-378" src="https://www.trash.co.nz/wp-content/uploads/2017/11/mounting_blog-300x228.jpg" alt="Glow driver mounted" width="300" height="228" srcset="https://www.trash.co.nz/wp-content/uploads/2017/11/mounting_blog-300x228.jpg 300w, https://www.trash.co.nz/wp-content/uploads/2017/11/mounting_blog-150x114.jpg 150w, https://www.trash.co.nz/wp-content/uploads/2017/11/mounting_blog-400x304.jpg 400w, https://www.trash.co.nz/wp-content/uploads/2017/11/mounting_blog-200x152.jpg 200w, https://www.trash.co.nz/wp-content/uploads/2017/11/mounting_blog.jpg 462w" sizes="(max-width: 300px) 100vw, 300px" /><p id="caption-attachment-378" class="wp-caption-text">Mounted in the model wrapped in foam. &#8216;C&#8217; cell is behind the servo plate.</p></div></p>
<p>In the middle ‘Run’ position the switch does nothing at all allowing the the throttle to move through it’s full normal range.</p>
<p>The glow driver is plugged into Channel 6, which is set to ‘MAX’ and has a weight of -100% which means that is is held in the ‘off’ position unless something specifically overrides it.</p>
<p>The glow-on position is slightly more fiddly if you’re not familiar with the Taranis style of programming. It uses a logical Switch that is ‘on’ when the throttle is below 25% and a special function maps that logical switch to override Channel 6 to +100% which is where I’ve plugged in the glow driver.</p>
<p>For the sake of convenience I also linked an ‘Engine Off’ voice prompt to the off position and a beep for when the glow comes on so if you’re standing out at the flight line and my transmitter is beeping occasionally it’s because the glow has come on, not because my lunch is cooked.</p>
<p><div id="attachment_379" style="width: 260px" class="wp-caption alignleft"><img aria-describedby="caption-attachment-379" decoding="async" loading="lazy" class="size-medium wp-image-379" src="https://www.trash.co.nz/wp-content/uploads/2017/11/taranis-settings-250x300.jpg" alt="" width="250" height="300" srcset="https://www.trash.co.nz/wp-content/uploads/2017/11/taranis-settings-250x300.jpg 250w, https://www.trash.co.nz/wp-content/uploads/2017/11/taranis-settings-768x923.jpg 768w, https://www.trash.co.nz/wp-content/uploads/2017/11/taranis-settings-853x1024.jpg 853w, https://www.trash.co.nz/wp-content/uploads/2017/11/taranis-settings-500x601.jpg 500w, https://www.trash.co.nz/wp-content/uploads/2017/11/taranis-settings-150x180.jpg 150w, https://www.trash.co.nz/wp-content/uploads/2017/11/taranis-settings-400x480.jpg 400w, https://www.trash.co.nz/wp-content/uploads/2017/11/taranis-settings-800x961.jpg 800w, https://www.trash.co.nz/wp-content/uploads/2017/11/taranis-settings-200x240.jpg 200w, https://www.trash.co.nz/wp-content/uploads/2017/11/taranis-settings.jpg 1024w" sizes="(max-width: 250px) 100vw, 250px" /><p id="caption-attachment-379" class="wp-caption-text">Taranis settings</p></div></p>
<p>Now that I’ve typed that and read it back I’m not even sure it makes sense, so some photos of the programming on the radio are included and if you’re curious catch up with me at the field and I can explain it in gratuitous detail.</p>
<h3>Build it yourself</h3>
<p>For those interested in the gory details I used an AT-Tiny85-20P micro and IRFZ44N fet with a 3V9 Zener regulator so it can run on higher than 4cell NiMH/NiCD.</p>
<p><div id="attachment_381" style="width: 160px" class="wp-caption alignright"><a href="https://www.trash.co.nz/wp-content/uploads/2017/11/glowschematic.jpg"><img aria-describedby="caption-attachment-381" decoding="async" loading="lazy" class="size-thumbnail wp-image-381" src="https://www.trash.co.nz/wp-content/uploads/2017/11/glowschematic-150x150.jpg" alt="Glow driver shematic" width="150" height="150" srcset="https://www.trash.co.nz/wp-content/uploads/2017/11/glowschematic-150x150.jpg 150w, https://www.trash.co.nz/wp-content/uploads/2017/11/glowschematic-57x57.jpg 57w, https://www.trash.co.nz/wp-content/uploads/2017/11/glowschematic-72x72.jpg 72w, https://www.trash.co.nz/wp-content/uploads/2017/11/glowschematic-114x114.jpg 114w, https://www.trash.co.nz/wp-content/uploads/2017/11/glowschematic-144x144.jpg 144w" sizes="(max-width: 150px) 100vw, 150px" /></a><p id="caption-attachment-381" class="wp-caption-text">Schematic, click for larger view.</p></div></p>
<p>Here&#8217;s the schematic for those really curious, the funky mosfet is the default library file in kicad on Ubuntu Linux, don&#8217;t blame me.&nbsp; <img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" />&nbsp;</p>
<p>The source code is not a good example of coding by any standard, but can be found on github at this address:&nbsp;<a href="https://github.com/kiwichrish/on-board-Glow">https://github.com/kiwichrish/on-board-Glow&nbsp;</a>under the MIT license.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.trash.co.nz/2017/11/on-board-glow-in-21st-century/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Arduino Nano library files for kicad</title>
		<link>https://www.trash.co.nz/2017/09/arduino-nano-library-files-kicad/</link>
					<comments>https://www.trash.co.nz/2017/09/arduino-nano-library-files-kicad/#comments</comments>
		
		<dc:creator><![CDATA[Chris H]]></dc:creator>
		<pubDate>Sun, 10 Sep 2017 12:37:23 +0000</pubDate>
				<category><![CDATA[Electronics]]></category>
		<guid isPermaLink="false">http://www.trash.co.nz/?p=365</guid>

					<description><![CDATA[Recently I wanted to get some circuit boards made up as a carrier for the Arduino Nano and I couldn&#8217;t find a decent library file and module for kicad, my EDA weapon of choice. I suspect maybe it was just my google-foo letting me down, but there were some truly useless library files out there... <a class="more-link" href="https://www.trash.co.nz/2017/09/arduino-nano-library-files-kicad/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>Recently I wanted to get some circuit boards made up as a carrier for the Arduino Nano and I couldn&#8217;t find a decent library file and module for <a href="http://kicad-pcb.org/">kicad</a>, my <a href="https://en.wikipedia.org/wiki/Electronic_design_automation">EDA</a> weapon of choice.</p>
<p>I suspect maybe it was just my google-foo letting me down, but there were some truly useless library files out there on the interwebs for the Nano, whereas there were some great libraries including 3D models for some of the other models of the Arduino. &nbsp;Go figure.</p>
<p>You can find the files on github:&nbsp;<br />
<a href="https://github.com/kiwichrish/kicad_ArduinoNano">https://github.com/kiwichrish/kicad_ArduinoNano</a></p>
<p>Pop a comment down below if you find them useful, I create a lot of custom library files for Kicad but most of them are pretty specific to what I need and never see the light of day. &nbsp;I thought these ones were a bit more applicable for others to find useful.</p>
<p><div id="attachment_369" style="width: 310px" class="wp-caption alignright"><img aria-describedby="caption-attachment-369" decoding="async" loading="lazy" class="wp-image-369 size-medium" src="https://www.trash.co.nz/wp-content/uploads/2017/09/pcbmodule-300x125.png" alt="Arduino Nano for Kicad" width="300" height="125" srcset="https://www.trash.co.nz/wp-content/uploads/2017/09/pcbmodule-300x125.png 300w, https://www.trash.co.nz/wp-content/uploads/2017/09/pcbmodule-768x320.png 768w, https://www.trash.co.nz/wp-content/uploads/2017/09/pcbmodule-1024x427.png 1024w, https://www.trash.co.nz/wp-content/uploads/2017/09/pcbmodule-500x209.png 500w, https://www.trash.co.nz/wp-content/uploads/2017/09/pcbmodule-150x63.png 150w, https://www.trash.co.nz/wp-content/uploads/2017/09/pcbmodule-400x167.png 400w, https://www.trash.co.nz/wp-content/uploads/2017/09/pcbmodule-800x334.png 800w, https://www.trash.co.nz/wp-content/uploads/2017/09/pcbmodule-200x83.png 200w, https://www.trash.co.nz/wp-content/uploads/2017/09/pcbmodule.png 1088w" sizes="(max-width: 300px) 100vw, 300px" /><p id="caption-attachment-369" class="wp-caption-text">PCB module view</p></div></p>
<p><div id="attachment_367" style="width: 198px" class="wp-caption alignleft"><img aria-describedby="caption-attachment-367" decoding="async" loading="lazy" class="size-medium wp-image-367" src="https://www.trash.co.nz/wp-content/uploads/2017/09/schematic-188x300.png" alt="Arduino nano for Kicad" width="188" height="300" srcset="https://www.trash.co.nz/wp-content/uploads/2017/09/schematic-188x300.png 188w, https://www.trash.co.nz/wp-content/uploads/2017/09/schematic-150x240.png 150w, https://www.trash.co.nz/wp-content/uploads/2017/09/schematic-200x320.png 200w, https://www.trash.co.nz/wp-content/uploads/2017/09/schematic.png 397w" sizes="(max-width: 188px) 100vw, 188px" /><p id="caption-attachment-367" class="wp-caption-text">Schematic View</p></div></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.trash.co.nz/2017/09/arduino-nano-library-files-kicad/feed/</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
			</item>
		<item>
		<title>The Kiwi DX un-group</title>
		<link>https://www.trash.co.nz/2017/06/kiwi-dx-un-group/</link>
					<comments>https://www.trash.co.nz/2017/06/kiwi-dx-un-group/#respond</comments>
		
		<dc:creator><![CDATA[Chris H]]></dc:creator>
		<pubDate>Sun, 25 Jun 2017 10:18:38 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Ham Radio]]></category>
		<category><![CDATA[DX]]></category>
		<category><![CDATA[ham radio]]></category>
		<guid isPermaLink="false">http://www.trash.co.nz/?p=316</guid>

					<description><![CDATA[The Kiwi DX group was, and now even more so is, an un-group. In the same way that some IT cliques have un-cons instead of conferences. The premise is that you have more of the social and less of the conference with a strong focus on community and learning. The Kiwi DX group was for... <a class="more-link" href="https://www.trash.co.nz/2017/06/kiwi-dx-un-group/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p><a href="https://www.trash.co.nz/wp-content/uploads/2017/06/KiwiDXHDef.jpg"><img decoding="async" loading="lazy" class="alignright wp-image-352 size-thumbnail" src="https://www.trash.co.nz/wp-content/uploads/2017/06/KiwiDXHDef-150x150.jpg" alt="Kiwi DX group" width="150" height="150" srcset="https://www.trash.co.nz/wp-content/uploads/2017/06/KiwiDXHDef-150x150.jpg 150w, https://www.trash.co.nz/wp-content/uploads/2017/06/KiwiDXHDef-300x300.jpg 300w, https://www.trash.co.nz/wp-content/uploads/2017/06/KiwiDXHDef.jpg 500w, https://www.trash.co.nz/wp-content/uploads/2017/06/KiwiDXHDef-400x400.jpg 400w, https://www.trash.co.nz/wp-content/uploads/2017/06/KiwiDXHDef-200x200.jpg 200w, https://www.trash.co.nz/wp-content/uploads/2017/06/KiwiDXHDef-57x57.jpg 57w, https://www.trash.co.nz/wp-content/uploads/2017/06/KiwiDXHDef-72x72.jpg 72w, https://www.trash.co.nz/wp-content/uploads/2017/06/KiwiDXHDef-114x114.jpg 114w, https://www.trash.co.nz/wp-content/uploads/2017/06/KiwiDXHDef-144x144.jpg 144w" sizes="(max-width: 150px) 100vw, 150px" /></a>The Kiwi DX group was, and now even more so is, an un-group.</p>
<p>In the same way that some IT cliques have un-cons instead of conferences.</p>
<p>The premise is that you have more of the social and less of the conference with a strong focus on community and learning.</p>
<p>The Kiwi DX group was for the most part just a mailing list run by a few different folks over the years. When I first became a ham it was run by Bill, ZL3NB who is one of the nicest guys you&#8217;ll ever meet.</p>
<p>The Kiwi DX mailing list bounced it&#8217;s last email some time in 2016 and although another mailing list is giving ZL DXers somewhere to blow off steam, it&#8217;s just not the same.</p>
<p>I miss the un-group-ness of the old list and the eclectic mix of folks who posted regularly even though the occasional flame war threatened to undo the very fabric of time itself.</p>
<p>While the group was essentially a random mob of hams rather than an organised club the mailing list did spawn some great collaborative efforts. The special even station <a href="http://zm90dx.com/">ZM90DX</a> that ran for a full year and crowd funding donations for some DXpeditions in the few short years I was an un-member come to mind.</p>
<p>This is obviously a bit of reminiscing on my part. I found some old emails that jogged my memory but that&#8217;s not my only intention, it&#8217;s also a bit of a sneaky shot at preserving a tiny little bit of amateur radio history.</p>
<p>The Kiwi DX group, being the un-group it is, has never had a website of it&#8217;s own. That hasn&#8217;t stopped a fair number of ZL Dxers using links to Lee, ZL2AL&#8217;s website that hosts the one &#8216;official&#8217; mention of the group which is here: <a href="http://www.zl2al.com/kiw-dx-group/">http://www.zl2al.com/kiw-dx-group/</a></p>
<p>Lee was another most excellent gentleman who sadly became Silent Key mid 2015. Lee created the KiwiDX logo at the top of this post and adorns quite a few ZL QSL cards.</p>
<p>Lee&#8217;s son is keeping the lights on over at <a href="http://www.zl2al.com">http://www.zl2al.com</a> but just in case it does fall into the cracks I&#8217;ve taken a copy of the little sliver of DX history and included the page contents below which is the sum total of the Kiwi DX Group web presence.</p>
<p style="padding-left: 30px;"><em>&#8220;The Kiwi DX Group is a group of avid DXers that formed in the late 1990s. The logo originated from the magazine NZDXR edited by ZL2AL. Although the magazine ceased publication after nearly 5 years, the bond was formed and Kiwi DXers became a formidable group in the pileups. ZLs are quick to support DXpeditions and a recent “pass the hat” exercise saw the ZLs raise a considerable amount of money to become a sponsor and support the upcoming FT5ZM Amsterdam Island DXpedition 2014&#8221;</em></p>
<p>In the spirit of the Kiwi DX un-group I&#8217;d encourage any ZL ham who&#8217;s fond of a bit of late night DX to use the Kiwi DX logo created by Lee on their QSL card or drop it on their qrz.com page.</p>
<p>We&#8217;ll see if we can have have the Kiwi DX group survive another 20 years even without the mailing list.</p>
<p>73, Chris<br />
ZL3LF</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.trash.co.nz/2017/06/kiwi-dx-un-group/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>17,000km on a rubber ducky</title>
		<link>https://www.trash.co.nz/2017/02/17000km-on-a-rubber-ducky/</link>
					<comments>https://www.trash.co.nz/2017/02/17000km-on-a-rubber-ducky/#respond</comments>
		
		<dc:creator><![CDATA[Chris H]]></dc:creator>
		<pubDate>Mon, 20 Feb 2017 10:59:41 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Ham Radio]]></category>
		<category><![CDATA[ham radio]]></category>
		<category><![CDATA[Short Wave Listening]]></category>
		<guid isPermaLink="false">http://www.trash.co.nz/?p=339</guid>

					<description><![CDATA[I was out walking the dog, as you do, with my trusty Yaesu VX6 in hand this evening. I tried to raise some locals for a chin-wag on a couple of repeaters and got the silent treatment so went for plan &#8216;B&#8217; and started scanning some local services channels. After listening for a wee while... <a class="more-link" href="https://www.trash.co.nz/2017/02/17000km-on-a-rubber-ducky/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>I was out walking the dog, as you do, with my trusty Yaesu VX6 in hand this evening.</p>
<p>I tried to raise some locals for a chin-wag on a couple of repeaters and got the silent treatment so went for plan &#8216;B&#8217; and started scanning some local services channels.</p>
<p><div id="attachment_343" style="width: 310px" class="wp-caption alignright"><img aria-describedby="caption-attachment-343" decoding="async" loading="lazy" class="wp-image-343 size-medium" src="https://www.trash.co.nz/wp-content/uploads/2017/02/CRI-tx-300x203.jpg" width="300" height="203" srcset="https://www.trash.co.nz/wp-content/uploads/2017/02/CRI-tx-300x203.jpg 300w, https://www.trash.co.nz/wp-content/uploads/2017/02/CRI-tx-150x102.jpg 150w, https://www.trash.co.nz/wp-content/uploads/2017/02/CRI-tx-200x135.jpg 200w, https://www.trash.co.nz/wp-content/uploads/2017/02/CRI-tx.jpg 365w" sizes="(max-width: 300px) 100vw, 300px" /><p id="caption-attachment-343" class="wp-caption-text">17,748 km or so Google says</p></div></p>
<p>After listening for a wee while to some linesmen dealing with a power pole fire (not related to the big CHCH fires recently) I got bored and thought I&#8217;d go a bit lower down the spectrum.</p>
<p>Basically I started listening a bit below 500 khz and scanned upwards from there.</p>
<p>The squelch broke for the the local broadcast AM stuff you&#8217;d expect, along with some big noise sources in the 80m band and a local ham rag chewing on 40m who sounded like a duck as the HT only does AM/FM not side band.</p>
<p>Then well into the short-wave broadcast chunk proper I listened to a bit of the 8pm news on Radio New Zealand shortwave service that was thumping in as I plodded along behind the K9/p.</p>
<p><div id="attachment_341" style="width: 310px" class="wp-caption alignleft"><img aria-describedby="caption-attachment-341" decoding="async" loading="lazy" class="size-medium wp-image-341" src="https://www.trash.co.nz/wp-content/uploads/2017/02/VX6-300x225.jpg" alt="VX6 SWL" width="300" height="225" srcset="https://www.trash.co.nz/wp-content/uploads/2017/02/VX6-300x225.jpg 300w, https://www.trash.co.nz/wp-content/uploads/2017/02/VX6-150x113.jpg 150w, https://www.trash.co.nz/wp-content/uploads/2017/02/VX6-400x300.jpg 400w, https://www.trash.co.nz/wp-content/uploads/2017/02/VX6-200x150.jpg 200w, https://www.trash.co.nz/wp-content/uploads/2017/02/VX6.jpg 480w" sizes="(max-width: 300px) 100vw, 300px" /><p id="caption-attachment-341" class="wp-caption-text">Short wave listening with a Rubber Ducky?</p></div></p>
<p>After the news I kept on scanning upwards and wound up listening to a movie review of the new Lego Batman movie where the scan stopped on 11.780Mhz.</p>
<p>I assumed it was ABC, the Australian Shortwave service or something else relatively close to home.</p>
<p>Listened for a bit longer to the entertainment news about Angelina Jolie making a movie with her kids you could have knocked me down with a feather when the announcer said it was China Radio International English service!</p>
<p>A&nbsp;good solid S4 &#8211; S5 signal into the standard rubber ducky antenna designed for 432/144Mhz.</p>
<p>I didn&#8217;t even hold the radio above waist height most of the time, I was just wandering along with it in my hand.</p>
<p>Checking when I got home I found that the transmitter was centred on 11.785 Mhz based in Cerrik, Albania!! That&#8217;s almost anti-podal at around 17,000km.</p>
<p>Once again, there might be quite a bit of science in this radio thing but every now and then there&#8217;s a wee dusting of magic as well.</p>
<p><div id="attachment_342" style="width: 160px" class="wp-caption alignleft"><img aria-describedby="caption-attachment-342" decoding="async" loading="lazy" class="wp-image-342 size-thumbnail" src="https://www.trash.co.nz/wp-content/uploads/2017/02/fitbit-150x150.jpg" alt="fitbit" width="150" height="150" srcset="https://www.trash.co.nz/wp-content/uploads/2017/02/fitbit-150x150.jpg 150w, https://www.trash.co.nz/wp-content/uploads/2017/02/fitbit-57x57.jpg 57w, https://www.trash.co.nz/wp-content/uploads/2017/02/fitbit-72x72.jpg 72w, https://www.trash.co.nz/wp-content/uploads/2017/02/fitbit-114x114.jpg 114w, https://www.trash.co.nz/wp-content/uploads/2017/02/fitbit-144x144.jpg 144w" sizes="(max-width: 150px) 100vw, 150px" /><p id="caption-attachment-342" class="wp-caption-text">156bpm max? Hmm.</p></div></p>
<p>For the record the dog and I did 6.55 km in a bit over an hour and a quarter. 8,606 steps apparently. I do wonder how many steps the dog took? Quite a few more I&#8217;m guessing!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.trash.co.nz/2017/02/17000km-on-a-rubber-ducky/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Propagation predictions and reality</title>
		<link>https://www.trash.co.nz/2016/10/propagation-predictions-reality/</link>
					<comments>https://www.trash.co.nz/2016/10/propagation-predictions-reality/#respond</comments>
		
		<dc:creator><![CDATA[Chris H]]></dc:creator>
		<pubDate>Sun, 09 Oct 2016 12:07:41 +0000</pubDate>
				<category><![CDATA[Ham Radio]]></category>
		<category><![CDATA[ham radio]]></category>
		<guid isPermaLink="false">http://www.trash.co.nz/?p=328</guid>

					<description><![CDATA[Once again a contest proves that propagation prediction tools are naff. 🙂 I decided to spin the dial on 17m this evening before sneaking to bed and spoke to Eric, SM1ALH in Sweden for a few minutes but it was pretty rough, although 17m this late at night is always a bit of a crap shoot.... <a class="more-link" href="https://www.trash.co.nz/2016/10/propagation-predictions-reality/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>Once again a contest proves that propagation prediction tools are naff. <img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>I decided to spin the dial on 17m this evening before sneaking to bed and spoke to Eric, SM1ALH in Sweden for a few minutes but it was pretty rough, although 17m this late at night is always a bit of a crap shoot.</p>
<p>Conditions have been poor the last wee while due to a solar storm, with good visible aurora from my QTH but I decided to pop down to 20m to see if anyone was awake down there.</p>
<p>Low and behold the Scandinavian Activity contest has magically opened the band and I can hear a whole bunch of Europeans, JA&#8217;s and some VK&#8217;s plugging away in standard contest style.</p>
<p><div id="attachment_330" style="width: 310px" class="wp-caption alignleft"><img aria-describedby="caption-attachment-330" decoding="async" loading="lazy" class="size-medium wp-image-330" src="https://www.trash.co.nz/wp-content/uploads/2016/10/contestlog-300x158.jpg" alt="Contest Log" width="300" height="158" srcset="https://www.trash.co.nz/wp-content/uploads/2016/10/contestlog-300x158.jpg 300w, https://www.trash.co.nz/wp-content/uploads/2016/10/contestlog-150x79.jpg 150w, https://www.trash.co.nz/wp-content/uploads/2016/10/contestlog-400x210.jpg 400w, https://www.trash.co.nz/wp-content/uploads/2016/10/contestlog-200x105.jpg 200w, https://www.trash.co.nz/wp-content/uploads/2016/10/contestlog.jpg 430w" sizes="(max-width: 300px) 100vw, 300px" /><p id="caption-attachment-330" class="wp-caption-text">Scandinavian Activity contest log</p></div></p>
<p>I promptly shoved a bit more coal in the direction of the afterburner and gave out some multiplier points to some folks up the other end of the planet before I got my beauty sleep.</p>
<p>In the mean time the propagation prediction tool in my logging software is saying &#8220;don&#8217;t bother&#8221; and the published solar numbers suggest getting shares in skype rather than HF gear.</p>
<p>So, once again, all together&#8230;</p>
<p>Turn on the radio and listen for a while, the bands are always open somewhere!</p>
<p>73, Chris</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.trash.co.nz/2016/10/propagation-predictions-reality/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Etomite on php 5.6</title>
		<link>https://www.trash.co.nz/2016/08/etomite-php-5-6/</link>
					<comments>https://www.trash.co.nz/2016/08/etomite-php-5-6/#comments</comments>
		
		<dc:creator><![CDATA[Chris H]]></dc:creator>
		<pubDate>Sat, 06 Aug 2016 23:22:48 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[ohmark]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[WebDev]]></category>
		<guid isPermaLink="false">http://www.trash.co.nz/?p=263</guid>

					<description><![CDATA[This post is on the geeky end of the scale a bit, but might be handy for someone out there in the interwebs. Back in the mid 00&#8217;s I was a big fan of a CMS called Etomite that begat MODX which I still use for some projects. You can read about the death of Etomite... <a class="more-link" href="https://www.trash.co.nz/2016/08/etomite-php-5-6/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>This post is on the geeky end of the scale a bit, but might be handy for someone out there in the interwebs.</p>
<p>Back in the mid 00&#8217;s I was a big fan of a CMS called Etomite that begat MODX which I still use for some projects. You can read about the death of Etomite and the rise of <a href="https://en.wikipedia.org/wiki/MODX">MODX on wikipedia</a>.</p>
<p>Anyway, I used etomite for an earlier blog site at <a href="http://www.ohmark.co.nz">www.ohmark.co.nz</a> which is the name of an electronics development company I ran from about 1996 till 2004, ish.</p>
<p>When I sold the rights to the then-current products and designs the new owner wasn&#8217;t crazy enough to take on the meaningless company name and oddly spent domain so I kept it for my blog.</p>
<p>That blog was used to record progress on a couple of microcontroller projects I was working on at the time and got enough traffic that it was worthwhile putting google ads on the site.</p>
<p>As I was earning one or two cents a week in advertising revenue from the site I kept it online until May last year when I rolled my web servers over to Debian 8 which included PHP 5.6.x.</p>
<p>Unfortunately PHP 5.6 was a bridge to far for Etomite and my efforts were rewarded with a dreaded deprecation error which are quite often journey to no-where to unravel.</p>
<p><div id="attachment_265" style="width: 790px" class="wp-caption alignnone"><a href="https://www.trash.co.nz/wp-content/uploads/2016/08/etomiteerror.jpg"><img aria-describedby="caption-attachment-265" decoding="async" loading="lazy" class="size-large wp-image-265" src="https://www.trash.co.nz/wp-content/uploads/2016/08/etomiteerror-1024x344.jpg" alt="Depreated" width="780" height="262" srcset="https://www.trash.co.nz/wp-content/uploads/2016/08/etomiteerror.jpg 1024w, https://www.trash.co.nz/wp-content/uploads/2016/08/etomiteerror-300x101.jpg 300w, https://www.trash.co.nz/wp-content/uploads/2016/08/etomiteerror-768x258.jpg 768w, https://www.trash.co.nz/wp-content/uploads/2016/08/etomiteerror-500x168.jpg 500w, https://www.trash.co.nz/wp-content/uploads/2016/08/etomiteerror-150x50.jpg 150w, https://www.trash.co.nz/wp-content/uploads/2016/08/etomiteerror-400x134.jpg 400w, https://www.trash.co.nz/wp-content/uploads/2016/08/etomiteerror-800x269.jpg 800w, https://www.trash.co.nz/wp-content/uploads/2016/08/etomiteerror-200x67.jpg 200w" sizes="(max-width: 780px) 100vw, 780px" /></a><p id="caption-attachment-265" class="wp-caption-text">Deprecated mysql library error in Etomite</p></div></p>
<p>I was already running the last version of Etomite released, Version 1.1, and as it was the only site out of a few dozen on that box that did not survive the operating system upgrade I went for the cop-out option and put up a cop-out home page and forgot about it.</p>
<p><div id="attachment_267" style="width: 310px" class="wp-caption alignleft"><a href="https://www.trash.co.nz/wp-content/uploads/2016/08/ohmarkoffline.jpg"><img aria-describedby="caption-attachment-267" decoding="async" loading="lazy" class="wp-image-267 size-medium" src="https://www.trash.co.nz/wp-content/uploads/2016/08/ohmarkoffline-300x64.jpg" alt="cop-out" width="300" height="64" srcset="https://www.trash.co.nz/wp-content/uploads/2016/08/ohmarkoffline-300x64.jpg 300w, https://www.trash.co.nz/wp-content/uploads/2016/08/ohmarkoffline-768x163.jpg 768w, https://www.trash.co.nz/wp-content/uploads/2016/08/ohmarkoffline-1024x217.jpg 1024w, https://www.trash.co.nz/wp-content/uploads/2016/08/ohmarkoffline-500x106.jpg 500w, https://www.trash.co.nz/wp-content/uploads/2016/08/ohmarkoffline-150x32.jpg 150w, https://www.trash.co.nz/wp-content/uploads/2016/08/ohmarkoffline-400x85.jpg 400w, https://www.trash.co.nz/wp-content/uploads/2016/08/ohmarkoffline-800x170.jpg 800w, https://www.trash.co.nz/wp-content/uploads/2016/08/ohmarkoffline-200x42.jpg 200w, https://www.trash.co.nz/wp-content/uploads/2016/08/ohmarkoffline.jpg 1163w" sizes="(max-width: 300px) 100vw, 300px" /></a><p id="caption-attachment-267" class="wp-caption-text">Cop-out offline message that lasted over a year.</p></div></p>
<p>Skip forward to this weekend and I decided to re-visit it as I&#8217;m back on the blogging kick again and I still get the odd email about broken links to one of the projects on the site for a <a href="http://www.ohmark.co.nz/3step.html">CNC stepper motor controller</a> design I posted to some forums.</p>
<p>Long story short, here&#8217;s how I fixed up my Etomite install so you can get your crusty old Etomite site working again as well and revel in the y2k feeling of the admin interface.</p>
<p>To silence the error handling, add a new line at the top of index.php:</p>
<pre class="p1"><span class="s4">&lt;?php</span>
<span class="s4">error_reporting(E_ALL ^ E_DEPRECATED);</span>
<span class="s4">etc...</span></pre>
<p class="p1">Then pop down to the executeParser() function and line 605 or there about&#8217;s and comment out the handler and reporting calls.</p>
<pre class="p1"><span class="s1"><span class="Apple-converted-space">  </span></span><span class="s2">function</span><span class="s1"> executeParser</span><span class="s2">()</span> <span class="s2">{</span>
<span class="s3"><span class="Apple-converted-space">    </span></span><span class="s1">//error_reporting(0);</span>
<span class="s3"><span class="Apple-converted-space">    </span></span><span class="s1">//set_error_handler(array($this,"phpError"));
</span></pre>
<p>You should also comment out any other calls to error_reporting in index.php.  I had four of them but I think they were from my original half-hearted attempt to fix the deprecation error in 2015 but they may have been original.</p>
<p>Lastly put an &#8216;@&#8217; in front of the deprecated mysql_connect statement on line 1323 or just after given you&#8217;ve added a new line at the top.</p>
<p>Change:</p>
<pre class="p1"><span class="s1"><span class="Apple-converted-space">    </span></span><span class="s2">if</span><span class="s3">(</span><span class="s1">@</span><span class="s2">!$</span><span class="s4">this</span><span class="s5">-&gt;</span><span class="s1">rs </span><span class="s2">=</span> <span class="s4">mysql_connect</span><span class="s3">(</span><span class="s2">$</span><span class="s4">this</span><span class="s5">-&gt;</span><span class="s1">dbConfig</span><span class="s3">[</span><span class="s1">'</span><span class="s6">host</span><span class="s1">'</span><span class="s3">]</span><span class="s1">, </span><span class="s2">$</span><span class="s4">this</span><span class="s5">-&gt;</span><span class="s1">dbConfig</span><span class="s3">[</span><span class="s1">'</span><span class="s6">user</span><span class="s1">'</span><span class="s3">]</span><span class="s1">, </span><span class="s2">$</span><span class="s4">this</span><span class="s5">-&gt;</span><span class="s1">dbConfig</span><span class="s3">[</span><span class="s1">'</span><span class="s6">pass</span><span class="s1">'</span><span class="s3">]))</span> <span class="s3">{</span></pre>
<p class="p1">to be:</p>
<pre class="p1"><span class="s1"><span class="Apple-converted-space">    </span></span><span class="s2">if</span><span class="s3">(</span><span class="s1">@</span><span class="s2">!$</span><span class="s4">this</span><span class="s5">-&gt;</span><span class="s1">rs </span><span class="s2">=</span><span class="s1"> @</span><span class="s4">mysql_connect</span><span class="s3">(</span><span class="s2">$</span><span class="s4">this</span><span class="s5">-&gt;</span><span class="s1">dbConfig</span><span class="s3">[</span><span class="s1">'</span><span class="s6">host</span><span class="s1">'</span><span class="s3">]</span><span class="s1">, </span><span class="s2">$</span><span class="s4">this</span><span class="s5">-&gt;</span><span class="s1">dbConfig</span><span class="s3">[</span><span class="s1">'</span><span class="s6">user</span><span class="s1">'</span><span class="s3">]</span><span class="s1">, </span><span class="s2">$</span><span class="s4">this</span><span class="s5">-&gt;</span><span class="s1">dbConfig</span><span class="s3">[</span><span class="s1">'</span><span class="s6">pass</span><span class="s1">'</span><span class="s3">]))</span> <span class="s3">{</span></pre>
<p class="p1">And your Etomite will rise from the ashes, sorta, ish.</p>
<p class="p1">Now that you&#8217;ve got Etomite running again, shift the website to something else before you go much further.  There are some common open-source components in Etomite that have had long published exploits which could bite you in the proverbial bum if you leave it online.</p>
<p class="p1">At the very least make the entire site read-only to protect against the TinyMCE injection issues which surfaced after Etomite last received an update.  I&#8217;ve made mine read-only and have an IDS monitoring for file system changes but it is not what I&#8217;d call a &#8216;trusted&#8217; site on the server and I&#8217;ll probably chroot it as well.</p>
<p class="p1">There was an attempt for a couple of years to get Etomite moving forwards called <a href="https://github.com/johncarlson21/etoFork">etofork on github</a> but it seems to have died and if you want a similar CMS toolset <a href="http://modx.com/">MODX</a> is the way to go now, or if your site was a blog you could go where everyone else seems to have and use WordPress.</p>
<p class="p1">For my part I&#8217;ll probably move the content to this site, as maintaining two blogs is kinda silly, but given my on-again, off-again blogging style that might have to wait another year or so. <img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.trash.co.nz/2016/08/etomite-php-5-6/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
