<?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</title>
	<atom:link href="http://www.matejunkie.com/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>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Next stop: Hamburg, Germany</title>
		<link>http://www.matejunkie.com/moving-to-hamburg-germany/</link>
		<comments>http://www.matejunkie.com/moving-to-hamburg-germany/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 00:40:56 +0000</pubDate>
		<dc:creator>Mike Adolphs</dc:creator>
				<category><![CDATA[Matejunkie]]></category>
		<category><![CDATA[Hamburg]]></category>
		<category><![CDATA[Luebeck]]></category>
		<category><![CDATA[monkey island]]></category>
		<category><![CDATA[move]]></category>
		<category><![CDATA[nugg.ad]]></category>
		<category><![CDATA[tattoo]]></category>

		<guid isPermaLink="false">http://www.matejunkie.com/?p=1312</guid>
		<description><![CDATA[For the record:
I just quit at nugg.ad after 2 1/2 years full of hard, honest and mind-opening work for which I&#8217;m really thankful. Without nugg.ad I don&#8217;t think I wouldn&#8217;t have had such a good start. They&#8217;re all good people there and work like hell to make targeting successful without violating everyone&#8217;s privacy.
Specializing on a [...]]]></description>
			<content:encoded><![CDATA[<p>For the record:<br />
I just quit <a title="nugg.ad" href="http://nugg.ad/" target="_blank">at nugg.ad</a> after 2 1/2 years full of hard, honest and mind-opening work for which I&#8217;m really thankful. Without nugg.ad I don&#8217;t think I wouldn&#8217;t have had such a good start. They&#8217;re all good people there and work like hell to make targeting successful without violating everyone&#8217;s privacy.<br />
Specializing on a high availability system with over 12 billion PIs per months with a ruby (and several rails) backend(s) is still mind-blowing and gave me a lot of knowledge &#8211; something I should(&#8216;ve) mention here more often in detailed articles though.</p>
<p>I&#8217;ll relocate to Luebeck, Germany this weekend. After a few weeks off I&#8217;ll start at my new employer&#8217;s place on 1st February as a Rails/Linux system administrator right in the middle of Hamburg, Germany at the famous Gaensemarkt.<br />
Although &#8211; subscribers might know &#8211; I&#8217;ll visit Berlin regularly twice a month to bring the Monkey Island Tattoo project to an end before summer (and other Tattoo projects as well). The left leg is almost finished and work on <a title="Teaser for the Kraken based tattoo on my right arm" href="http://uncoverthetruth.info/uploads/1231056047_kraken.jpg" target="_blank">my right arm</a> has just begun so stay tuned.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matejunkie.com/moving-to-hamburg-germany/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<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 delight! ;-)
]]></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>How to find a proper monitoring solution</title>
		<link>http://www.matejunkie.com/how-to-find-a-proper-monitoring-solution/</link>
		<comments>http://www.matejunkie.com/how-to-find-a-proper-monitoring-solution/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 22:03:54 +0000</pubDate>
		<dc:creator>Mike Adolphs</dc:creator>
				<category><![CDATA[Binary Talks]]></category>
		<category><![CDATA[cacti]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mrtg]]></category>
		<category><![CDATA[munin]]></category>
		<category><![CDATA[nagios]]></category>
		<category><![CDATA[nagvis]]></category>
		<category><![CDATA[ndoutils]]></category>
		<category><![CDATA[network monitoring]]></category>
		<category><![CDATA[npcd]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[pnp4nagios]]></category>
		<category><![CDATA[snmp]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[zabbix]]></category>
		<category><![CDATA[zenoss]]></category>

		<guid isPermaLink="false">http://www.matejunkie.com/?p=1282</guid>
		<description><![CDATA[As in our own environment at nugg.ad every startup/HA environment needs a proper monitoring solution to fit the minimum requirements to fullfill the high availability demands of your customers. Without a proper solution you can trust on you&#8217;re screwed. It&#8217;s simple as that.
You just need to know first whether your application servers are melting, your [...]]]></description>
			<content:encoded><![CDATA[<p>As in our own environment <a title="nugg.ad AG predictive behavioral targeting" href="http://www.nugg.ad/" target="_blank">at nugg.ad</a> every startup/HA environment needs a proper monitoring solution to fit the minimum requirements to fullfill the high availability demands of your customers. Without a proper solution you can trust on you&#8217;re screwed. It&#8217;s simple as that.<br />
You just need to know first whether your application servers are melting, your database/nosql backend begins to burst or someone accidentally the whole thing (you know the meme, <a title="Encyclopedia Dramatica - I accidentally" href="http://encyclopediadramatica.com/I_accidentally_X" target="_blank">do you?</a>). Not only to inform customers before they call you, but also to be able to plan further growth of your environment.</p>
<p>Since I&#8217;m currently rewriting our whole monitoring environment based on 3 1/2 years experience with Nagios and its competitors I thought to share that knowledge with you. Just in case someone has a use for this.</p>
<h3>Choosing a monitoring solution</h3>
<p>First rule: Stick with the monitoring solution you&#8217;re at least a bit experienced with and which fits to your environment. In huge environments <a title="Zabbix" href="http://www.zabbix.com/" target="_blank">Zabbix is capable</a> of doing the monitoring work for you and <a title="Zenoss" href="http://www.zenoss.com/" target="_blank">so is Zenoss</a> or <a title="Nagios" href="http://www.nagios.org/" target="_blank">Nagios</a> as well. In smaller environments <a title="MRTG" href="http://oss.oetiker.ch/mrtg/" target="_blank">MRTG</a> or <a title="Munin" href="http://munin.projects.linpro.no/" target="_blank">Munin</a> might also do the job.<br />
All big Open Source monitoring solutions are highly customizable and extendable. You just need to know how to find the right plugins or to ask properly within the community how something can be achieved.<br />
If you&#8217;re not experienced with Open Source monitoring solutions at all, get a first look on <a title="Wikipedia - Comparison of network monitoring tools" href="http://en.wikipedia.org/wiki/Comparison_of_network_monitoring_systems" target="_blank">the feature set of various solutions</a> at Wikipedia. Choose wisely afterwards and most important: Stick to that solution for quite a while to explore its advantages and to get better at anger management when facing its disadvantages as well. Sooner or later you&#8217;ll get the big picture.</p>
<p>It&#8217;s not that important which software you choose. It&#8217;s more important what you make out of it for your environment!</p>
<h3>The user&#8217;s demands</h3>
<p>What I&#8217;ve expierienced within the last years is that the demands are quite comprehensive:</p>
<ol>
<li>The operations team needs to get informed almost instantly in case of a real emergency via various contact possibilities<br />
&#8230; and it&#8217;ll let you stay longer at the office to fix this when they get woken up each night due to false alarms</li>
<li>The CTO needs proper escalation methods to get informed when something&#8217;s broken and not taken care of</li>
<li>The executives and its board need a nice and shiny visualization of the platform to present the company&#8217;s growth and its state</li>
<li>The consulting or support team needs a simple read only web-interface to get a proper impression whether everything&#8217;s allright in case of a unexpected customer call.</li>
</ol>
<p>All of these demands have something in common: <strong>The basis of all operations is trust</strong>.</p>
<p>The operations team has to trust your monitoring solution to fix problems in a fast, but advised way instead of ignoring problems after the fourth false alarm during a week. The CTO needs to know that your escalation strategies are working and that you don&#8217;t screw him. The executives need proper graphs without spikes or even downtimes which they&#8217;re not able to explain within meetings and the consulting or support team&#8217;s need is to get an overview of an almost real time state of your environment without getting confused.</p>
<h3>My monitoring environment</h3>
<p>I&#8217;m currently using <a title="Nagios" href="http://www.nagios.org/" target="_blank">Nagios</a> as the basic monitoring solution for our environment with several plugins attached to it.</p>
<p>To reuse all the data provided by Nagios I let it write its information to a MySQL database <a title="Nagios - ndoutils" href="http://www.nagios.org/download/addons" target="_blank">via ndoutils</a>. This enables you to use almost any software which understands the ndoutils database layout, e.g. nice and shiny web-interfaces or visualization tools like nagvis.<br />
For the graphing I&#8217;m currently using two solutions. <a title="pnp4nagios" href="http://www.pnp4nagios.org/" target="_blank">pnp4nagios 0.6x</a> with its highly recommended NPCD daemon acts as the basis for proper graphing of various system information. Since the pnp4nagios web-interface is only recommended for Unix/Linux system administrators I&#8217;m reusing the rrd databases <a title="Cacti" href="http://www.cacti.net/" target="_blank">within Cacti</a> to provide a better overview of the whole platform. Cacti again is mostly being used for SNMP based checks which needs no alerting.</p>
<p>You&#8217;ll now see the difference: System metrics which needs a proper alerting are handled by Nagios itself and metrics that only needs to be monitored for its statistics are realized via Cacti (and therefore mostly SNMP). This eases your configuration work, keeps system resources in balance and avoids misunderstandings within the team that needs to take care of your environment while enjoying your Martini on the Keys.</p>
<p>To enable the consultants to get a good overview of the platform&#8217;s health, I&#8217;m using two different tools. At first <a title="NagVis" href="http://www.nagvis.org/" target="_blank">NagVis provides</a> a graphic overview of the system&#8217;s health without providing too detailed data. A traffic light based graphic with three states (green, yellow and red) might be too few information, but a Google Maps based view of your various datacenter locations with green, yellow or red icons will do the job. The supporters then are able to explain to the customer that datacenter 123 is down due to a failure within the system which is enough in most cases. All other cases with demand of a clearer view will be redirected to you, no worries. They know their job.<br />
For the consultants which are more experienced with the system itself I provide a nice and shiny <a title="Nagios Plugin for Cacti" href="http://trac2.assembla.com/npc" target="_blank">Nagios interface within Cacti</a> itself. They&#8217;re able then to access Cacti&#8217;s performance graphs and the metrics provided by Nagios as well.</p>
<h3>Conclusion</h3>
<p>Maintaining an Open Source monitoring solution means a lot of work and you have to grapple with your favorite monitoring solution for quite a while before achieving your goals. But if you do, you&#8217;re the peacekeeper that lets your colleagues sleep during the night, the magician that casts nice and shiny graphs instantly and the master who has a global overview of your platform.<br />
I hope, this gave you a basic view on how to find the right monitoring solution for you without going into the technical details. If you&#8217;ve got any questions let me know.</p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 342px; width: 1px; height: 1px;">http://www.youtube.com/watch?v=JmS0Kjxs2v4</div>
]]></content:encoded>
			<wfw:commentRss>http://www.matejunkie.com/how-to-find-a-proper-monitoring-solution/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SNMP LTM 9.x MIB Navigation</title>
		<link>http://www.matejunkie.com/snmp-ltm-9-x-mib-navigation/</link>
		<comments>http://www.matejunkie.com/snmp-ltm-9-x-mib-navigation/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 11:11:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Binary Talks]]></category>
		<category><![CDATA[f5]]></category>
		<category><![CDATA[f5 bigip]]></category>
		<category><![CDATA[load balancer]]></category>
		<category><![CDATA[ltm 9.x]]></category>
		<category><![CDATA[mib]]></category>
		<category><![CDATA[snmp]]></category>

		<guid isPermaLink="false">http://www.matejunkie.com/?p=1266</guid>
		<description><![CDATA[I recently got a F5 BigIP 3600 to put my hands on and as we all know, the MIB tree can be a bit tricky to navigate through. For the LTM 9.x release there&#8217;s a really great spreadsheet available at F5&#8217;s DevCentral which contains the most useful OIDs to monitor the many different aspects of [...]]]></description>
			<content:encoded><![CDATA[<p>I recently got <a title="F5 BigIP Series" href="http://www.f5.com/products/hardware/big-ip.html" target="_blank">a F5 BigIP 3600</a> to put my hands on and as we all know, the MIB tree can be a bit tricky to navigate through. For the LTM 9.x release there&#8217;s a really great spreadsheet <a title="DevCentral - SNMP LTM 9.x MIB Navigation" href="http://devcentral.f5.com/Default.aspx?tabid=63&amp;articleType=ArticleView&amp;articleId=84" target="_blank">available at F5&#8217;s DevCentral</a> which contains the most useful OIDs to monitor the many different aspects of the F5 BigIP series. It&#8217;s even useful if you&#8217;re already running LTM 10.x since the changes seems to be not that major.</p>
<p>Small example:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">explanation		oid <span style="color: #7a0874; font-weight: bold;">&#40;</span>numeric<span style="color: #7a0874; font-weight: bold;">&#41;</span>				oid <span style="color: #7a0874; font-weight: bold;">&#40;</span>alphanumeric<span style="color: #7a0874; font-weight: bold;">&#41;</span>																data <span style="color: #7a0874; font-weight: bold;">type</span>	sample value
global ClientPktsIn	.1.3.6.1.4.1.3375.2.1.1.2.1.2.0		.iso.org.dod.internet.private.enterprises.f5.bigipTrafficMgmt.bigipSystem.sysGlobals.sysGlobalStats.sysGlobalStat.sysStatClientPktsIn.0		Counter64	<span style="color: #000000;">220788</span>
global ClientBytesIn	.1.3.6.1.4.1.3375.2.1.1.2.1.3.0		.iso.org.dod.internet.private.enterprises.f5.bigipTrafficMgmt.bigipSystem.sysGlobals.sysGlobalStats.sysGlobalStat.sysStatClientBytesIn.0	Counter64	<span style="color: #000000;">23139087</span>
global ClientPktsOut	.1.3.6.1.4.1.3375.2.1.1.2.1.4.0		.iso.org.dod.internet.private.enterprises.f5.bigipTrafficMgmt.bigipSystem.sysGlobals.sysGlobalStats.sysGlobalStat.sysStatClientPktsOut.0	Counter64	<span style="color: #000000;">239780</span>
global ClientBytesOut	.1.3.6.1.4.1.3375.2.1.1.2.1.5.0		.iso.org.dod.internet.private.enterprises.f5.bigipTrafficMgmt.bigipSystem.sysGlobals.sysGlobalStats.sysGlobalStat.sysStatClientBytesOut.0	Counter64	<span style="color: #000000;">84615725</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.matejunkie.com/snmp-ltm-9-x-mib-navigation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Database fix for Nagios plugin for Cacti</title>
		<link>http://www.matejunkie.com/database-fix-for-nagios-plugin-for-cacti/</link>
		<comments>http://www.matejunkie.com/database-fix-for-nagios-plugin-for-cacti/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 15:30:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Binary Talks]]></category>
		<category><![CDATA[cacti]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[nagios]]></category>
		<category><![CDATA[network monitoring]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://www.matejunkie.com/?p=1255</guid>
		<description><![CDATA[If you&#8217;re interested in running Nagios within the Cacti interface you may be interested in the Nagios plugin for Cacti (NPC) project which does a good job overall in combining these two powerful tools within the monitoring/graphing world. Nevertheless, I had a database related problem during the initial setup due to the fact that NPC [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re interested in running <a title="Nagios - Official website" href="http://www.nagios.org/" target="_blank">Nagios </a>within the <a title="Cacti - Official website" href="http://www.cacti.net/" target="_blank">Cacti</a> interface you may be interested in <a title="Nagios plugin for Cacti Wiki" href="http://trac2.assembla.com/npc/wiki" target="_blank">the Nagios plugin for Cacti (NPC)</a> project which does a good job overall in combining these two powerful tools within the monitoring/graphing world. Nevertheless, I had a database related problem during the initial setup due to the fact that NPC brings along its own schema of the ndo database which is outdated since the last release of ndoutils 1.4b8 (they added a new column called long_output).</p>
<p>Therefore, you want do the changes below via your mysql console to the following tables if you&#8217;d like to use the latest versions of ndoutils (1.4b8) with npc (2.0.4):</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">use</span> databasename <span style="color: #000033;">;</span>
<span style="color: #990099; font-weight: bold;">alter</span> <span style="color: #990099; font-weight: bold;">table</span> npc_servicechecks <span style="color: #990099; font-weight: bold;">add</span> <span style="color: #990099; font-weight: bold;">column</span> long_output <span style="color: #999900; font-weight: bold;">VARCHAR</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">8192</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span> <span style="color: #990099; font-weight: bold;">default</span> <span style="color: #008000;">''</span> <span style="color: #990099; font-weight: bold;">AFTER</span> output<span style="color: #000033;">;</span>
<span style="color: #990099; font-weight: bold;">alter</span> <span style="color: #990099; font-weight: bold;">table</span> npc_servicestatus <span style="color: #990099; font-weight: bold;">add</span> <span style="color: #990099; font-weight: bold;">column</span> long_output <span style="color: #999900; font-weight: bold;">VARCHAR</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">8192</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span> <span style="color: #990099; font-weight: bold;">default</span> <span style="color: #008000;">''</span> <span style="color: #990099; font-weight: bold;">AFTER</span> output<span style="color: #000033;">;</span>
<span style="color: #990099; font-weight: bold;">alter</span> <span style="color: #990099; font-weight: bold;">table</span> npc_systemcommands <span style="color: #990099; font-weight: bold;">add</span> <span style="color: #990099; font-weight: bold;">column</span> long_output <span style="color: #999900; font-weight: bold;">VARCHAR</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">8192</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span> <span style="color: #990099; font-weight: bold;">default</span> <span style="color: #008000;">''</span> <span style="color: #990099; font-weight: bold;">AFTER</span> output<span style="color: #000033;">;</span>
<span style="color: #990099; font-weight: bold;">alter</span> <span style="color: #990099; font-weight: bold;">table</span> npc_statehistory <span style="color: #990099; font-weight: bold;">add</span> <span style="color: #990099; font-weight: bold;">column</span> long_output <span style="color: #999900; font-weight: bold;">VARCHAR</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">8192</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span> <span style="color: #990099; font-weight: bold;">default</span> <span style="color: #008000;">''</span> <span style="color: #990099; font-weight: bold;">AFTER</span> output<span style="color: #000033;">;</span></pre></div></div>

<p>Afterwards NPC should work like a charm.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matejunkie.com/database-fix-for-nagios-plugin-for-cacti/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PNP template for check_apache2.sh</title>
		<link>http://www.matejunkie.com/pnp-template-for-check_apache2-sh/</link>
		<comments>http://www.matejunkie.com/pnp-template-for-check_apache2-sh/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 20:07:52 +0000</pubDate>
		<dc:creator>Mike Adolphs</dc:creator>
				<category><![CDATA[Binary Talks]]></category>
		<category><![CDATA[apache webserver]]></category>
		<category><![CDATA[gplv2]]></category>
		<category><![CDATA[nagios]]></category>
		<category><![CDATA[network monitoring]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[pnp template]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://www.matejunkie.com/?p=1246</guid>
		<description><![CDATA[This is a PNP template which works quite well for me when there&#8217;s need to identify possible bottlenecks or unexpected behavior of the Apache webserver. It shows the CPU usage, req/sec, byte/req and the amount of busy/idle workers in a single graph. Feel free to copy the template from below or head over to Nagios [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.matejunkie.com/wp-content/uploads/2009/09/check_apache2.png"><img class="alignleft size-medium wp-image-1248" title="check_apache2 PNP Template" src="http://www.matejunkie.com/wp-content/uploads/2009/09/check_apache2-300x125.png" alt="check_apache2 PNP Template" width="180" height="75" /></a>This is a PNP template which works quite well for me when there&#8217;s need to identify possible bottlenecks or unexpected behavior of the Apache webserver. It shows the CPU usage, req/sec, byte/req and the amount of busy/idle workers in a single graph. Feel free to copy the template from below or head over <a href="http://exchange.nagios.org/directory/Plugins/Web-Servers/Apache/check_apache2-2Esh/details" title="Nagios Exchange - check_apache2.sh">to Nagios Exchange</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><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>
<span style="color: #666666; font-style: italic;">#   PNP Template for check_apache2.sh
</span><span style="color: #666666; font-style: italic;">#   Author: Mike Adolphs (http://www.matejunkie.com/)
</span>
<span style="color: #000088;">$opt</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;--vertical-label <span style="color: #000099; font-weight: bold;">\&quot;</span>Various stats <span style="color: #000099; font-weight: bold;">\&quot;</span> -l 0 -r --title <span style="color: #000099; font-weight: bold;">\&quot;</span>Apache metrics for <span style="color: #006699; font-weight: bold;">$hostname</span> / <span style="color: #006699; font-weight: bold;">$servicedesc</span><span style="color: #000099; font-weight: bold;">\&quot;</span> &quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$def</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span>  <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;DEF:cpu=<span style="color: #006699; font-weight: bold;">$rrdfile</span>:<span style="color: #006699; font-weight: bold;">$DS[1]</span>:AVERAGE &quot;</span> <span style="color: #339933;">;</span>
<span style="color: #000088;">$def</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;DEF:reqpsec=<span style="color: #006699; font-weight: bold;">$rrdfile</span>:<span style="color: #006699; font-weight: bold;">$DS[2]</span>:AVERAGE &quot;</span> <span style="color: #339933;">;</span>
<span style="color: #000088;">$def</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;DEF:bytepreq=<span style="color: #006699; font-weight: bold;">$rrdfile</span>:<span style="color: #006699; font-weight: bold;">$DS[4]</span>:AVERAGE &quot;</span> <span style="color: #339933;">;</span>
<span style="color: #000088;">$def</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;DEF:wbusy=<span style="color: #006699; font-weight: bold;">$rrdfile</span>:<span style="color: #006699; font-weight: bold;">$DS[5]</span>:AVERAGE &quot;</span> <span style="color: #339933;">;</span>
<span style="color: #000088;">$def</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;DEF:widle=<span style="color: #006699; font-weight: bold;">$rrdfile</span>:<span style="color: #006699; font-weight: bold;">$DS[6]</span>:AVERAGE &quot;</span> <span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$opt</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;--vertical-label <span style="color: #000099; font-weight: bold;">\&quot;</span>Byte/sec <span style="color: #000099; font-weight: bold;">\&quot;</span> -l 0 -r --title <span style="color: #000099; font-weight: bold;">\&quot;</span>Apache metrics for <span style="color: #006699; font-weight: bold;">$hostname</span> / <span style="color: #006699; font-weight: bold;">$servicedesc</span><span style="color: #000099; font-weight: bold;">\&quot;</span> &quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$def</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;DEF:bytepsec=<span style="color: #006699; font-weight: bold;">$rrdfile</span>:<span style="color: #006699; font-weight: bold;">$DS[3]</span>:AVERAGE &quot;</span> <span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$def</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;COMMENT:<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\\</span>t<span style="color: #000099; font-weight: bold;">\\</span>t<span style="color: #000099; font-weight: bold;">\\</span>t<span style="color: #000099; font-weight: bold;">\\</span>tLAST<span style="color: #000099; font-weight: bold;">\\</span>t<span style="color: #000099; font-weight: bold;">\\</span>tAVERAGE<span style="color: #000099; font-weight: bold;">\\</span>t<span style="color: #000099; font-weight: bold;">\\</span>tMAX<span style="color: #000099; font-weight: bold;">\\</span>n<span style="color: #000099; font-weight: bold;">\&quot;</span> &quot;</span> <span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$def</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;LINE2:cpu#008000:<span style="color: #000099; font-weight: bold;">\&quot;</span>CPU usage [%]<span style="color: #000099; font-weight: bold;">\\</span>t <span style="color: #000099; font-weight: bold;">\&quot;</span> &quot;</span> <span style="color: #339933;">;</span>
<span style="color: #000088;">$def</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;GPRINT:cpu:LAST:<span style="color: #000099; font-weight: bold;">\&quot;</span>%6.0lf<span style="color: #000099; font-weight: bold;">\\</span>t<span style="color: #000099; font-weight: bold;">\&quot;</span> &quot;</span> <span style="color: #339933;">;</span>
<span style="color: #000088;">$def</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;GPRINT:cpu:AVERAGE:<span style="color: #000099; font-weight: bold;">\&quot;</span> %6.0lf<span style="color: #000099; font-weight: bold;">\\</span>t<span style="color: #000099; font-weight: bold;">\&quot;</span> &quot;</span> <span style="color: #339933;">;</span>
<span style="color: #000088;">$def</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;GPRINT:cpu:MAX:<span style="color: #000099; font-weight: bold;">\&quot;</span> %6.0lf<span style="color: #000099; font-weight: bold;">\\</span>n<span style="color: #000099; font-weight: bold;">\&quot;</span> &quot;</span> <span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$def</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;LINE2:reqpsec#0C64E8:<span style="color: #000099; font-weight: bold;">\&quot;</span>Requests/sec<span style="color: #000099; font-weight: bold;">\\</span>t <span style="color: #000099; font-weight: bold;">\&quot;</span> &quot;</span> <span style="color: #339933;">;</span>
<span style="color: #000088;">$def</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;GPRINT:reqpsec:LAST:<span style="color: #000099; font-weight: bold;">\&quot;</span>%6.0lf<span style="color: #000099; font-weight: bold;">\\</span>t<span style="color: #000099; font-weight: bold;">\&quot;</span> &quot;</span> <span style="color: #339933;">;</span>
<span style="color: #000088;">$def</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;GPRINT:reqpsec:AVERAGE:<span style="color: #000099; font-weight: bold;">\&quot;</span> %6.0lf<span style="color: #000099; font-weight: bold;">\\</span>t<span style="color: #000099; font-weight: bold;">\&quot;</span> &quot;</span> <span style="color: #339933;">;</span>
<span style="color: #000088;">$def</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;GPRINT:reqpsec:MAX:<span style="color: #000099; font-weight: bold;">\&quot;</span> %6.0lf<span style="color: #000099; font-weight: bold;">\\</span>n<span style="color: #000099; font-weight: bold;">\&quot;</span> &quot;</span> <span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$def</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;LINE2:bytepreq#FFA500:<span style="color: #000099; font-weight: bold;">\&quot;</span>Byte/req<span style="color: #000099; font-weight: bold;">\\</span>t<span style="color: #000099; font-weight: bold;">\\</span>t <span style="color: #000099; font-weight: bold;">\&quot;</span> &quot;</span> <span style="color: #339933;">;</span>
<span style="color: #000088;">$def</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;GPRINT:bytepreq:LAST:<span style="color: #000099; font-weight: bold;">\&quot;</span>%6.0lf<span style="color: #000099; font-weight: bold;">\\</span>t<span style="color: #000099; font-weight: bold;">\&quot;</span> &quot;</span> <span style="color: #339933;">;</span>
<span style="color: #000088;">$def</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;GPRINT:bytepreq:AVERAGE:<span style="color: #000099; font-weight: bold;">\&quot;</span> %6.0lf<span style="color: #000099; font-weight: bold;">\\</span>t<span style="color: #000099; font-weight: bold;">\&quot;</span> &quot;</span> <span style="color: #339933;">;</span>
<span style="color: #000088;">$def</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;GPRINT:bytepreq:MAX:<span style="color: #000099; font-weight: bold;">\&quot;</span> %6.0lf<span style="color: #000099; font-weight: bold;">\\</span>n<span style="color: #000099; font-weight: bold;">\&quot;</span> &quot;</span> <span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$def</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;LINE2:wbusy#1CC8E8:<span style="color: #000099; font-weight: bold;">\&quot;</span>Busy workers<span style="color: #000099; font-weight: bold;">\\</span>t <span style="color: #000099; font-weight: bold;">\&quot;</span> &quot;</span> <span style="color: #339933;">;</span>
<span style="color: #000088;">$def</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;GPRINT:wbusy:LAST:<span style="color: #000099; font-weight: bold;">\&quot;</span>%6.0lf<span style="color: #000099; font-weight: bold;">\\</span>t<span style="color: #000099; font-weight: bold;">\&quot;</span> &quot;</span> <span style="color: #339933;">;</span>
<span style="color: #000088;">$def</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;GPRINT:wbusy:AVERAGE:<span style="color: #000099; font-weight: bold;">\&quot;</span> %6.0lf<span style="color: #000099; font-weight: bold;">\\</span>t<span style="color: #000099; font-weight: bold;">\&quot;</span> &quot;</span> <span style="color: #339933;">;</span>
<span style="color: #000088;">$def</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;GPRINT:wbusy:MAX:<span style="color: #000099; font-weight: bold;">\&quot;</span> %6.0lf<span style="color: #000099; font-weight: bold;">\\</span>n<span style="color: #000099; font-weight: bold;">\&quot;</span> &quot;</span> <span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$def</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;LINE2:widle#E80C8C:<span style="color: #000099; font-weight: bold;">\&quot;</span>Idle workers<span style="color: #000099; font-weight: bold;">\\</span>t <span style="color: #000099; font-weight: bold;">\&quot;</span> &quot;</span> <span style="color: #339933;">;</span>
<span style="color: #000088;">$def</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;GPRINT:widle:LAST:<span style="color: #000099; font-weight: bold;">\&quot;</span>%6.0lf<span style="color: #000099; font-weight: bold;">\\</span>t<span style="color: #000099; font-weight: bold;">\&quot;</span> &quot;</span> <span style="color: #339933;">;</span>
<span style="color: #000088;">$def</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;GPRINT:widle:AVERAGE:<span style="color: #000099; font-weight: bold;">\&quot;</span> %6.0lf<span style="color: #000099; font-weight: bold;">\\</span>t<span style="color: #000099; font-weight: bold;">\&quot;</span> &quot;</span> <span style="color: #339933;">;</span>
<span style="color: #000088;">$def</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;GPRINT:widle:MAX:<span style="color: #000099; font-weight: bold;">\&quot;</span> %6.0lf<span style="color: #000099; font-weight: bold;">\\</span>n<span style="color: #000099; font-weight: bold;">\&quot;</span> &quot;</span> <span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$def</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;COMMENT:<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\\</span>t<span style="color: #000099; font-weight: bold;">\\</span>t<span style="color: #000099; font-weight: bold;">\\</span>t<span style="color: #000099; font-weight: bold;">\\</span>tLAST<span style="color: #000099; font-weight: bold;">\\</span>t<span style="color: #000099; font-weight: bold;">\\</span>tAVERAGE<span style="color: #000099; font-weight: bold;">\\</span>t<span style="color: #000099; font-weight: bold;">\\</span>tMAX<span style="color: #000099; font-weight: bold;">\\</span>n<span style="color: #000099; font-weight: bold;">\&quot;</span> &quot;</span> <span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$def</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;LINE2:bytepsec#E80C3E:<span style="color: #000099; font-weight: bold;">\&quot;</span>Byte/sec<span style="color: #000099; font-weight: bold;">\\</span>t<span style="color: #000099; font-weight: bold;">\\</span>t <span style="color: #000099; font-weight: bold;">\&quot;</span> &quot;</span> <span style="color: #339933;">;</span>
<span style="color: #000088;">$def</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;GPRINT:bytepsec:LAST:<span style="color: #000099; font-weight: bold;">\&quot;</span>%6.0lf<span style="color: #000099; font-weight: bold;">\\</span>t<span style="color: #000099; font-weight: bold;">\&quot;</span> &quot;</span> <span style="color: #339933;">;</span>
<span style="color: #000088;">$def</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;GPRINT:bytepsec:AVERAGE:<span style="color: #000099; font-weight: bold;">\&quot;</span> %6.0lf<span style="color: #000099; font-weight: bold;">\\</span>t<span style="color: #000099; font-weight: bold;">\&quot;</span> &quot;</span> <span style="color: #339933;">;</span>
<span style="color: #000088;">$def</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;GPRINT:bytepsec:MAX:<span style="color: #000099; font-weight: bold;">\&quot;</span> %6.0lf<span style="color: #000099; font-weight: bold;">\\</span>n<span style="color: #000099; font-weight: bold;">\&quot;</span> &quot;</span> <span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.matejunkie.com/pnp-template-for-check_apache2-sh/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Update 1.3: Apache check plugin for Nagios</title>
		<link>http://www.matejunkie.com/update-1-3-apache-check-plugin-for-nagios/</link>
		<comments>http://www.matejunkie.com/update-1-3-apache-check-plugin-for-nagios/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 22:49:16 +0000</pubDate>
		<dc:creator>Mike Adolphs</dc:creator>
				<category><![CDATA[Binary Talks]]></category>
		<category><![CDATA[apache webserver]]></category>
		<category><![CDATA[gplv2]]></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[ssl]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://www.matejunkie.com/?p=1240</guid>
		<description><![CDATA[Long time no see. Sorry for the long downtime, but I&#8217;ve been on vacation for quite some time and spent my time out of reach of any electronical device except my phone. Anyway, strength and motivation for work during spare time is back again! Expect a few updates of various plugins I&#8217;ve written in the [...]]]></description>
			<content:encoded><![CDATA[<p>Long time no see. Sorry for the long downtime, but I&#8217;ve been on vacation for quite some time and spent my time out of reach of any electronical device except my phone. Anyway, strength and motivation for work during spare time is back again! Expect a few updates of various plugins I&#8217;ve written in the past within the next weeks.</p>
<p>For the beginning here&#8217;s the revised version of the Apache check plugin for Nagios. It now doesn&#8217;t write temporary files anymore, the code is cleaner and it should be a bit faster. Note that I haven&#8217;t done much testing for now (will be done tomorrow and on Wednesday). Therefore it might won&#8217;t work out of the box for you. At least in my environments it works well. Let me know if you have any problems or if you stumble upon something which is completely nonsense.</p>
<p>Copy&#8217;n'paste below or svn co via svn.matejunkie.com/nagios-plugins/trunk/check_apache/.</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">#!/bin/sh
&nbsp;
#   This program is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation; either version 2 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program; if not, write to the Free Software
#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
&nbsp;
PROGNAME=`basename $0`
VERSION=&quot;Version 1.3,&quot;
AUTHOR=&quot;2009, Mike Adolphs (http://www.matejunkie.com/)&quot;
&nbsp;
print_version() {
    echo &quot;$VERSION $AUTHOR&quot;
}
&nbsp;
print_help() {
    print_version $PROGNAME $VERSION
    echo &quot;&quot;
    echo &quot;Description:&quot;
    echo &quot;$PROGNAME is a Nagios plugin to check the Apache's server status.&quot;
    echo &quot;It monitors requests per second, bytes per second/request, &quot;
    echo &quot;amount of busy/idle workers and its CPU load.&quot;
    echo &quot;&quot;
    echo &quot;Example call:&quot;
    echo &quot;./$PROGNAME -H localhost -P 80 -t 3 -b /usr/sbin -p /var/run \\&quot;
    echo &quot;-n apache2.pid -s status_page [-S] [-R] [-wr] 100 [-cr] 250&quot;
    echo &quot;&quot;
    echo &quot;Options:&quot;
    echo &quot;  -H|--hostname)&quot;
    echo &quot;    Sets the hostname. Default is: localhost&quot;
    echo &quot;  -P|--port)&quot;
    echo &quot;    Sets the port. Default is: 80&quot;
    echo &quot;  -t|--timeout)&quot;
    echo &quot;    Sets a timeout within the server's status page must've been&quot;
    echo &quot;    accessed. Otherwise the check will go into an error state.&quot;
    echo &quot;    Default is: 3&quot;
    echo &quot;  -b|--binary-path)&quot;
    echo &quot;    Sets the path to the apache binary. Used for getting Apache's&quot;
    echo &quot;    CPU load. Default is: /usr/sbin&quot;
    echo &quot;  -p|--pid-path)&quot;
    echo &quot;    Path to Apache's pid file. Default is: /var/run&quot;
    echo &quot;  -n|--pid-name)&quot;
    echo &quot;    Name of Apache's pid file. Default is: apache2.pid&quot;
    echo &quot;  -s|--status-page)&quot;
    echo &quot;    Defines the name of the status page. Default is: server-status&quot;
    echo &quot;  -R|--remote-server)&quot;
    echo &quot;    Disabled the pid check so that remote Apaches can be queried.&quot;
    echo &quot;    Default is: off&quot;
    echo &quot;  -S|--secure)&quot;
    echo &quot;    Enables HTTPS (no certificate check though). Default is: off&quot;
    echo &quot;  -wr|--warning-req)&quot;
    echo &quot;    Sets a warning level for requests per second. Default is: off&quot;
    echo &quot;  -cr|--critical-req)&quot;
    echo &quot;    Sets a critical level for requests per second. Default is: off&quot;
    exit $ST_UK
}
&nbsp;
ST_OK=0
ST_WR=1
ST_CR=2
ST_UK=3
&nbsp;
hostname=&quot;localhost&quot;
port=80
remote_srv=0
path_binary=&quot;/usr/sbin&quot;
path_pid=&quot;/var/run&quot;
name_pid=&quot;apache2.pid&quot;
status_page=&quot;server-status&quot;
timeout=3
secure=0
running=0
&nbsp;
wcdiff_req=0
wclvls_req=0
&nbsp;
while test -n &quot;$1&quot;; do
    case &quot;$1&quot; in
        --help|-h)
            print_help
            exit $ST_UK
            ;;
        --version|-v)
            print_version $PROGNAME $VERSION
            exit $ST_UK
            ;;
        --hostname|-H)
            hostname=$2
            shift
            ;;
        --port|-P)
            port=$2
            shift
            ;;
        --timeout|-t)
            timeout=$2
            shift
            ;;
        --remote-server|-R)
            remote_srv=1
            ;;
        --binary_path|-b)
            path_binary=$2
            shift
            ;;
        --pid_path|-p)
            path_pid=$2
            shift
            ;;
        --pid_name|-n)
            name_pid=$2
            shift
            ;;
        --status-page|-s)
            status_page=$2
            shift
            ;;
        --secure|-S)
            secure=1
            ;;
        --warning-req|-wr)
            warn_req=$2
            shift
            ;;
        --critical-req|-cr)
            crit_req=$2
            shift
            ;;
        *)
            echo &quot;Unknown argument: $1&quot;
            print_help
            exit $ST_UK
            ;;
    esac
    shift
