<?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; monit</title>
	<atom:link href="http://charles.lescampeurs.org/tag/monit/feed" rel="self" type="application/rss+xml" />
	<link>http://charles.lescampeurs.org</link>
	<description>random bits.</description>
	<lastBuildDate>Sat, 10 Apr 2010 09:02:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<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</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[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fcharles.lescampeurs.org%2F2008%2F11%2F27%2Fcheck-if-cron-is-working-with-monit"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fcharles.lescampeurs.org%2F2008%2F11%2F27%2Fcheck-if-cron-is-working-with-monit&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<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>
]]></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>
