<?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; Monitoring</title>
	<atom:link href="http://charles.lescampeurs.org/category/monitoring/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>Enhance your munin load graph</title>
		<link>http://charles.lescampeurs.org/2009/12/03/enhance-your-munin-load-graph?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=enhance-your-munin-load-graph</link>
		<comments>http://charles.lescampeurs.org/2009/12/03/enhance-your-munin-load-graph#comments</comments>
		<pubDate>Thu, 03 Dec 2009 10:21:48 +0000</pubDate>
		<dc:creator>CharlyBr</dc:creator>
				<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[load]]></category>
		<category><![CDATA[munin]]></category>

		<guid isPermaLink="false">http://charles.lescampeurs.org/?p=204</guid>
		<description><![CDATA[This is the default output of the munin load plugin. I&#8217;ve patched it to add a permanent blue line indicating the number of cpu of the server. The resulted graph looks like this : You can download the patched plugin here. It is tested with Linux and FreeBSD.]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-205" title="load-day-old" src="http://charles.lescampeurs.org/wp-content/uploads/2009/12/load-day-old.png" alt="load-day-old" width="495" height="264" /></p>
<p>This is the default output of the <a href="http://munin.projects.linpro.no/" target="_blank">munin load plugin</a>.</p>
<p>I&#8217;ve patched it to add a permanent blue line indicating the number of cpu of the server. The resulted graph looks like this :</p>
<p><img class="aligncenter size-full wp-image-206" title="load-day" src="http://charles.lescampeurs.org/wp-content/uploads/2009/12/load-day.png" alt="load-day" width="495" height="276" /></p>
<p>You can download the <a title="munin load plugin" href="http://charles.lescampeurs.org/wp-content/uploads/2009/12/load" target="_blank">patched plugin here</a>. It is tested with Linux and FreeBSD.</p>
 <img src="http://charles.lescampeurs.org/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=204" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://charles.lescampeurs.org/2009/12/03/enhance-your-munin-load-graph/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Memory usage by group of processes</title>
		<link>http://charles.lescampeurs.org/2009/03/13/memory-usage-by-group-of-processes?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=memory-usage-by-group-of-processes</link>
		<comments>http://charles.lescampeurs.org/2009/03/13/memory-usage-by-group-of-processes#comments</comments>
		<pubDate>Fri, 13 Mar 2009 14:14:26 +0000</pubDate>
		<dc:creator>CharlyBr</dc:creator>
				<category><![CDATA[Benchmarks]]></category>
		<category><![CDATA[Command line]]></category>
		<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[awk]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://charles.lescampeurs.org/?p=173</guid>
		<description><![CDATA[While monitoring a http/php server, I needed to do some statistics about php-cgi memory usage. Playing with memory_limit in PHP, we wanted to know the average memory usage per php-cgi process. This is easily calculated with our best friend awk. First, get the number of php running processes: # ps aux &#124; grep php-cgi &#124; [...]]]></description>
			<content:encoded><![CDATA[<p>While monitoring a http/php server, I needed to do some statistics about php-cgi memory usage.</p>
<p>Playing with <em>memory_limit</em> in PHP, we wanted to know the average memory usage per php-cgi process. This is easily calculated with our best friend awk.</p>
<p>First, get the number of php running processes:</p>
<pre># ps aux | grep php-cgi | grep -v grep | wc -l
126</pre>
<p>Then, use awk to calculate the average memory usage for these processes:</p>
<pre># ps aux | grep --exclude=grep php-cgi | grep -v grep | awk 'BEGIN{s=0;}{s=s+$6;}END{print s/126;}'
33987.8</pre>
<p>The number used in the calculation is the field RSS given by ps. The ps manual page says:</p>
<blockquote><p>rss: resident set size, the non-swapped physical memory that a task has used (in kiloBytes)</p></blockquote>
<p>You can also calculate the total memory used by all php-cgi processes:</p>
<pre># ps aux | grep --exclude=grep php-cgi | grep -v grep | awk 'BEGIN{s=0;}{s=s+$6;}END{print s;}'
4302028</pre>
<p>If you need to watch the trend of this average memory usage, a little shell loop does the trick:</p>
<pre># while [ 1 ]; do ps aux | grep --exclude=grep php-cgi | grep -v grep | awk 'BEGIN{s=0;}{s=s+$6;}END{print s/126;}'; sleep 2; done
34401.3
34405.1
34408.4
34409.4
34414.2
34417</pre>
 <img src="http://charles.lescampeurs.org/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=173" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://charles.lescampeurs.org/2009/03/13/memory-usage-by-group-of-processes/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Munin and Use of uninitializer value in eval</title>
		<link>http://charles.lescampeurs.org/2009/03/11/munin-and-use-of-uninitializer-value-in-eval?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=munin-and-use-of-uninitializer-value-in-eval</link>
		<comments>http://charles.lescampeurs.org/2009/03/11/munin-and-use-of-uninitializer-value-in-eval#comments</comments>
		<pubDate>Wed, 11 Mar 2009 06:51:26 +0000</pubDate>
		<dc:creator>CharlyBr</dc:creator>
				<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[etch]]></category>
		<category><![CDATA[munin]]></category>

		<guid isPermaLink="false">http://charles.lescampeurs.org/?p=166</guid>
		<description><![CDATA[On some of freshly installed servers (Debian Etch), I encountered these error messages in /var/log/munin/munin-node.log: Use of uninitialized value in eval {block} exit at /usr/sbin/munin-node line 456, &#60;CHILD&#62; line 8. What a great error message After digging into Google results, I found it was just a problem with host_name variable in the configuration. Default value [...]]]></description>
			<content:encoded><![CDATA[<p>On some of freshly installed servers (Debian Etch), I encountered these error messages in <em>/var/log/munin/munin-node.log</em>:</p>
<pre>Use of uninitialized value in eval {block} exit at /usr/sbin/munin-node line 456, &lt;CHILD&gt; line 8.</pre>
<p>What a great error message <img src='http://charles.lescampeurs.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>After digging into Google results, I found it was just a problem with host_name variable in the configuration. Default value is <em>hostname.localdomain</em>. I&#8217;ve replaced it with a valid hostname and it works!</p>
 <img src="http://charles.lescampeurs.org/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=166" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://charles.lescampeurs.org/2009/03/11/munin-and-use-of-uninitializer-value-in-eval/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Check if cron is working with monit</title>
		<link>http://charles.lescampeurs.org/2008/11/27/check-if-cron-is-working-with-monit?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=check-if-cron-is-working-with-monit</link>
		<comments>http://charles.lescampeurs.org/2008/11/27/check-if-cron-is-working-with-monit#comments</comments>
		<pubDate>Thu, 27 Nov 2008 20:27:10 +0000</pubDate>
		<dc:creator>CharlyBr</dc:creator>
				<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[monit]]></category>

		<guid isPermaLink="false">http://charles.lescampeurs.org/?p=129</guid>
		<description><![CDATA[I encountered a problem last week with cron. crond was running but the jobs seems to not work. After debugging the crontab, I saw that on one job, the username was missing. Nothing was written in the logs to say that there was a problem. To avoid future problems, I wrote an alert for monit. [...]]]></description>
			<content:encoded><![CDATA[<p>I encountered a problem last week with cron. crond was running but the jobs seems to not work. After debugging the crontab, I saw that on one job, the username was missing.</p>
<p>Nothing was written in the logs to say that there was a problem.</p>
<p>To avoid future problems, I wrote an alert for <a href="http://mmonit.com/monit/" target="_blank">monit.</a></p>
<p>In my crontab, I&#8217;ve added the following job:</p>
<pre>*/5 * * * *       root    touch /tmp/check_cron</pre>
<p>This job will update the timestamp of the file /tmp/check_cron every 5 minutes.</p>
<p>And in monit configuration (/etc/monit/monitrc), I&#8217;ve added the following alert:</p>
<pre>check file check_cron with path /tmp/check_cron
        if timestamp &gt; 10 minutes then alert</pre>
<p>If the crontab is not working, monit will send you an alert email like this:</p>
<pre>Subject: monit alert --  Exists check_cron

Exists Service check_cron 

	Date:        Thu, 27 Nov 2008 21:21:53 +0100
	Action:      alert
	Host:        myhost
	Description: 'check_cron' file exist

Your faithful employee,
monit</pre>
 <img src="http://charles.lescampeurs.org/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=129" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://charles.lescampeurs.org/2008/11/27/check-if-cron-is-working-with-monit/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

