<?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>Matejunkie &#187; google</title>
	<atom:link href="http://www.matejunkie.com/tag/google/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.matejunkie.com</link>
	<description>"Look behind you, a Three-Headed Monkey!"</description>
	<lastBuildDate>Thu, 07 Jan 2010 14:26:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Google Wave invitations</title>
		<link>http://www.matejunkie.com/google-wave-invitations/</link>
		<comments>http://www.matejunkie.com/google-wave-invitations/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 12:19:58 +0000</pubDate>
		<dc:creator>Mike Adolphs</dc:creator>
				<category><![CDATA[Binary Talks]]></category>
		<category><![CDATA[e-mail]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[google wave]]></category>
		<category><![CDATA[invitation]]></category>

		<guid isPermaLink="false">http://www.matejunkie.com/?p=1306</guid>
		<description><![CDATA[I still have 7 Google Wave invitations which I don&#8217;t really need. If you&#8217;re interested in trying out Google Wave leave a comment or write an E-Mail to mike@matejunkie.com. Please make sure to provide a valid E-Mail address. Otherwise the invitation won&#8217;t reach you. Update: One invitation left. Next Update: Again 10 invitations for your [...]]]></description>
			<content:encoded><![CDATA[<p>I still have 7 Google Wave invitations which I don&#8217;t really need. If you&#8217;re interested in trying out Google Wave leave a comment or write an E-Mail to mike@matejunkie.com. Please make sure to provide a valid E-Mail address. Otherwise the invitation won&#8217;t reach you.</p>
<p><strong><span style="color: #ff0000;">Update:</span></strong> One invitation left.</p>
<p><strong><span style="color: #ff0000;">Next Update:</span></strong> Again 10 invitations for your delight! ;-)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matejunkie.com/google-wave-invitations/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Hadoop DFS Check Plugin for Nagios</title>
		<link>http://www.matejunkie.com/hadoop-dfs-check-plugin-for-nagios/</link>
		<comments>http://www.matejunkie.com/hadoop-dfs-check-plugin-for-nagios/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 22:46:45 +0000</pubDate>
		<dc:creator>Mike Adolphs</dc:creator>
				<category><![CDATA[Binary Talks]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[gplv2]]></category>
		<category><![CDATA[hadoop]]></category>
		<category><![CDATA[HDFS]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nagios]]></category>
		<category><![CDATA[network monitoring]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[shell scripting]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[yahoo]]></category>

		<guid isPermaLink="false">http://www.matejunkie.com/?p=1110</guid>
		<description><![CDATA[Since I&#8217;m currently occupied with kicking off a several terabytes large Hadoop cluster I thought it&#8217;d be a good idea to provide a few Nagios plugins related to Hadoop. Just in case you don&#8217;t know: Hadoop is a free Java software framework that supports data intensive distributed applications. It got its own filesystem called HDFS [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-193" title="logo_nagios" src="http://www.matejunkie.com/wp-content/uploads/2008/05/logo_nagios.gif" alt="logo_nagios" width="150" height="40" />Since I&#8217;m currently occupied with kicking off a several terabytes large Hadoop cluster I thought it&#8217;d be a good idea to provide a few Nagios plugins related to Hadoop.</p>
<p>Just in case you don&#8217;t know: Hadoop is a <a title="Wikipedia - Hadoop" href="http://en.wikipedia.org/wiki/Hadoop" target="_blank">free Java software framework</a> that supports data intensive distributed applications. It got its own filesystem called HDFS which scales up to petabytes of storage running on top of the operating system&#8217;s filesystem. Hadoop is inspired by Google&#8217;s MapReduce and GFS, the Google File System.</p>
<p>Yahoo for example uses several Hadoop Clusters with <strong>100.000 CPUs total in 20.000 boxes</strong> (2.000 boxes per cluster) according to the <a title="Hadoop website" href="http://wiki.apache.org/hadoop/PoweredBy" target="_blank">official Hadoop website</a>. If you haven&#8217;t checked it out yet, do so! This is &#8211; sorry for that &#8211; crazy shit and it&#8217;s working!<br />
For the beginning I&#8217;d recommend reading the <a title="Wikipedia - Hadoop" href="http://en.wikipedia.org/wiki/Hadoop" target="_blank">Wikipedia article</a>, the <a title="Hadoop - Official documentation 0.18.3" href="http://hadoop.apache.org/core/docs/r0.18.3/" target="_blank">offical documentation</a> and, of course, watching the Hadoop related lectures over <a title="Cloudera" href="http://www.cloudera.com/" target="_blank">at Cloudera</a>.</p>
<p>Anyway, the first plugin is almost finished and checks the amount of running DataNodes and the capacity of the DFS. It&#8217;s working, but I want to add a few more features so that the plugin become more flexible. Nevertheless, feel free to give it a try if you&#8217;re in the mood.</p>
<h3>The Script</h3>
<p>Hadoop is completely operated by the hadoop user and since it got its own filesystem it got its own permissions as well. To keep things clean and safe we won&#8217;t give hadoop related permissions to the Nagios user. We&#8217;ll rather enable the Nagios user to run a small shell script as root which contains a command ran by the hadoop user to get information about the cluster.</p>
<p>Add the following small script to a directory of your choice, e.g. /usr/local/sbin:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #c20cb9; font-weight: bold;">su</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">bash</span> - hadoop <span style="color: #660033;">-c</span> <span style="color: #ff0000;">'hadoop dfsadmin -report'</span></pre></div></div>

<p>Afterwards alter its permissions so that it&#8217;s only read-, write and accessible by root:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>host: ~ $ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">700</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>get-dfsreport.sh</pre></div></div>

<p>Then enable the Nagios user to sudo run the script via /etc/sudoers (or better visudo):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">nagios          <span style="color: #007800;">ALL</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span>ALL<span style="color: #7a0874; font-weight: bold;">&#41;</span>       NOPASSWD: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>get-dfsreport.sh</pre></div></div>

<p>This is it for the prerequisites. You may then run the script provided for copy&#8217;n'pasting below (or svn co, your choice).<br />
If you&#8217;ve chosen another directory than /usr/local/sbin you have to provide the path via -s/&#8211;path-sh when running the script.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>host: ~ $ <span style="color: #c20cb9; font-weight: bold;">svn</span> <span style="color: #c20cb9; font-weight: bold;">co</span> <span style="color: #c20cb9; font-weight: bold;">svn</span>:<span style="color: #000000; font-weight: bold;">//</span>svn.matejunkie.com<span style="color: #000000; font-weight: bold;">/</span>nagios-plugins<span style="color: #000000; font-weight: bold;">/</span>stable<span style="color: #000000; font-weight: bold;">/</span>check_hadoop-dfs<span style="color: #000000; font-weight: bold;">/</span> check_hadoop-dfs<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#   This program is free software; you can redistribute it and/or modify</span>
<span style="color: #666666; font-style: italic;">#   it under the terms of the GNU General Public License as published by</span>
<span style="color: #666666; font-style: italic;">#   the Free Software Foundation; either version 2 of the License, or</span>
<span style="color: #666666; font-style: italic;">#   (at your option) any later version.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;">#   This program is distributed in the hope that it will be useful,</span>
<span style="color: #666666; font-style: italic;">#   but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<span style="color: #666666; font-style: italic;">#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<span style="color: #666666; font-style: italic;">#   GNU General Public License for more details.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;">#   You should have received a copy of the GNU General Public License</span>
<span style="color: #666666; font-style: italic;">#   along with this program; if not, write to the Free Software</span>
<span style="color: #666666; font-style: italic;">#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span>
&nbsp;
<span style="color: #007800;">PROGNAME</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">basename</span> $<span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">VERSION</span>=<span style="color: #ff0000;">&quot;Version 1.0,&quot;</span>
<span style="color: #007800;">AUTHOR</span>=<span style="color: #ff0000;">&quot;2009, Mike Adolphs (http://www.matejunkie.com/)&quot;</span>
&nbsp;
<span style="color: #007800;">ST_OK</span>=<span style="color: #000000;">0</span>
<span style="color: #007800;">ST_WR</span>=<span style="color: #000000;">1</span>
<span style="color: #007800;">ST_CR</span>=<span style="color: #000000;">2</span>
<span style="color: #007800;">ST_UK</span>=<span style="color: #000000;">3</span>
&nbsp;
<span style="color: #007800;">path_sh</span>=<span style="color: #ff0000;">&quot;/usr/local/sbin&quot;</span>
&nbsp;
print_version<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$VERSION</span> <span style="color: #007800;">$AUTHOR</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
print_help<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    print_version <span style="color: #007800;">$PROGNAME</span> <span style="color: #007800;">$VERSION</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$PROGNAME</span> is a Nagios plugin to check the status of HDFS, Hadoop's&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;underlying, redundant, distributed file system.&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$PROGNAME</span> -s /usr/local/sbin [-w 10] [-c 5]&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Options:&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  -s|--path-sh)&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;     Path to the shell script that is mentioned in the&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;     documentation. Default is: /usr/local/sbin&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  -w|--warning)&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;     Defines the warning level for available datanodes. Default&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;     is: off&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;  -c|--critical)&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;     Defines the critical level for available datanodes. Default&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;     is: off&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #007800;">$ST_UK</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;$1&quot;</span>; <span style="color: #000000; font-weight: bold;">do</span>
    <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
        -help<span style="color: #000000; font-weight: bold;">|</span>-h<span style="color: #7a0874; font-weight: bold;">&#41;</span>
            print_help
            <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #007800;">$ST_UK</span>
            <span style="color: #000000; font-weight: bold;">;;</span>
        --version<span style="color: #000000; font-weight: bold;">|</span>-v<span style="color: #7a0874; font-weight: bold;">&#41;</span>
            print_version <span style="color: #007800;">$PROGNAME</span> <span style="color: #007800;">$VERSION</span>
            <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #007800;">$ST_UK</span>
            <span style="color: #000000; font-weight: bold;">;;</span>
        --path-sh<span style="color: #000000; font-weight: bold;">|</span>-s<span style="color: #7a0874; font-weight: bold;">&#41;</span>
            <span style="color: #007800;">path_sh</span>=$<span style="color: #000000;">2</span>
            <span style="color: #7a0874; font-weight: bold;">shift</span>
            <span style="color: #000000; font-weight: bold;">;;</span>
        --warning<span style="color: #000000; font-weight: bold;">|</span>-w<span style="color: #7a0874; font-weight: bold;">&#41;</span>
            <span style="color: #007800;">warning</span>=$<span style="color: #000000;">2</span>
            <span style="color: #7a0874; font-weight: bold;">shift</span>
            <span style="color: #000000; font-weight: bold;">;;</span>
        --critical<span style="color: #000000; font-weight: bold;">|</span>-c<span style="color: #7a0874; font-weight: bold;">&#41;</span>
            <span style="color: #007800;">critical</span>=$<span style="color: #000000;">2</span>
            <span style="color: #7a0874; font-weight: bold;">shift</span>
            <span style="color: #000000; font-weight: bold;">;;</span>
        <span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
            <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Unknown argument: $1&quot;</span>
            print_help
            <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #007800;">$ST_UK</span>
            <span style="color: #000000; font-weight: bold;">;;</span>
        <span style="color: #000000; font-weight: bold;">esac</span>
    <span style="color: #7a0874; font-weight: bold;">shift</span>
<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
get_wcdiff<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$warning</span>&quot;</span> <span style="color: #660033;">-a</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$critical</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
    <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #007800;">wclvls</span>=<span style="color: #000000;">1</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #800000;">${warning}</span> <span style="color: #660033;">-lt</span> <span style="color: #800000;">${critical}</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
        <span style="color: #000000; font-weight: bold;">then</span>
            <span style="color: #007800;">wcdiff</span>=<span style="color: #000000;">1</span>
        <span style="color: #000000; font-weight: bold;">fi</span>
    <span style="color: #000000; font-weight: bold;">elif</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$warning</span>&quot;</span> <span style="color: #660033;">-a</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$critical</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
    <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #007800;">wcdiff</span>=<span style="color: #000000;">2</span>
    <span style="color: #000000; font-weight: bold;">elif</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$warning</span>&quot;</span> <span style="color: #660033;">-a</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$critical</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
    <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #007800;">wcdiff</span>=<span style="color: #000000;">3</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
val_wcdiff<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$wcdiff</span>&quot;</span> = <span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
    <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Please adjust your warning/critical thresholds. The warning <span style="color: #000099; font-weight: bold;">\
</span>must be higher than the critical level!&quot;</span>
        <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #007800;">$ST_UK</span>
    <span style="color: #000000; font-weight: bold;">elif</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$wcdiff</span>&quot;</span> = <span style="color: #000000;">2</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
    <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Please also set a critical value when you want to use <span style="color: #000099; font-weight: bold;">\
</span>warning/critical thresholds!&quot;</span>
        <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #007800;">$ST_UK</span>
    <span style="color: #000000; font-weight: bold;">elif</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$wcdiff</span>&quot;</span> = <span style="color: #000000;">3</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
    <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Please also set a warning value when you want to use <span style="color: #000099; font-weight: bold;">\
</span>warning/critical thresholds!&quot;</span>
        <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #007800;">$ST_UK</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
get_vals<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #007800;">tmp_vals</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #800000;">${path_sh}</span><span style="color: #000000; font-weight: bold;">/</span>get-dfsreport.sh<span style="color: #000000; font-weight: bold;">`</span>
    <span style="color: #007800;">dn_avail</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$tmp_vals</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-m1</span> <span style="color: #ff0000;">&quot;Datanodes available:&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $3}'</span><span style="color: #000000; font-weight: bold;">`</span>
    <span style="color: #007800;">dfs_used</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$tmp_vals</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-m1</span> <span style="color: #ff0000;">&quot;Used raw bytes:&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $4}'</span><span style="color: #000000; font-weight: bold;">`</span>
    <span style="color: #007800;">dfs_used</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">expr</span> <span style="color: #800000;">${dfs_used}</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000;">1024</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000;">1024</span><span style="color: #000000; font-weight: bold;">`</span>
    <span style="color: #007800;">dfs_used_p</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$tmp_vals</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-m1</span> <span style="color: #ff0000;">&quot;% used:&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $3}'</span><span style="color: #000000; font-weight: bold;">`</span>
    <span style="color: #007800;">dfs_total</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$tmp_vals</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-m1</span> <span style="color: #ff0000;">&quot;Total raw bytes:&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $4}'</span><span style="color: #000000; font-weight: bold;">`</span>
    <span style="color: #007800;">dfs_total</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">expr</span> <span style="color: #800000;">${dfs_total}</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000;">1024</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000;">1024</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
do_output<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #007800;">output</span>=<span style="color: #ff0000;">&quot;Datanodes up and running: <span style="color: #007800;">${dn_avail}</span>, DFS total: <span style="color: #000099; font-weight: bold;">\
</span><span style="color: #007800;">${dfs_total}</span> MB, DFS used: <span style="color: #007800;">${dfs_used}</span> MB (<span style="color: #007800;">${dfs_used_p}</span>)&quot;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
do_perfdata<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #007800;">perfdata</span>=<span style="color: #ff0000;">&quot;'datanodes_available'=<span style="color: #007800;">${dn_avail}</span> 'dfs_total'=<span style="color: #007800;">${dfs_total}</span> <span style="color: #000099; font-weight: bold;">\
</span>'dfs_used'=<span style="color: #007800;">${dfs_used}</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Here we go!</span>
get_wcdiff
val_wcdiff
&nbsp;
get_vals
&nbsp;
do_output
do_perfdata
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$warning</span>&quot;</span> <span style="color: #660033;">-a</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$critical</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$dn_avail</span>&quot;</span> <span style="color: #660033;">-le</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$warning</span>&quot;</span> <span style="color: #660033;">-a</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$dn_avail</span>&quot;</span> <span style="color: #660033;">-gt</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$critical</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
    <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;WARNING - <span style="color: #007800;">${output}</span> | <span style="color: #007800;">${perfdata}</span>&quot;</span>
	<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #007800;">$ST_WR</span>
    <span style="color: #000000; font-weight: bold;">elif</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$dn_avail</span>&quot;</span> <span style="color: #660033;">-le</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$critical</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
    <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;CRITICAL - <span style="color: #007800;">${output}</span> | <span style="color: #007800;">${perfdata}</span>&quot;</span>
	<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #007800;">$ST_CR</span>
    <span style="color: #000000; font-weight: bold;">else</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;OK - <span style="color: #007800;">${output}</span> | <span style="color: #007800;">${perfdata}</span> &quot;</span>
	<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #007800;">$ST_OK</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">else</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;OK - <span style="color: #007800;">${output}</span> | <span style="color: #007800;">${perfdata}</span>&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #007800;">$ST_OK</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></div></div>

<h3>Output example:</h3>
<p>If everything went fine you should see output like the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>host: ~ $ .<span style="color: #000000; font-weight: bold;">/</span>check_hadoop-dfs.sh <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>nagios<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>bin
OK - Datanodes up and running: <span style="color: #000000;">50</span>, DFS total: <span style="color: #000000;">20147365</span> MB, DFS used: <span style="color: #000000;">0</span> MB <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #ff0000;">'datanodes_available'</span>=<span style="color: #000000;">50</span> <span style="color: #ff0000;">'dfs_total'</span>=<span style="color: #000000;">20147365</span> <span style="color: #ff0000;">'dfs_used'</span>=<span style="color: #000000;">0</span>
user<span style="color: #000000; font-weight: bold;">@</span>host: ~ $ .<span style="color: #000000; font-weight: bold;">/</span>check_hadoop-dfs.sh <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>nagios<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>bin <span style="color: #660033;">-w</span> <span style="color: #000000;">40</span> <span style="color: #660033;">-c</span> <span style="color: #000000;">30</span>
OK - Datanodes up and running: <span style="color: #000000;">50</span>, DFS total: <span style="color: #000000;">20147365</span> MB, DFS used: <span style="color: #000000;">0</span> MB <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #ff0000;">'datanodes_available'</span>=<span style="color: #000000;">50</span> <span style="color: #ff0000;">'dfs_total'</span>=<span style="color: #000000;">20147365</span> <span style="color: #ff0000;">'dfs_used'</span>=<span style="color: #000000;">0</span>
user<span style="color: #000000; font-weight: bold;">@</span>host: ~ $ .<span style="color: #000000; font-weight: bold;">/</span>check_hadoop-dfs.sh <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>nagios<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>bin <span style="color: #660033;">-w</span> <span style="color: #000000;">60</span> <span style="color: #660033;">-c</span> <span style="color: #000000;">40</span>
WARNING - Datanodes up and running: <span style="color: #000000;">50</span>, DFS total: <span style="color: #000000;">20147365</span> MB, DFS used: <span style="color: #000000;">0</span> MB <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #ff0000;">'datanodes_available'</span>=<span style="color: #000000;">50</span> <span style="color: #ff0000;">'dfs_total'</span>=<span style="color: #000000;">20147365</span> <span style="color: #ff0000;">'dfs_used'</span>=<span style="color: #000000;">0</span>
user<span style="color: #000000; font-weight: bold;">@</span>host: ~ $ .<span style="color: #000000; font-weight: bold;">/</span>check_hadoop-dfs.sh <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>nagios<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>bin <span style="color: #660033;">-w</span> <span style="color: #000000;">70</span>-c <span style="color: #000000;">60</span>
CRITICAL - Datanodes up and running: <span style="color: #000000;">50</span>, DFS total: <span style="color: #000000;">20147365</span> MB, DFS used: <span style="color: #000000;">0</span> MB <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #ff0000;">'datanodes_available'</span>=<span style="color: #000000;">50</span> <span style="color: #ff0000;">'dfs_total'</span>=<span style="color: #000000;">20147365</span> <span style="color: #ff0000;">'dfs_used'</span>=<span style="color: #000000;">0</span>
user<span style="color: #000000; font-weight: bold;">@</span>host: ~ $ .<span style="color: #000000; font-weight: bold;">/</span>check_hadoop-dfs.sh <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>nagios<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>bin <span style="color: #660033;">-w</span> <span style="color: #000000;">20</span> <span style="color: #660033;">-c</span> <span style="color: #000000;">40</span>
Please adjust your warning<span style="color: #000000; font-weight: bold;">/</span>critical thresholds. The warning must be higher than the critical level<span style="color: #000000; font-weight: bold;">!</span>
user<span style="color: #000000; font-weight: bold;">@</span>host: ~ $ .<span style="color: #000000; font-weight: bold;">/</span>check_hadoop-dfs.sh <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>nagios<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>bin <span style="color: #660033;">-w</span> <span style="color: #000000;">30</span>
Please also <span style="color: #000000; font-weight: bold;">set</span> a critical value when you want to use warning<span style="color: #000000; font-weight: bold;">/</span>critical thresholds<span style="color: #000000; font-weight: bold;">!</span>
user<span style="color: #000000; font-weight: bold;">@</span>host: ~ $ .<span style="color: #000000; font-weight: bold;">/</span>check_hadoop-dfs.sh <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>nagios<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>bin <span style="color: #660033;">-c</span> <span style="color: #000000;">30</span>
Please also <span style="color: #000000; font-weight: bold;">set</span> a warning value when you want to use warning<span style="color: #000000; font-weight: bold;">/</span>critical thresholds<span style="color: #000000; font-weight: bold;">!</span></pre></div></div>

<h3>The License</h3>
<p>As always this little script is ment to be sh-compliant and released under the terms of the GPL Version 2 only. Feel free to subscribe via rss to get updates on this one. More options will be added in the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matejunkie.com/hadoop-dfs-check-plugin-for-nagios/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Microsoft&#8217;s Bing vs. Google search</title>
		<link>http://www.matejunkie.com/microsofts-bing-vs-google-search/</link>
		<comments>http://www.matejunkie.com/microsofts-bing-vs-google-search/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 23:31:27 +0000</pubDate>
		<dc:creator>Mike Adolphs</dc:creator>
				<category><![CDATA[World wide web]]></category>
		<category><![CDATA[Bing]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[product placement]]></category>
		<category><![CDATA[search engine]]></category>
		<category><![CDATA[simplicity]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.matejunkie.com/?p=1092</guid>
		<description><![CDATA[Microsoft just relaunched its search engine Live and renamed it to Bing to make a fresh start. Despite the fact that it has several interesting features like playing flash videos within the actual search results by hovering or additional site information to the right of almost every search result, it &#8211; sorry to say &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>Microsoft <a title="Slashdot - Bing Search launches early preview" href="http://tech.slashdot.org/story/09/06/01/1718241/Microsoft-Bing-Search-Launches-Early-Preview" target="_blank">just relaunched</a> its search engine Live and renamed it to <a title="Bing" href="http://www.bing.com/" target="_blank">Bing</a> to make a fresh start. Despite the fact that it has several interesting features like playing flash videos within the actual search results by hovering or additional site information to the right of almost every search result, it &#8211; sorry to say &#8211; still disappoints.</p>
<p><a href="http://www.matejunkie.com/wp-content/uploads/2009/06/se_bing_01.png"><img class="alignleft size-thumbnail wp-image-1093" title="se_bing_01" src="http://www.matejunkie.com/wp-content/uploads/2009/06/se_bing_01-150x150.png" alt="se_bing_01" width="150" height="150" /></a>For example, searching for Linux in Bing shows Microsoft product placement within the search suggestions. Though this lets every IT professional grin from ear to ear, it could have major impact on &#8220;not so professional&#8221; people when they want to see what &#8220;this so called Linux&#8221; is about and rely on search suggestions.</p>
<p><a href="http://www.matejunkie.com/wp-content/uploads/2009/06/se_google_01.png"><img class="alignright size-thumbnail wp-image-1096" title="se_google_01" src="http://www.matejunkie.com/wp-content/uploads/2009/06/se_google_01-150x150.png" alt="se_google_01" width="150" height="150" /></a>Google instead shows suggestions that are pretty useful, when someone wants to get in touch with Linux.<br />
In general it seems that Google tries to avoid product placement within the suggestions. Searching for &#8220;reader&#8221; for example doesn&#8217;t show any related content to Google Reader.</p>
<p>The same applies to the search for SQL. On the Bing hand it shows product placement for Microsoft&#8217;s SQL related products, Google on its hand offers way more universal suggestions.</p>
<p>Don&#8217;t get me wrong. Although I&#8217;m an open source addict, I&#8217;m not a Microsoft hater. I&#8217;d actually use Microsoft software in several areas if I have to. SQL Server 2008 for example is an awesome piece of software, but when it comes to the Internet they still seem to struggle.<br />
If I&#8217;m searching for something I want to get to the result and not being bothered by subtle advertising and I definitely want to get a proper, almost universally valid search result, of course. Google makes this just right and I guess that&#8217;ll last a couple more years since there&#8217;s still no real competitor in the race. They still claim that search is their main product, of course.</p>
<p>Google&#8217;s power is simplicity, Microsoft makes it too complicated. It&#8217;s that easy.</p>
<p>The background picture at bing.com that changes every 24 hours and comes with several overlays to get additional information is a really nice idea to pass time and actually makes Bing more pleasant. How often do I browse the wikipedia clicking from one article to another to learn stuff I haven&#8217;t even heard of last week? Two times a week at least.<br />
But why do I have to install Silverlight when I want to go back to last days picture? Couldn&#8217;t this have been done without the need to install additional software? This way it&#8217;s kinda obvious that Microsoft wants to push its alternative to Flash through their search engine and as I said, it&#8217;s all about the results and not about binding people to its own solutions.</p>
<p>The Internet is all about interoperability. Something that Microsoft obviously still don&#8217;t get and that&#8217;s sad because a little more competition in the search engine business would be quite nice.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matejunkie.com/microsofts-bing-vs-google-search/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Google shows its data center</title>
		<link>http://www.matejunkie.com/google-shows-its-data-center/</link>
		<comments>http://www.matejunkie.com/google-shows-its-data-center/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 11:32:15 +0000</pubDate>
		<dc:creator>Mike Adolphs</dc:creator>
				<category><![CDATA[Binary Talks]]></category>
		<category><![CDATA[container]]></category>
		<category><![CDATA[data center]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[youtube]]></category>

		<guid isPermaLink="false">http://www.matejunkie.com/?p=885</guid>
		<description><![CDATA[This is actually quite cool. We already know which features one of google&#8217;s server generations make their hardware special (you might want to read the article over at ars technica), but Google now also shows the interior of a container based data center in a 6 1/2 minutes long video via YouTube. See below: Besides [...]]]></description>
			<content:encoded><![CDATA[<p>This is actually quite cool. We already know which features one of google&#8217;s server generations make their hardware special (you might want to read the article over <a title="ars technica - Inside a google server" href="http://arstechnica.com/hardware/news/2009/04/the-beast-unveiled-inside-a-google-server.ars" target="_blank">at ars technica</a>), but Google now also shows the interior of a container based data center in a 6 1/2 minutes long video <a title="Youtube - Google container data center tour" href="http://www.youtube.com/watch?v=zRwPSFpLX8I" target="_blank">via YouTube</a>. See below:</p>
<p style="text-align: center;"><p><a href="http://www.matejunkie.com/google-shows-its-data-center/"><em>Click here to view the embedded video.</em></a></p></p>
<p style="text-align: left;">Besides a lot of cool infrastructure features, I especially like the &#8220;Google provided personal transportation device&#8221; part, but that&#8217;s just because of my nerdiness. I apologize.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matejunkie.com/google-shows-its-data-center/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Google Mail under your own domain</title>
		<link>http://www.matejunkie.com/using-google-mail-under-your-own-domain/</link>
		<comments>http://www.matejunkie.com/using-google-mail-under-your-own-domain/#comments</comments>
		<pubDate>Tue, 10 Mar 2009 22:26:36 +0000</pubDate>
		<dc:creator>Mike Adolphs</dc:creator>
				<category><![CDATA[Binary Talks]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[google aps]]></category>
		<category><![CDATA[google mail]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mta]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[privacy]]></category>
		<category><![CDATA[smtp]]></category>
		<category><![CDATA[ssmtp]]></category>

		<guid isPermaLink="false">http://www.matejunkie.com/?p=795</guid>
		<description><![CDATA[Besides the popular gmail.com and googlemail.com adresses, Google also offers Google Mail as an E-Mail solution within the Google Aps package for companies, organizations and other private people who are able to configure their own DNS server. That means, you&#8217;re able to use Google Mail for yourname@yourdomain.tld. The advantages are obvious: You don&#8217;t have to [...]]]></description>
			<content:encoded><![CDATA[<p>Besides the popular gmail.com and googlemail.com adresses, Google also offers Google Mail as an E-Mail solution within the Google Aps package for companies, organizations and other private people who are able to configure their own DNS server. That means, you&#8217;re able to use <a title="Google Mail for businesses" href="http://www.google.com/apps/intl/en/business/index.html" target="_blank">Google Mail</a> for yourname@yourdomain.tld.</p>
<p>The advantages are obvious:</p>
<ul>
<li>You don&#8217;t have to care about setting up and maintaining your own mail infrastructure
<ul>
<li>that includes proper spam protection</li>
</ul>
</li>
<li>No need of a backup solution to archive E-Mails</li>
<li>Access to a bunch of other features like Google Calender or Docs</li>
<li>Easy setup for using E-Mail and other Google Aps on your mobile</li>
<li>Reachable almost anytime, few downtimes</li>
<li>Accessing E-Mails via Web-Interface, IMAP, POP3</li>
<li>Sending E-Mails from anywhere via SMTP</li>
</ul>
<p>But where&#8217;s light, there&#8217;s also shadow (the disadvantages):</p>
<ul>
<li>Less privacy due to the fact that E-Mails are getting parsed to provide ads that fit to the content</li>
<li>You&#8217;re bound to the service provider</li>
<li>Terms might get changed in the future to your disadvantage what might cause a migration for you</li>
<li>Your data is stored externally</li>
<li>If your domain is down, you won&#8217;t be able to receive E-Mails anymore (especially annoying when using low TTLs or really annoying when you configure bullshit with high TTLs as well)</li>
</ul>
<p>Anyway, the important privacy part: As we all know, Google has access to a bunch of datasets from almost any of us. So if you&#8217;re in need of exchanging really important information, don&#8217;t do it the Google way!<br />
For all other cases, e.g. using E-Mail to get informed when new comments have been made in your blog, trying out new web 2.0 services or reading several newsgroups, I&#8217;m fine with the fact, that Google parses every E-Mail to provide proper ads that fit to the content. This is done automatically as described in the privacy statement, but if you&#8217;re unsure whether it really fits your opinion of privacy, better take a look <a title="Google Privacy policies" href="http://www.google.com/intl/en/privacy.html" target="_blank">by yourself</a> (and use other methods of communication to exchange really important information).</p>
<p>In general there&#8217;re two options available: A freely available standard and a charged premium one. The standard package includes all available Google applications like Mail, Calender, Sites or Doc, provides 7,3 GB of space for mail and another 10 GB of space for Google Sites storage. The premium package comes with 25 GB of space for mail, a guaranteed uptime of 99,9% per month, more support options, optional archiving and security solutions by Postini and API support for 50 US$ per year and user. <a title="Google Aps comparison" href="http://www.google.com/apps/intl/en/business/editions.html" target="_blank">Both packages</a> are able to be used via SSL.<br />
For my purposes the standard package was just fine. I don&#8217;t have tons of old E-Mails, don&#8217;t need archiving or additional spam utilities, but I&#8217;m really in need of solutions for mobile use via Blackberry or iPhone without spending evenings to maintain my own E-Mail infrastructure. That&#8217;s just not worth the time.</p>
<p>The sign up process and the initial configuration within the Google environment is pretty straight-forward. Be aware of the fact, that you must have the ability to alter your own DNS configuration. During the sign up you have to add a custom CNAME which is checked by Google to authorize the whole process. To be able to get E-Mails you also have to add Google&#8217;s 7 MX records to your zone file. If you&#8217;re unsure how to to that, I&#8217;d strongly suggest you to stick to a free webmailer &#8230;</p>
<p>To send E-Mails via your Google Mail account directly from your server, you&#8217;re in need of a MTA like SSMTP which is included in almost any Linux distribution today. Its configuration is pretty easy as you can see below:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>host:~$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssmtp<span style="color: #000000; font-weight: bold;">/</span>ssmtp.conf
<span style="color: #007800;">root</span>=postmaster
<span style="color: #007800;">mailhub</span>=smtp.googlemail.com
<span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">hostname</span></span>=hostname.domain.tld
&nbsp;
<span style="color: #007800;">FromLineOverride</span>=YES
&nbsp;
<span style="color: #007800;">UseSTARTTLS</span>=YES
<span style="color: #007800;">AuthUser</span>=name<span style="color: #000000; font-weight: bold;">@</span>domain.tld
<span style="color: #007800;">AuthPass</span>=password</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>host:~$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssmtp<span style="color: #000000; font-weight: bold;">/</span>revaliases
root:name<span style="color: #000000; font-weight: bold;">@</span>domain.tld:smtp.googlemail.com:<span style="color: #000000;">587</span>
user:name<span style="color: #000000; font-weight: bold;">@</span>domain.tld:smtp.googlemail.com:<span style="color: #000000;">587</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.matejunkie.com/using-google-mail-under-your-own-domain/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visualizing spam</title>
		<link>http://www.matejunkie.com/visualizing-spam/</link>
		<comments>http://www.matejunkie.com/visualizing-spam/#comments</comments>
		<pubDate>Sun, 08 Feb 2009 03:10:39 +0000</pubDate>
		<dc:creator>Mike Adolphs</dc:creator>
				<category><![CDATA[Binary Talks]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[geoip]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[google maps]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://www.matejunkie.net//?p=686</guid>
		<description><![CDATA[After yesterday&#8217;s bauble with geoiplookup I was thinking about a more appropriate use of looking up the location of an IP. So what&#8217;s better than visualizing the areas of the world where most spam comes from, I guessed. Therefore I took a look at the IX&#8217;s blacklist project NiX Spam and downloaded a snapshot of [...]]]></description>
			<content:encoded><![CDATA[<p>After yesterday&#8217;s bauble with geoiplookup I was thinking about a more appropriate use of looking up the location of an IP. So what&#8217;s better than visualizing the areas of the world where most spam comes from, I guessed.</p>
<p>Therefore I took a look at the IX&#8217;s blacklist project <a title="NiX Spam" href="http://www.heise.de/ix/nixspam/dnsbl_en/" target="_blank">NiX Spam</a> and downloaded a snapshot of the <a title="NiX Spam Blacklist snapshot" href="http://www.ix.de/nixspam/nixspam.blackmatches" target="_blank">blacklist&#8217;s content</a> (save, right click as&#8230; you&#8217;ve been warned!) which includes a maximum of 40.000 IP addresses. The plain text file comes with a timestamp and the blacklisted IP addresses.<br />
After some more or less simple batch-processing I&#8217;ve had a file including all the relevant GeoIP information, the longitude and latitude values of each IP. What was missing was a method to display them in a graphical way, e.g. on a world map.</p>
<p>Couldn&#8217;t be Google Maps a solution with its well documented and comprehensive <a title="Google Maps API documentation" href="http://code.google.com/apis/maps/" target="_blank">API</a>? So I digged into the Google Maps API and after an hour I was able to change the batch-processing in a way to create the proper output for creating markers on a map, including the well-know tooltip balloons including IP address and timestamp after clicking on a marker.</p>
<p>First tests with a few dozens data sets went just fine, but in this very special moment right before crossing the finish line, my browser decided to stop working for a couple of minutes.<br />
It turned out that 40.000 markers, combined with a tooltip, was way too much data to be handled by the browser. Navigating or zooming the map just wasn&#8217;t possible. Even after I&#8217;ve reduced the amount of data sets to 10.000 it was slow as hell.</p>
<p><a href="http://www.matejunkie.com/wp-content/uploads/2009/02/googleearth_10000markers.png"><img class="size-thumbnail wp-image-688 alignleft" style="margin-left: 6px; margin-right: 6px;" title="Google Maps - 10.000 markers" src="http://www.matejunkie.com/wp-content/uploads/2009/02/googleearth_10000markers-150x150.png" alt="Google Maps - 10.000 markers" width="200" height="200" /></a>Besides the performance issues it turned out that the visualization is almost useless because of the many overlapping markers as you can see on the left. Spammer mostly use botnets,  thousands of Zombie PCs, distributed all over the world.<br />
Sure, it is possible to see areas with a much higher density than other regions, but these are also the regions where internet is accessible from almost everywhere. It&#8217;s easily explainable that there are less Spammers in the australian outback or South America&#8217;s jungle.</p>
<p>But each drawback has also its advantages. Besides the fact that I gained more knowledge of vim, sed and awk once more, it won&#8217;t be too hard to complete this.<br />
With a slightly different approach, e.g. abandoning the longitude/latitude data and prefering the city&#8217;s name, it&#8217;d be possible to present shrinking or growing markers based on the amount of machines in a specific city. This would drastically reduce the amount of markers and is not that hard to implement.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matejunkie.com/visualizing-spam/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
