<?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>MrBrown blob &#187; loop</title>
	<atom:link href="http://charles.lescampeurs.org/tag/loop/feed" rel="self" type="application/rss+xml" />
	<link>http://charles.lescampeurs.org</link>
	<description>random bits.</description>
	<lastBuildDate>Thu, 02 Feb 2012 14:34:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Quickly check hosts with ping</title>
		<link>http://charles.lescampeurs.org/2009/08/14/quickly-check-hosts-with-ping?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=quickly-check-hosts-with-ping</link>
		<comments>http://charles.lescampeurs.org/2009/08/14/quickly-check-hosts-with-ping#comments</comments>
		<pubDate>Fri, 14 Aug 2009 11:46:02 +0000</pubDate>
		<dc:creator>CharlyBr</dc:creator>
				<category><![CDATA[Command line]]></category>
		<category><![CDATA[loop]]></category>
		<category><![CDATA[netcat]]></category>
		<category><![CDATA[ping]]></category>

		<guid isPermaLink="false">http://charles.lescampeurs.org/?p=198</guid>
		<description><![CDATA[I needed a script for a quick health check of a bunch of servers. This is how I did it using the ping command: for((i=1;i&#60;42;i++)); do ping -c 1 -W 3 host${i}.domain.com &#38;&#62; /dev/null if [ $? -ne 0 ] ; then echo "host${i} is down" else echo "host${i} is up" fi done You can [...]]]></description>
			<content:encoded><![CDATA[<p>I needed a script for a quick health check of a bunch of servers.<br />
This is how I did it using the <a href="http://linux.die.net/man/8/ping" target="_blank">ping command</a>:</p>
<pre>for((i=1;i&lt;42;i++)); do
    ping -c 1 -W 3 host${i}.domain.com &amp;&gt; /dev/null
    if [ $? -ne 0 ] ; then
        echo "host${i} is down"
    else
        echo "host${i} is up"
    fi
done</pre>
<p>You can also use netcat and check a specific port:</p>
<pre>netcat -z -w 2  host${i}.domain.com 80 &amp;&gt; /dev/null</pre>
 <img src="http://charles.lescampeurs.org/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=198" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://charles.lescampeurs.org/2009/08/14/quickly-check-hosts-with-ping/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