done
&nbsp;
# check functions
val_wcdiff_req() {
    if [ ! -z &quot;$warn_req&quot; -a ! -z &quot;$crit_req&quot; ]
    then
        wclvls_req=1
&nbsp;
        if [ ${warn_req} -gt ${crit_req} ]
        then
            wcdiff_req=1
        fi
    elif [ ! -z &quot;$warn_req&quot; -a -z &quot;$crit_req&quot; ]
    then
        wcdiff_req=2
    elif [ -z &quot;$warn_req&quot; -a ! -z &quot;$crit_req&quot; ]
    then
        wcdiff_req=3
    fi
}
&nbsp;
check_pid() {
    if [ -f &quot;$path_pid/$name_pid&quot; ]
    then
        retval=0
    else
        retval=1
    fi
}
&nbsp;
check_processes() {
    if [ $1 -lt 1 ]
    then
        echo &quot;UNKNOWN - Your Apache server seems not to run. Is your Nagios \
privileged to run 'ps ax' and is the Apache2 binary really located in \
$path_binary?&quot;
        exit $ST_UK
    fi
}
&nbsp;
check_output() {
    stat_output=`stat -c %s ${output_dir}/server-status`
    if [ &quot;$stat_output&quot; = 0 ]
    then
        echo &quot;UNKNOWN - Local copy of server-status is empty. Are we \
allowed to access http://${hostname}:${port}/server-status?&quot;
        exit $ST_UK
    fi
}
&nbsp;
# get functions
get_status() {
    if [ &quot;$secure&quot; = 1 ]
    then
        server_status1=`wget -qO- --no-check-certificate -t 3 \
-T ${timeout} https://${hostname}:${port}/${status_page}?auto`
    sleep 1
        server_status2=`wget -qO- --no-check-certificate -t 3 \
-T ${timeout} https://${hostname}:${port}/${status_page}?auto`
    else
        server_status1=`wget -qO- -t 3 -T ${timeout} \
http://${hostname}:${port}/${status_page}?auto`
        sleep 1
        server_status2=`wget -qO- -t 3 -T ${timeout} \
http://${hostname}:${port}/${status_page}?auto`
    fi
}
&nbsp;
get_vals() {
    cpu_load=&quot;$(cpu_load=0; ps -Ao pcpu,args | grep &quot;$path_binary/apache2&quot; \
| awk '{print $1}' | while read line
    do
        cpu_load=`echo &quot;scale=3; $cpu_load + $line&quot; | bc -l`
    echo $cpu_load
    done)&quot;
    cpu_load=`echo $cpu_load | awk '{print $NF}' | sed 's/^\./0./'`
&nbsp;
    tmp1_req_psec=`echo ${server_status1} | awk '{print $3}'`
    tmp2_req_psec=`echo ${server_status2} | awk '{print $3}'`
    req_psec=`echo &quot;scale=2; ${tmp2_req_psec} - ${tmp1_req_psec}&quot; | bc -l \
| sed 's/^\./0./'`
&nbsp;
    bytes_psec=`echo ${server_status1} | awk '{print $14}' | sed 's/^\./0./'`
    bytes_preq=`echo ${server_status1} | awk '{print $16}' | sed 's/^\./0./'`
    wkrs_busy=`echo ${server_status1} | awk '{print $18}' | sed 's/^\./0./'`
    wkrs_idle=`echo ${server_status1} | awk '{print $20}' | sed 's/^\./0./'`
}
&nbsp;
do_output() {
    output=&quot;Apache serves $req_psec Requests per second with an average CPU \
utilization of $cpu_load%. Busy workers: $wkrs_busy, idle: $wkrs_idle&quot;
}
&nbsp;
do_perfdata() {
    perfdata=&quot;'cpu_load'=$cpu_load 'req_psec'=$req_psec \
'bytes_psec'=$bytes_psec 'bytes_preq'=$bytes_preq 'workers_busy'=$wkrs_busy \
'workers_idle'=$wkrs_idle&quot;
}
&nbsp;
# Let's go
val_wcdiff_req
&nbsp;
if [ &quot;$wcdiff_req&quot; = 1 ]
then
    echo &quot;Please adjust your warning/critical thresholds. The warning must \
