<?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>sperrgebiet&#039;s world &#187; Linux</title>
	<atom:link href="http://www.sperrgebiet.org/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sperrgebiet.org</link>
	<description>penguins (and ducks) are friends, no food</description>
	<lastBuildDate>Fri, 18 Jun 2010 18:14:14 +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>Monitor Windows Performance Counters with Icinga or Nagios</title>
		<link>http://www.sperrgebiet.org/2010/06/monitor-windows-performance-counters-with-icinga-or-nagios/</link>
		<comments>http://www.sperrgebiet.org/2010/06/monitor-windows-performance-counters-with-icinga-or-nagios/#comments</comments>
		<pubDate>Sat, 05 Jun 2010 22:08:14 +0000</pubDate>
		<dc:creator>Hans</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Icinga]]></category>
		<category><![CDATA[Nagios]]></category>
		<category><![CDATA[Performance Counter]]></category>
		<category><![CDATA[Windows Server 2008]]></category>

		<guid isPermaLink="false">http://www.sperrgebiet.org/?p=304</guid>
		<description><![CDATA[Icinga or Nagios can be easily used to monitor Windows Performance Counters. This is quite useful, because the most &#8220;monitor-relevant&#8221; information from Windows Systems is available through Performance Counters.

So, let&#8217;s start.

First we&#8217;ll do the Windows-Part. 
		
Grab a copy of NSClient++ (Thanks a lot to Michael Medin for his great work on this AddOn) at http://nsclient.org/nscp/
		
I&#8230;]]></description>
			<content:encoded><![CDATA[<p><span style="font-family:Times New Roman; font-size:12pt">Icinga or Nagios can be easily used to monitor Windows Performance Counters. This is quite useful, because the most &#8220;monitor-relevant&#8221; information from Windows Systems is available through Performance Counters.<br />
</span></p>
<p><span style="font-family:Times New Roman; font-size:12pt">So, let&#8217;s start.<br />
</span></p>
<p><span style="font-family:Times New Roman; font-size:12pt"><strong>First we&#8217;ll do the Windows-Part. </strong><br />
		</span></p>
<p><span style="font-family:Times New Roman; font-size:12pt">Grab a copy <strong>of NSClient++</strong> (Thanks a lot to Michael Medin for his great work on this AddOn) at <a href="http://nsclient.org/nscp/">http://nsclient.org/nscp/</a><br />
		</span></p>
<p><span style="font-family:Times New Roman; font-size:12pt">I prefer the ZIP-Package and a manually installation. But it doesn&#8217;t matter if you want to install the MSI. Just take care that you use the 32 or 64 Bit Version.<br />
</span></p>
<ol>
<li>If you have the ZIP-Package as well, just unpack it and move the files to a folder you like (I use C:\Tools\NSClient++).
</li>
<li>
<div>Open <strong>nsc.ini </strong>and make the following changes:
</div>
<ol>
<li>Line 14: Uncomment NRPEListener.dll
</li>
<li>Line 117: allow_arguments=1
</li>
<li>Line 121: allow_nasty_meta_chars=1
</li>
<li>Line 125: use_ssl=1
</li>
<li>Line 135: allowed_hosts=&lt;IP of your Icinga/Nagios Host&gt;
</li>
</ol>
<p style="margin-left: 18pt"><span style="font-family:Times New Roman; font-size:12pt">Explanation: You need <strong>allow_arguments</strong> and the <strong>nasty_meta_chars</strong> for Performance Counters, because we need the Backslash to specify them.<br/><strong>use_ssl</strong> and <strong>allowed_hosts</strong> is just for security reasons, but I suggest to use them<br />
</span></p>
</li>
<li>Start a command prompt and navigate to the directory where you&#8217;ve unpacked your NSClient++ Files (make sure you&#8217;re running the command prompt as Administrator)
</li>
<li>
<div>Test if NSClient++ is working     =&gt;    <strong>&#8220;NSClient++.exe&#8221; /test</strong><br/><br/><img src="http://www.sperrgebiet.org/wp-content/uploads/2010/06/060510_2207_MonitorWind11.png" alt=""/>
			</div>
<p><span style="font-family:Times New Roman; font-size:12pt">If the output looks good (if no error is displayed) exit the Test-Mode with, tada =&gt; Exit <img src='http://www.sperrgebiet.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
</span></p>
<p><span style="font-family:Times New Roman; font-size:12pt">This Test-Mode is really handy if a query on the Monitoring-Host doesn&#8217;t return the result you expect. Just fire up the Test-Mode and run the query again.<br />
</span></p>
<p> <br />
 </p>
</li>
<li>
<div>Now it&#8217;s almost done. Just install the service and start it.
</div>
<ol>
<li><strong>&#8220;NSClient++.exe&#8221; –install </strong>
				</li>
<li><strong>net start nsclientpp</strong><br/><br/><img src="http://www.sperrgebiet.org/wp-content/uploads/2010/06/060510_2207_MonitorWind21.png" alt=""/>
				</li>
</ol>
</li>
<li>That&#8217;s it, the Windows-Part is done <span style="font-family:Wingdings"></span>
		</li>
</ol>
<p><span style="font-family:Times New Roman; font-size:12pt"><strong>So, now it&#8217;s time for the Linux-Tasks. </strong><br />
		</span></p>
<p><span style="font-family:Times New Roman; font-size:12pt">We need the check_nrpe Plugin. You can either install it with aptitude (aptitude install nagios-nrpe-plugin) or grap a copy of the NRPE source at: <a href="http://www.nagios.org/download/addons">http://www.nagios.org/download/addons</a><br />
		</span></p>
<p><span style="font-family:Times New Roman; font-size:12pt">Again, I&#8217;m a fan of compiling such stuff myself. So let&#8217;s do it.<br />
</span></p>
<ol>
<li>Unpack the archive    =&gt;    tar –xzf nrpe-2.12.tar.gz
</li>
<li>Run the configure-command. Just make sure to include the &#8220;<strong>—enable-command-args</strong>&#8221; option    =&gt; ./configure &#8211;enable-command-args &#8211;enable-ssl<br/>Again, &#8211;enable-ssl isn&#8217;t necessary, but a recommendation. Futhermore maybe it&#8217;s necessary to add some other config-switches to fit your environment.
</li>
<li>Compile the package    =&gt;    make
</li>
<li>It&#8217;s not necessary to install the package, we just the the check_nrpe binary from the ./<strong>src </strong>directory.
</li>
<li>Copy the check_nrpe binary to your libexec dir of Nagios or Icinga    =&gt; <strong>cp src/check_nrpe /usr/local/icinga/libexec/</strong>
		</li>
</ol>
<p> <br />
 </p>
<p><span style="font-family:Times New Roman; font-size:12pt"><strong>Last but not least, the Nagios/Icinga Config </strong><br />
		</span></p>
<p><span style="font-family:Times New Roman; font-size:12pt">First, we&#8217;ll create a new command for checking Performance Counters<br />
</span></p>
<ol>
<li>Edit your <strong>commands.cfg</strong> (by default in /usr/local/icinga/etc/objects/commands.cfg)    =&gt;    <strong>sudo vim /usr/local/icinga/etc/objects/commands.cfg</strong><br/><br/><img src="http://www.sperrgebiet.org/wp-content/uploads/2010/06/060510_2207_MonitorWind31.png" alt=""/><br/><br/>Again, this is just a recommendation. But I prefer a &#8220;generic&#8221; command and put the detailed definition into services.
</li>
<li>Now add a new service (by default in /usr/local/icinga/etc/objects/services.cfg)    =&gt; <strong>sudo vim /usr/local/icinga/etc/objects/services.cfg</strong><br/>You must use <strong>double Backslashes</strong> for the Counters<br/><br/><img src="http://www.sperrgebiet.org/wp-content/uploads/2010/06/060510_2207_MonitorWind41.png" alt=""/>
		</li>
<li>
<div>How to get the name of a Performance Counter?
</div>
<p><span style="font-family:Times New Roman; font-size:12pt">Use the Windows Performance Monitor (Start -&gt; Run -&gt; perfmon) and add the counters you want to monitor. After that switch to the properties of your current Performance Monitor Session (<strong>Action -&gt; Properties</strong> or<strong> Right Click to the Graphs -&gt; Properties</strong>). At the <strong>Data-Tab</strong> you&#8217;ll find the right name. Just make sure to use double Backslashes in your Icinga/Nagios Config.<br/><img src="http://www.sperrgebiet.org/wp-content/uploads/2010/06/060510_2207_MonitorWind51.png" alt=""/><br />
				</span></p>
</li>
<li>
<div>Save both files ( :wq <img src='http://www.sperrgebiet.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ) , check the config and reload Icinga
</div>
<ol>
<li><strong>sudo /etc/init.d/icinga checkconfig </strong>
				</li>
<li><strong>sudo /etc/init.d/icinga reload </strong>
				</li>
</ol>
</li>
<li>Look at the results of the check in the Web Interface (I&#8217;m sure you&#8217;re already running Icinga-Web, or not? <img src='http://www.sperrgebiet.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> <br/><img src="http://www.sperrgebiet.org/wp-content/uploads/2010/06/060510_2207_MonitorWind6.png" alt=""/>
		</li>
</ol>
<p><span style="font-family:Times New Roman; font-size:12pt"><strong>Some troubleshooting tips: </strong><br />
		</span></p>
<ol>
<li>Before adding a service, run the check on the Linux command line. <br/><img src="http://www.sperrgebiet.org/wp-content/uploads/2010/06/060510_2207_MonitorWind7.png" alt=""/>
		</li>
<li>
<div>Of you do not get the result you expect with the &#8220;remote run&#8221; (see above) try to run the check locally on the Windows Machine.
</div>
<ol>
<li>Start NSClient++ in Test-Mode; You can do that while the service is running. You&#8217;ll get an error that no socket can be bind, but it&#8217;s ok    =&gt; <strong>&#8220;NSClient++.exe&#8221; /test</strong>
				</li>
<li>
<div>Run the check without double Backslashes (they are just necessary for the remote execution)
</div>
<p><img src="http://www.sperrgebiet.org/wp-content/uploads/2010/06/060510_2207_MonitorWind8.png" alt=""/><span style="font-family:Times New Roman; font-size:12pt"><br />
						</span></p>
<p> <br />
 </p>
<p> <br />
 </p>
</li>
</ol>
</li>
</ol>
<p><span style="font-family:Times New Roman; font-size:12pt">Hope this post is helpful for you. If you miss something, or if some steps are not clearly enough just let me know.<br />
</span></p>
<p><span style="font-size:12pt"><strong><span style="font-family:Times New Roman">Good luck and happy monitoring </span><span style="font-family:Wingdings"></span></strong></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sperrgebiet.org/2010/06/monitor-windows-performance-counters-with-icinga-or-nagios/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Internet Speed Test</title>
		<link>http://www.sperrgebiet.org/2010/04/internet-speed-test/</link>
		<comments>http://www.sperrgebiet.org/2010/04/internet-speed-test/#comments</comments>
		<pubDate>Sun, 04 Apr 2010 22:36:15 +0000</pubDate>
		<dc:creator>Hans</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Bandwidth Test]]></category>
		<category><![CDATA[Speed Test]]></category>

		<guid isPermaLink="false">http://www.sperrgebiet.org/?p=225</guid>
		<description><![CDATA[Internet Speed Test to test your available bandwidth. Flash-Based or also with a simple file download, so you can also test it with wget or lynx or any other console-based tool.]]></description>
			<content:encoded><![CDATA[<p>HeHo</p>
<p>Have a look at <a href="http://speedtest.sperrgebiet.org">http://speedtest.sperrgebiet.org</a>. I&#8217;ve included a Speed Test (Bandwidth Test) on my sites. The main part of the Test is from <a href="http://www.brandonchecketts.com/open-source-speedtest" target="_blank">http://www.brandonchecketts.com/open-source-speedtest</a> - Fancy Speed Test. I&#8217;ve modified just the web page to modify so it fits my imagination. You can run the Download/Upload Test just by hitting start or if you don&#8217;t trust the measurement of the download speed (i had some troubles with it while testing it behind a proxy) you can also just download a simple file (with different file sizes of course). That was primarly done so so (and i too, of course) can also test it with wget or lynx.</p>
<p>The whole stuff is located on my Root-Server at Germany with an average available bandwidth of about 50MBit/s. So it should be enough for testing your DSL-Account <img src='http://www.sperrgebiet.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>So here is the URL again: <a href="http://speedtest.sperrgebiet.org">http://speedtest.sperrgebiet.org</a></p>
<p>Cheers<br />
Hans</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sperrgebiet.org/2010/04/internet-speed-test/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Nabaztag tells you your Nagios/Icinga status</title>
		<link>http://www.sperrgebiet.org/2010/02/nabaztag-tells-you-your-nagiosicinga-status/</link>
		<comments>http://www.sperrgebiet.org/2010/02/nabaztag-tells-you-your-nagiosicinga-status/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 02:23:49 +0000</pubDate>
		<dc:creator>Hans</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Icinga]]></category>
		<category><![CDATA[Nabaztag]]></category>
		<category><![CDATA[Nagios]]></category>

		<guid isPermaLink="false">http://www.sperrgebiet.org/?p=146</guid>
		<description><![CDATA[I thought it&#8217;s a good idea to use Nabaztag also for a regular status message about the host and service state.
Based on my other script notify-by-nabaztag.php (see this post)  i&#8217;ve wrote another little PHP-Script which gets the Nagios/Icinga Status from the nagiostats/icingastats utility and use my notify-by-nabaztag.php to send out a status message. Here it&#8230;]]></description>
			<content:encoded><![CDATA[<p>I thought it&#8217;s a good idea to use Nabaztag also for a regular status message about the host and service state.</p>
<p>Based on my other script notify-by-nabaztag.php (<a href="http://www.sperrgebiet.org/2010/02/nagiosicinga-meets-nabaztag/">see this post</a>)  i&#8217;ve wrote another little PHP-Script which gets the Nagios/Icinga Status from the nagiostats/icingastats utility and use my notify-by-nabaztag.php to send out a status message. Here it is: <a href="http://www.sperrgebiet.org/wp-content/uploads/2010/02/status2nabaztag.txt">status2nabaztag.php</a></p>
<p>There are just a few steps to get up and running:</p>
<p>1. Grap my notify-by-nabaztag.php and the status2nabaztag.php scripts</p>
<blockquote><p><span style="FONT-SIZE: 10pt"><span style="FONT-FAMILY: Consolas">wget </span></span><span style="FONT-SIZE: 10pt"><span style="FONT-FAMILY: Consolas">http://www.sperrgebiet.org/wp-content/uploads/2010/02/notify-by-nabaztag.txt -O  /usr/local/icinga/libexec/notify-by-nabaztag.php</span></span></p></blockquote>
<blockquote><p><span style="FONT-SIZE: 10pt"><span style="FONT-FAMILY: Consolas">wget </span></span><span style="FONT-SIZE: 10pt"><span style="FONT-FAMILY: Consolas"><span style="FONT-SIZE: 10pt"><span style="FONT-FAMILY: Consolas">http://www.sperrgebiet.org/wp-content/uploads/2010/02/status2nabaztag.txt -O  /usr/local/icinga/bin/status2nabaztag.php</span></span></span></span></p></blockquote>
<p><span style="FONT-SIZE: 10pt"><span style="FONT-FAMILY: Consolas"><span style="FONT-SIZE: 10pt"><span style="FONT-FAMILY: Consolas">2. Change, if required, paths to the binaries. Specially $stats &amp; $php</span></span></span></span></p>
<p><span style="FONT-SIZE: 10pt"><span style="FONT-FAMILY: Consolas"><span style="FONT-SIZE: 10pt"><span style="FONT-FAMILY: Consolas">3. Test it <img src='http://www.sperrgebiet.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </span></span></span></span><span style="FONT-SIZE: 10pt"><span style="FONT-FAMILY: Consolas"><span style="FONT-SIZE: 10pt"><span style="FONT-FAMILY: Consolas"> </span></span></span></span></p>
<blockquote><p><span style="FONT-SIZE: 10pt"><span style="FONT-FAMILY: Consolas"><span style="FONT-SIZE: 10pt"><span style="FONT-FAMILY: Consolas">php /usr/local/icinga/bin/status2nabaztag.php</span></span></span></span><span style="FONT-SIZE: 10pt"><span style="FONT-FAMILY: Consolas"><span style="FONT-SIZE: 10pt"><span style="FONT-FAMILY: Consolas"> </span></span></span></span></p></blockquote>
<p>4. Assuming everything worked as expected you can add an entry to your crontab to regulary executes the script. I know, it would be a nicer to use the Nagios/Icinga timeperiod-definitions, but the crontab-entry is easier <img src='http://www.sperrgebiet.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
<span style="FONT-SIZE: 10pt"><span style="FONT-FAMILY: Consolas"></p>
<blockquote><p>vim /etc/crontab</p>
<p>0 6-23 * * *    root    /usr/bin/php /usr/local/icinga/bin/status2nabaztag.php</p></blockquote>
<p>This cron entry will executes the script every day between 6am and 11pm.</p>
<p></span>It&#8217;s just a short post, but i think the script should be self explaining too. Furthermore it&#8217;s quite late/early, so i&#8217;ll try to get some sleep because i have to get up in 3hours <img src='http://www.sperrgebiet.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Hope this script is useful too. Please let me know if you have any troubles to get it running.</p>
<p>Remember: In god we trust, the rest we monitor <img src='http://www.sperrgebiet.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <a href="http://www.sperrgebiet.org/wp-content/uploads/2010/02/status2nabaztag.txt"><br />
</a></p>
<p></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sperrgebiet.org/2010/02/nabaztag-tells-you-your-nagiosicinga-status/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Nagios/Icinga meets Nabaztag</title>
		<link>http://www.sperrgebiet.org/2010/02/nagiosicinga-meets-nabaztag/</link>
		<comments>http://www.sperrgebiet.org/2010/02/nagiosicinga-meets-nabaztag/#comments</comments>
		<pubDate>Sun, 14 Feb 2010 23:25:46 +0000</pubDate>
		<dc:creator>Hans</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Icinga]]></category>
		<category><![CDATA[Nabaztag]]></category>
		<category><![CDATA[Nagios]]></category>

		<guid isPermaLink="false">http://www.sperrgebiet.org/?p=134</guid>
		<description><![CDATA[Since i have my Nabaztag-Bunny i ever wanted to use it for my Icinga notifications. I&#8217;ve found a perl script on the internet. But that one just sent out a message and not used LED flashing or ear movements also provided by the Nabaztag-API.

So I&#8217;ve wrote my own notification script in PHP. You can download it&#8230;]]></description>
			<content:encoded><![CDATA[<p><span style="font-family:Georgia; font-size:10pt">Since i have my <a href="http://www.nabaztag.com/" target="_blank">Nabaztag</a>-Bunny i ever wanted to use it for my <a href="http://www.icinga.org" target="_blank">Icinga</a> notifications. I&#8217;ve found a perl script on the internet. But that one just sent out a message and not used LED flashing or ear movements also provided by the <a href="http://doc.nabaztag.com/api/home.html" target="_blank">Nabaztag-API</a>.<br />
</span></p>
<p><span style="font-family:Georgia; font-size:10pt">So I&#8217;ve wrote my own notification script in PHP. You can download it here: <a href="http://www.sperrgebiet.org/wp-content/uploads/2010/02/notify-by-nabaztag.txt"><span style="color: #0000ff; text-decoration: underline;">notify-by-nabaztag.php</span></a></span><span style="font-family:Georgia; font-size:10pt"><span style="color: #0000ff; text-decoration: underline;"> </span></span></p>
<p>You can watch a video demonstrating it in action here in the following embedded Windows Media Player or at <a href="http://www.youtube.com/watch?v=Tx4EpTLMBV0" target="_blank">YouTube</a></p>
<p><object classid="clsid:6bf52a52-394a-11d3-b153-00c04f79faa6" width="640" height="480" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"><param name="autostart" value="false" /><param name="url" value="http://www.sperrgebiet.org/wp-content/uploads/2010/02/notify-by-nabaztag_en.wmv" /><param name="src" value="http://www.sperrgebiet.org/wp-content/uploads/2010/02/notify-by-nabaztag_en.wmv" /><embed type="application/x-mplayer2" width="640" height="480" src="http://www.sperrgebiet.org/wp-content/uploads/2010/02/notify-by-nabaztag_en.wmv" url="http://www.sperrgebiet.org/wp-content/uploads/2010/02/notify-by-nabaztag_en.wmv" autostart="false"></embed></object></p>
<p><span style="font-family:Georgia; font-size:10pt">The script is quite simple. It&#8217;s need two arguments. The first one is the message for the TTL (text-to-speech) and the second one is the &#8220;notification type&#8221;. The notification type is either the service or host state (OK, WARNING, CRITICAL, UNKNOWN, UP, DOWN, UNREACHABLE).<br />
</span><br />
<span style="font-family:Georgia; font-size:10pt">Depending on the notification type the bunny is flashing in a different color and moves it&#8217;s ears to another position:<br />
</span></p>
<table border="0">
<tbody>
<tr>
<td>OK/UP:</td>
<td>flashing green, ears going up</td>
</tr>
<tr>
<td>WARNING:</td>
<td>flashing yellow, both ears are moved to the front with an angle of 45°</td>
</tr>
<tr>
<td>CRITICAL/DOWN:</td>
<td>flashing red, ears going down</td>
</tr>
<tr>
<td>UNKNOWN/UNREACHABLE:</td>
<td>flashing blue, one ear to the front, one to the back, each with an angle of 45°</td>
</tr>
</tbody>
</table>
<p><span style="font-family:Georgia; font-size:10pt">You can configure the voice which should be used inside the script. I propose to use a US/UK one because the states are in English too. I think the script should be self-explaining. If not, just leave an comment.<br />
</span></p>
<p><span style="font-family:Georgia; font-size:10pt">When you already have Nagios/Icinga up and running you should also know how to add an new notification command. Otherwise here are the basic steps (assuming you are running Icinga within /usr/local/icinga):<br />
</span></p>
<p><span style="font-family:Georgia; font-size:10pt">1. We need php-cli installed so we can run the script on the CLI. Depending on your distro run on of the following commands</span></p>
<blockquote><p><span style="font-family:Georgia; font-size:10pt"> </span><span style="font-family:Consolas; font-size:10pt">aptitude install php-cli<br />
</span><span style="font-family:Georgia">or<br />
</span><span style="font-family:Consolas; font-size:10pt">yum install php-cli</span></p></blockquote>
<p><span style="font-size:10pt"><span style="font-family:Georgia">2. Download the script to your libexec-Directory:</span></span></p>
<blockquote><p><span style="font-size:10pt"><span style="font-family:Consolas">wget <a href="http://www.sperrgebiet.org/wp-content/uploads/2010/02/notify-by-nabaztag.txt -O /usr/local/icinga/libexec/notify-by-nabaztag.php">http://www.sperrgebiet.org/wp-content/uploads/2010/02/notify-by-nabaztag.txt -O /usr/local/icinga/libexec/notify-by-nabaztag.php</a><br />
</span></span></p></blockquote>
<p><span style="font-size:10pt"> </span></p>
<p> </p>
<p><span style="font-family:Georgia; font-size:10pt">3. Add a host and service notification command. If you want a more detailed output just add it to the right position. You&#8217;ll find all available Macros at <a href="http://nagios.sourceforge.net/docs/3_0/macrolist.html" target="_blank">http://nagios.sourceforge.net/docs/3_0/macrolist.html</a></span></p>
<blockquote><p><span style="font-family:Consolas; font-size:10pt">vim /usr/local/icinga/etc/objects/commands.cfg<br />
</span></p></blockquote>
<blockquote><p><span style="font-family:Consolas; font-size:10pt"># &#8216;notify-service-by-nabaztag&#8217; command<br />
define command{<br />
command_name notify-service-by-nabaztag<br />
command_line /usr/bin/php $USER1$/notify-by-nabaztag.php &#8220;Monitoring Notification: $NOTIFICATIONTYPE$ on $HOSTNAME$ (Hostalias is $HOSTALIAS$) with Service: $SERVICEDESC$. Current servicestate is $SERVICESTATE$&#8221; $SERVICESTATE$<br />
}<br />
</span></p></blockquote>
<blockquote><p><span style="font-family:Consolas; font-size:10pt"># &#8216;notify-host-by-nabaztag&#8217; command<br />
define command{<br />
command_name notify-host-by-nabaztag<br />
command_line /usr/bin/php $USER1$/notify-by-nabaztag.php &#8220;Monitoring Notification: $NOTIFICATIONTYPE$ on $HOSTNAME$ (Hostalias is $HOSTALIAS$). Hoststate is $HOSTSTATE$&#8221; $HOSTSTATE$<br />
}<br />
</span></p></blockquote>
<p><span style="font-family:Georgia; font-size:10pt">4. I&#8217;ve created a new time period, because I don&#8217;t want that my bunny is talking to me during the night <img src='http://www.sperrgebiet.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
</span></p>
<blockquote><p><span style="font-family:Consolas; font-size:10pt">vim /usr/local/icinga/etc/objects/timeperiods.cfg<br />
</span></p></blockquote>
<blockquote><p><span style="font-family:Consolas; font-size:10pt"># &#8216;nabazhours&#8217;<br />
</span></p></blockquote>
<blockquote><p><span style="font-family:Consolas; font-size:10pt">define timeperiod{<br />
timeperiod_name nabazhours<br />
alias Where my nabaztag is active<br />
monday 06:00-23:00<br />
tuesday 06:00-23:00<br />
wednesday 06:00-23:00<br />
thursday 06:00-23:00<br />
friday 06:00-23:00<br />
saturday 08:00-23:00<br />
sunday 08:00-23:00<br />
}<br />
</span></p></blockquote>
<p><span style="font-family:Georgia; font-size:10pt">5. After that a new contact is created which use the above added notification commands and the right time period<br />
</span></p>
<blockquote><p><span style="font-family:Consolas; font-size:10pt">vim /usr/local/icinga/etc/objects/contacts.cfg<br />
</span></p></blockquote>
<blockquote><p><span style="font-family:Consolas; font-size:10pt">define contact{<br />
contact_name nabaztag<br />
use generic-contact<br />
alias My Bunny<br />
service_notification_commands notify-service-by-nabaztag<br />
host_notification_commands notify-host-by-nabaztag<br />
service_notification_period nabazhours<br />
host_notification_period nabazhours<br />
}<br />
</span></p></blockquote>
<p><span style="font-family:Georgia; font-size:10pt">6. We should have enough time to run a config-check <img src='http://www.sperrgebiet.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
</span></p>
<blockquote><p><span style="font-family:Consolas; font-size:10pt">/usr/local/icinga/bin/icinga -v /usr/local/icinga/etc/icinga.cfg<br />
</span></p></blockquote>
<p><span style="font-family:Georgia; font-size:10pt">7. When no errors or warnings appear reload Nagios/Icinga and wait till problem occur <img src='http://www.sperrgebiet.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
</span></p>
<blockquote><p><span style="font-family:Consolas; font-size:10pt">/etc/init.d/icinga reload<br />
</span></p></blockquote>
<p><span style="font-family:Georgia">Hope everything works as expected and you&#8217;ll find this script useful. Have fun with Nagios/Icinga and your Bunny. </span><span style="font-family:Wingdings">J</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sperrgebiet.org/2010/02/nagiosicinga-meets-nabaztag/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
<enclosure url="http://www.sperrgebiet.org/wp-content/uploads/2010/02/notify-by-nabaztag_en.wmv" length="111055208" type="video/x-ms-wmv" />
		</item>
		<item>
		<title>Automatic SSH logon</title>
		<link>http://www.sperrgebiet.org/2009/07/automatic-ssh-logon/</link>
		<comments>http://www.sperrgebiet.org/2009/07/automatic-ssh-logon/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 23:51:49 +0000</pubDate>
		<dc:creator>Hans</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Automatic Logon]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://www.sperrgebiet.org/blog/?p=13</guid>
		<description><![CDATA[Host1:

ssh-keygen
No PassPhrase (so automatic logon works)
Default filename and path is ok
cat ~/.ssh/id_rsa.pub
Copy content of id_rsa.pub

 
Host2:

Create ~/.ssh
Create ~/.ssh/authorized_keys
Paste content of clipboard into authorized_keys

 
Both steps vice vera
 
At the first logon a warning appears that the hostkey is added
to know_hosts. Yes to proceed.
 
That&#8217;s it  
]]></description>
			<content:encoded><![CDATA[<p style="margin: 0in 0in 0in 0.375in; font-family: Calibri; font-size: 11pt;">Host1:</p>
<ol style="margin-top: 0in; unicode-bidi: embed; font-family: Calibri; direction: ltr; margin-bottom: 0in; margin-left: 0.375in; font-size: 11pt;" type="1">
<li style="margin-top: 0px; margin-bottom: 0px; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">ssh-keygen</span></li>
<li style="margin-top: 0px; margin-bottom: 0px; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">No PassPhrase (so automatic logon works)</span></li>
<li style="margin-top: 0px; margin-bottom: 0px; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">Default filename and path is ok</span></li>
<li style="margin-top: 0px; margin-bottom: 0px; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">cat ~/.ssh/id_rsa.pub</span></li>
<li style="margin-top: 0px; margin-bottom: 0px; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">Copy content of id_rsa.pub</span></li>
</ol>
<p style="margin: 0in 0in 0in 0.375in; font-family: Calibri; font-size: 11pt;"> </p>
<p style="margin: 0in 0in 0in 0.375in; font-family: Calibri; font-size: 11pt;">Host2:</p>
<ol style="margin-top: 0in; unicode-bidi: embed; font-family: Calibri; direction: ltr; margin-bottom: 0in; margin-left: 0.375in; font-size: 11pt;" type="1">
<li style="margin-top: 0px; margin-bottom: 0px; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">Create ~/.ssh</span></li>
<li style="margin-top: 0px; margin-bottom: 0px; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">Create ~/.ssh/authorized_keys</span></li>
<li style="margin-top: 0px; margin-bottom: 0px; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">Paste content of clipboard into authorized_keys</span></li>
</ol>
<p style="margin: 0in 0in 0in 0.375in; font-family: Calibri; font-size: 11pt;"> </p>
<p style="margin: 0in 0in 0in 0.375in; font-family: Calibri; font-size: 11pt;">Both steps vice vera</p>
<p style="margin: 0in 0in 0in 0.375in; font-family: Calibri; font-size: 11pt;"> </p>
<p style="margin: 0in 0in 0in 0.375in; font-family: Calibri; font-size: 11pt;">At the first logon a warning appears that the hostkey is added</p>
<p style="margin: 0in 0in 0in 0.375in; font-family: Calibri; font-size: 11pt;">to know_hosts. Yes to proceed.</p>
<p style="margin: 0in 0in 0in 0.375in; font-family: Calibri; font-size: 11pt;"> </p>
<p style="margin: 0in 0in 0in 0.375in; font-family: Calibri; font-size: 11pt;">That&#8217;s it <img src='http://www.sperrgebiet.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.sperrgebiet.org/2009/07/automatic-ssh-logon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find and delete files with specific content</title>
		<link>http://www.sperrgebiet.org/2009/07/find-and-delete-files-with-specific-content/</link>
		<comments>http://www.sperrgebiet.org/2009/07/find-and-delete-files-with-specific-content/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 23:49:58 +0000</pubDate>
		<dc:creator>Hans</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Bash]]></category>

		<guid isPermaLink="false">http://www.sperrgebiet.org/blog/?p=11</guid>
		<description><![CDATA[Ever wanted to deleted (or move, copy, what else) all files in a directory? It&#8217;s quite easy:
egrep -l NEEDLE * &#124; xargs rm
This command will find all files with NEEDLE in it, pipes the filename (that&#8217;s because we need the parameter L) to xargs which then use the STDIN (our filename) and put&#8217;s it to rm.
Just play&#8230;]]></description>
			<content:encoded><![CDATA[<p>Ever wanted to deleted (or move, copy, what else) all files in a directory? It&#8217;s quite easy:</p>
<p><em>egrep -l NEEDLE * | xargs rm</em></p>
<p>This command will find all files with NEEDLE in it, pipes the filename (that&#8217;s because we need the parameter L) to xargs which then use the STDIN (our filename) and put&#8217;s it to rm.</p>
<p>Just play around with it the possible parameters. It would save you a lot of time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sperrgebiet.org/2009/07/find-and-delete-files-with-specific-content/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