be lower than the critical level!&quot;
    exit $ST_UK
elif [ &quot;$wcdiff_req&quot; = 2 ]
then
    echo &quot;Please also set a critical value when you want to use \
warning/critical thresholds!&quot;
    exit $ST_UK
elif [ &quot;$wcdiff_req&quot; = 3 ]
then
    echo &quot;Please also set a warning value when you want to use \
warning/critical thresholds!&quot;
    exit $ST_UK
else
    if [ &quot;$remote_srv&quot; = 0 ]
    then
        running=`check_pid`
        check_pid $running
    fi
&nbsp;
    get_status
    get_vals
&nbsp;
    do_output
    do_perfdata
&nbsp;
    if [ ${wclvls_req} = 1 ]
    then
        if [ ${req_psec} -ge ${warn_req} -a ${req_psec} -lt ${crit_req} ]
        then
            echo &quot;WARNING - ${output} | ${perfdata}&quot;
            exit $ST_WR
        elif [ ${req_psec} -ge ${crit_req} ]
        then
            echo &quot;CRITICAL - ${output} | ${perfdata}&quot;
        exit $ST_CR
        else
            echo &quot;OK - ${output} | ${perfdata}&quot;
            exit $ST_OK
        fi
    else
        echo &quot;OK - ${output} | ${perfdata}&quot;
        exit $ST_OK
    fi
fi</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.matejunkie.com/update-1-3-apache-check-plugin-for-nagios/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Becoming a bone marrow donor</title>
		<link>http://www.matejunkie.com/becoming-a-bone-marrow-donor/</link>
		<comments>http://www.matejunkie.com/becoming-a-bone-marrow-donor/#comments</comments>
		<pubDate>Mon, 03 Aug 2009 17:31:34 +0000</pubDate>
		<dc:creator>Mike Adolphs</dc:creator>
				<category><![CDATA[Matejunkie]]></category>
		<category><![CDATA[bone marrow donor]]></category>
		<category><![CDATA[dkms]]></category>
		<category><![CDATA[leukemia]]></category>
		<category><![CDATA[nugg.ad]]></category>
		<category><![CDATA[zkrd]]></category>

		<guid isPermaLink="false">http://www.matejunkie.com/?p=1229</guid>
		<description><![CDATA[Something completely different this time, but since it&#8217;s quite important I thought to let you know that I decided to become a bone marrow donor last week because of a guy within my circle of acquaintances who recently got ill with leukemia. Although the chances are minimal to find a potential donor that actually fits [...]]]></description>
			<content:encoded><![CDATA[<p>Something completely different this time, but since it&#8217;s quite important I thought to let you know that I decided to become <a title="Wikipedia - Bone marrow" href="http://en.wikipedia.org/wiki/Bone_marrow" target="_blank">a bone marrow donor</a> last week because of <a title="Gereon Pischel" href="http://bitte-rettet-unseren-papa.de/" target="_blank">a guy</a> within my circle of acquaintances who recently got ill with leukemia. Although the chances are minimal to find a potential donor that actually fits it&#8217;s at least a chance for him and for others as well.</p>
<p>Becoming a bone marrow donor is simple. All required information can be found on <a title="DKMS Website" href="http://www.dkms.de/" target="_blank">the DKMS&#8217;s website</a>. Once you&#8217;ve signed up you&#8217;ll receive a package including two Q-tips with which you have to harvest cells at the inner side of your cheek which is mailed back afterwards to do the typecast. Then the information is being anonymized (Donor ID plus the characteristics of the biological tissue) and stored in the central database of the ZKRD (Zentrales Knochenmarkspender-Register Deutschland). From then the information can be queried to help affected people worldwide.</p>
<p>Be aware of the fact that the cost for becoming a bone marrow donor this way is about 50 Euros in Germany since the DKMS can&#8217;t afford to pay all typecasts by itself, but you may also give a blood donation which makes it completely free of charge. Therefore thanks<a title="nugg.ad AG predictive behavioral targeting" href="http://www.nugg.ad/" target="_blank"> to nugg.ad</a> and especially <a title="Stephan Noller's private weblog" href="http://beimnollar.wordpress.com/" target="_blank">Stephan Noller</a> who enabled me to do this.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matejunkie.com/becoming-a-bone-marrow-donor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Urban Shooting</title>
		<link>http://www.matejunkie.com/urban-shooting/</link>
		<comments>http://www.matejunkie.com/urban-shooting/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 00:14:37 +0000</pubDate>
		<dc:creator>Mike Adolphs</dc:creator>
				<category><![CDATA[Matejunkie]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[photography]]></category>
		<category><![CDATA[urban shooting]]></category>

		<guid isPermaLink="false">http://www.matejunkie.com/?p=1212</guid>
		<description><![CDATA[Every now and then it&#8217;s time to break out of the so called nerdiness which almost every keen technician in the information technology experiences. That&#8217;s why we&#8217;ve did a few shots in the middle of Berlin several weeks ago with David Noelte, a brilliant photographer.
The other guy you&#8217;ll see within the album is Dirk, my [...]]]></description>
			<content:encoded><![CDATA[<p>Every now and then it&#8217;s time to break out of the so called nerdiness which almost every keen technician in the information technology experiences. That&#8217;s why we&#8217;ve did a few shots in the middle of Berlin several weeks ago with <a href="http://www.davidnoelte.com/" title="David Noelte">David Noelte</a>, a brilliant photographer.<a href="http://img.matejunkie.com/index.php?album=urban-shooting" target="_blank"><img src="http://www.matejunkie.com/wp-content/uploads/2009/07/teaser_urban_shooting.jpg" alt="Urban Shooting" title="Urban Shooting" width="500" height="331" class="aligncenter size-full wp-image-1213" /></a></p>
<p>The other guy you&#8217;ll see within the album is Dirk, my roomie, who&#8217;s a famous Barkeeper here in Berlin, Germany. Feel free to browse <a href="http://img.matejunkie.com/index.php?album=urban-shooting" title="Matejunkie Zen - Urban Shooting">the photo album</a> and visit <a href="http://www.davidnoelte.com/" title="David Noelte">David Noelte&#8217;s portfolio</a>! His work highly deserves it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matejunkie.com/urban-shooting/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to kick off Hadoop&#8217;s rack awareness</title>
		<link>http://www.matejunkie.com/how-to-kick-off-hadoops-rack-awareness/</link>
		<comments>http://www.matejunkie.com/how-to-kick-off-hadoops-rack-awareness/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 22:31:39 +0000</pubDate>
		<dc:creator>Mike Adolphs</dc:creator>
				<category><![CDATA[Binary Talks]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[distributed computing]]></category>
		<category><![CDATA[distributed data storage]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[hadoop]]></category>
		<category><![CDATA[HDFS]]></category>
		<category><![CDATA[namenode]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[rack awareness]]></category>

		<guid isPermaLink="false">http://www.matejunkie.com/?p=1198</guid>
		<description><![CDATA[Hadoop, an Open Source framework for reliable, scalable, distributed computing and data storage, has a nice feature called rack awareness. This means nothing more than that you&#8217;re able to widely spread your Hadoop cluster over multiple machines within different racks and even different data centers that are worlds apart from each other. Sadly this isn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://hadoop.apache.org/" title="Hadoop">Hadoop</a>, an Open Source framework for reliable, scalable, distributed computing and data storage, has a nice feature called rack awareness. This means nothing more than that you&#8217;re able to widely spread your Hadoop cluster over multiple machines within different racks and even different data centers that are worlds apart from each other. Sadly this isn&#8217;t well documented as almost anything regarding Hadoop since it&#8217;s under heavy development and because of the few people that are actually working with Hadoop compared to other huge Open Source projects.</p>
<p style="text-align: left;"><a href="http://www.matejunkie.com/wp-content/uploads/2009/07/hadoop_rack_awareness_example_01.png"><img class="aligncenter size-full wp-image-1199" title="Hadoop - Rack Awareness" src="http://www.matejunkie.com/wp-content/uploads/2009/07/hadoop_rack_awareness_example_01.png" alt="Hadoop - Rack Awareness" width="500" height="337" /></a></p>
<p>Anyway, kicking off Hadoop&#8217;s rack awareness is no big deal in general. Here&#8217;s how to achieve this goal:</p>
<p>Put a small script in whatever language you prefer to a location of your choice which is accessible by the local Hadoop user on the namenode. The only requirement is that the script is able to print a record to stdout. In this example I&#8217;m using a small Python script written <a href="http://www.nabble.com/Re%3A-Hadoop-topology.script.file.name-Form-p22588620.html" title="Nabble - Hadoop Core Users">by Vadim Zaliva</a> stored in the Hadoop user&#8217;s home directory under /home/hadoop:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/env python</span>
&nbsp;
<span style="color: #483d8b;">''</span><span style="color: #483d8b;">'
This script used by hadoop to determine network/rack topology.  It
should be specified in hadoop-site.xml via topology.script.file.name
Property.
&nbsp;
 topology.script.file.name
 /home/hadoop/topology.py
&nbsp;
'</span><span style="color: #483d8b;">''</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
<span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">string</span> <span style="color: #ff7700;font-weight:bold;">import</span> join
&nbsp;
DEFAULT_RACK = <span style="color: #483d8b;">'/default/rack0'</span><span style="color: #66cc66;">;</span>
&nbsp;
RACK_MAP = <span style="color: black;">&#123;</span> <span style="color: #483d8b;">'10.72.10.1'</span> : <span style="color: #483d8b;">'/datacenter0/rack0'</span>,
&nbsp;
             <span style="color: #483d8b;">'10.112.110.26'</span> : <span style="color: #483d8b;">'/datacenter1/rack0'</span>,
             <span style="color: #483d8b;">'10.112.110.27'</span> : <span style="color: #483d8b;">'/datacenter1/rack0'</span>,
             <span style="color: #483d8b;">'10.112.110.28'</span> : <span style="color: #483d8b;">'/datacenter1/rack0'</span>,
&nbsp;
             <span style="color: #483d8b;">'10.2.5.1'</span> : <span style="color: #483d8b;">'/datacenter2/rack0'</span>,
             <span style="color: #483d8b;">'10.2.10.1'</span> : <span style="color: #483d8b;">'/datacenter2/rack1'</span>
    <span style="color: black;">&#125;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">len</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#41;</span>==<span style="color: #ff4500;">1</span>:
    <span style="color: #ff7700;font-weight:bold;">print</span> DEFAULT_RACK
<span style="color: #ff7700;font-weight:bold;">else</span>:
    <span style="color: #ff7700;font-weight:bold;">print</span> join<span style="color: black;">&#40;</span><span style="color: black;">&#91;</span>RACK_MAP.<span style="color: black;">get</span><span style="color: black;">&#40;</span>i, DEFAULT_RACK<span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">for</span> i <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span>:<span style="color: black;">&#93;</span><span style="color: black;">&#93;</span>,<span style="color: #483d8b;">&quot; &quot;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Then you need to add a property directive to the hadoop-site.xml you&#8217;re using for your cluster&#8217;s configuration (delete all leading underscores in the tags, this is just for display purposes):</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>topology.script.file.name<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/home/hadoop/topology.py<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/property<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Simply restart the namenode&#8217;s process and from now on the Namenode runs the script and looks for a record regarding the datanode everytime a new datanode tries to participate in the cluster.<br />
Keep in mind that taking care of connections between multiple locations via VPN or else and proper DNS resolution is your business and not Hadoop&#8217;s. Make sure that resolving the datanode&#8217;s DNS record is possible and that it&#8217;s accessible within your Hadoop environment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matejunkie.com/how-to-kick-off-hadoops-rack-awareness/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
