<?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>Gingerlime &#187; Uncategorized</title>
	<atom:link href="http://blog.gingerlime.com/category/uncategorized/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.gingerlime.com</link>
	<description></description>
	<lastBuildDate>Tue, 07 Sep 2010 19:13:06 +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>who&#8217;s calling?</title>
		<link>http://blog.gingerlime.com/whos-calling</link>
		<comments>http://blog.gingerlime.com/whos-calling#comments</comments>
		<pubDate>Sat, 27 Feb 2010 00:43:25 +0000</pubDate>
		<dc:creator>Yoav Aner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.gingerlime.com/?p=100</guid>
		<description><![CDATA[Caller ID is a wonderful feature. Don&#8217;t we love getting a call from someone we like, and perhaps more importantly, ignore those annoying callers who we really don&#8217;t want to talk to. But this is yesterday&#8217;s news. We all have caller IDs. It just works. Well, yes. It does. But what if we get a [...]]]></description>
			<content:encoded><![CDATA[<p>Caller ID is a wonderful feature. Don&#8217;t we love getting a call from someone we like, and perhaps more importantly, ignore those annoying callers who we really don&#8217;t want to talk to.</p>
<p>But this is yesterday&#8217;s news. We all have caller IDs. It just works. Well, yes. It does. But what if we get a call on our landline? We get the caller ID there too, but do we know who it is?? All our contacts are on our mobile phones. Standard phones don&#8217;t usually have the capacity to hold more than 10 names on average.  And even if they did. Who&#8217;s got the energy to key in those numbers?<br />
<span id="more-100"></span><br />
Enters Asterisk. Asterisk supports name as well as numbers for caller ID. But how do you get your asterisk to know the name of the caller? How can we inject the caller&#8217;s name into the caller ID string sent to our voip phones?</p>
<p>I&#8217;ve seen some online posts (like <a href="http://www.voiptechchat.com/voip/213/asterisk-script-caller-id-name-cnam-lookup/">this one</a>) about setting up look-up through online phone directories. I wanted something simpler. Why can&#8217;t I have my asterisk know who&#8217;s calling, based on my contacts on my iphone address book??</p>
<p>So here&#8217;s what I did. It can work on any address book format, as long as you can get it out as a csv (examples for iphone <a href="http://paulievox.wordpress.com/2008/11/01/how-to-backup-iphone-address-book-recover-from-a-mobile-me-sync-disaster/">here</a> and <a href="http://forums.anandtech.com/showthread.php?t=306101">here</a>). I created a simple CSV file, with two columns: Name and Number, which looks like this:</p>
<div class="codesnip-container" >&#8220;Tony Blair&#8221;,07392838482<br />
&#8220;Gordon Brown&#8221;,07893420393<br />
&#8220;Kate Moss&#8221;,07393837732<br />
&#8230;</div>
<p>I then created a little python script to run on my asterisk box, and pull the name based on the number. It&#8217;s an AGI script, but it&#8217;s so basic it doesn&#8217;t actually need any AGI libraries:</p>
<div class="codesnip-container" >
<div class="python codesnip"><span class="co1">#!/usr/bin/env python</span></p>
<p><span class="kw1">import</span> <span class="kw3">sys</span><br />
<span class="kw1">import</span> <span class="kw3">csv</span></p>
<p><span class="kw1">if</span> <span class="kw2">len</span><span class="br0">&#40;</span><span class="kw3">sys</span>.<span class="me1">argv</span><span class="br0">&#41;</span> <span class="sy0">&lt;</span>= <span class="nu0">1</span>: &nbsp; &nbsp;<br />
&nbsp; &nbsp; exit<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; <br />
cid = <span class="kw3">sys</span>.<span class="me1">argv</span><span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span>.<span class="me1">replace</span><span class="br0">&#40;</span><span class="st0">&quot;-&quot;</span>,<span class="st0">&quot;&quot;</span><span class="br0">&#41;</span>.<span class="me1">replace</span><span class="br0">&#40;</span><span class="st0">&quot; &quot;</span>,<span class="st0">&quot;&quot;</span><span class="br0">&#41;</span>.<span class="me1">strip</span><span class="br0">&#40;</span><span class="br0">&#41;</span></p>
<p><span class="co1"># accepting AGI input (but there&#8217;s nothing to do with it)</span><br />
<span class="kw1">while</span> <span class="nu0">1</span>:<br />
&nbsp; &nbsp; line = <span class="kw3">sys</span>.<span class="me1">stdin</span>.<span class="kw3">readline</span><span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="kw1">not</span> line:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">break</span><br />
&nbsp; &nbsp; <span class="kw1">if</span> line==<span class="st0">&quot;<span class="es0">\n</span>&quot;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">break</span></p>
<p>fd = <span class="kw2">file</span><span class="br0">&#40;</span><span class="st0">&quot;/usr/share/asterisk/agi-bin/my_iphone_address_book.csv&quot;</span><span class="br0">&#41;</span></p>
<p><span class="kw1">print</span> <span class="st0">&#8216;VERBOSE &quot;STATUS: Looking up %s&quot; 2&#8242;</span> <span class="sy0">%</span> cid<br />
<span class="kw1">for</span> line <span class="kw1">in</span> <span class="kw3">csv</span>.<span class="me1">reader</span><span class="br0">&#40;</span>fd<span class="br0">&#41;</span>:<br />
&nbsp; &nbsp; <span class="co1"># note: comparing the number back-to-front, and only comparing 8 rightmost digits.</span><br />
&nbsp; &nbsp; <span class="co1"># &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; This helps dealing with different prefix, e.g. +44, 00, 001 etc. and still getting </span><br />
&nbsp; &nbsp; <span class="co1"># &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; an accurate match.</span><br />
&nbsp; &nbsp; <span class="kw1">if</span> line<span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span>.<span class="me1">replace</span><span class="br0">&#40;</span><span class="st0">&quot;-&quot;</span>,<span class="st0">&quot;&quot;</span><span class="br0">&#41;</span>.<span class="me1">replace</span><span class="br0">&#40;</span><span class="st0">&quot; &quot;</span>,<span class="st0">&quot;&quot;</span><span class="br0">&#41;</span>.<span class="me1">strip</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#91;</span>::-<span class="nu0">1</span><span class="br0">&#93;</span><span class="br0">&#91;</span>:<span class="nu0">8</span><span class="br0">&#93;</span> == cid<span class="br0">&#91;</span>::-<span class="nu0">1</span><span class="br0">&#93;</span><span class="br0">&#91;</span>:<span class="nu0">8</span><span class="br0">&#93;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">print</span> <span class="st0">&#8216;VERBOSE &quot;STATUS: Found %s : %s&quot; 2&#8242;</span> <span class="sy0">%</span> <span class="br0">&#40;</span>cid, line<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span>.<span class="me1">strip</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">print</span> <span class="st0">&#8216;SET VARIABLE CALLERID(name) &quot;%s&quot;&#8217;</span> <span class="sy0">%</span> line<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span>.<span class="me1">strip</span><span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; exit<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
<span class="kw1">print</span> <span class="st0">&#8216;VERBOSE &quot;STATUS: %s Not Found&quot; 2&#8242;</span> <span class="sy0">%</span> cid</div>
</div>
<p>It can be invoked in the same way as described <a href="http://www.teamforrest.com/blog/89/using-agi-to-get-caller-id-name-cnam/">here</a>, i.e.:</p>
<div class="codesnip-container" >exten => s,n,Gosub(cidname-lookup,s,1)<br />
exten => s,n,dial(${PHONE},30,t)<br />
&#8230;<br />
[cidname-lookup]<br />
exten => s,1,NoOp(looking up callerid name)<br />
exten => s,n,GotoIf($["foo${CALLERID(NAME)}" = "foo" ]?getname)<br />
exten => s,n,GotoIf($["${CALLERID(NAME)}" = "${CALLERID(NUM)}" ]?getname)<br />
exten => s,n,NoOp(caller id name exists as ${CALLERID(NAME)})<br />
exten => s,n,Return<br />
exten => s,n(getname),AGI(calleridname.py,${CALLERID(NUM)})<br />
exten => s,n,NoOp(Caller ID Name is now ${CALLERID(NAME)})<br />
exten => s,n,Return</div>
<p><del datetime="2010-03-01T18:34:43+00:00">Note that it&#8217;s currently only working with full matches. The caller ID number must match the record on the address book precisely. Let me know if you have any simple ideas for partial matches (e.g. to avoid non matches of numbers, e.g. +447771110006 != 07771110006). I&#8217;ll do some more research when I get a chance.<br />
</del><br />
Update: code now deals with partial matches rather effectively.</p>
<p>Another benefit is with voicemails. I started forwarding my voicemail straight to my asterisk box. My mobile provider doesn&#8217;t support visual voicemail yet, and I find it frustrating to use the old fashioned voicemail system. Now when I get an email with the voicemail message, I not only see the number of the caller, and can call them back with a click. I also see their name.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gingerlime.com/whos-calling/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get in shape</title>
		<link>http://blog.gingerlime.com/get-in-shape</link>
		<comments>http://blog.gingerlime.com/get-in-shape#comments</comments>
		<pubDate>Wed, 20 Jan 2010 20:56:00 +0000</pubDate>
		<dc:creator>Yoav Aner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.gingerlime.com/?p=93</guid>
		<description><![CDATA[ISPs are a strange breed. They&#8217;re supposed to give a very straight-forward service &#8211; plug me in to the Internet please. That&#8217;s all. Plain and simple. It seems like some ISPs have different ideas as to their roles and responsibilities. Traffic shaping is one of those. Port/Service blocking is its ugly cousin. I don&#8217;t like [...]]]></description>
			<content:encoded><![CDATA[<p>ISPs are a strange breed. They&#8217;re supposed to give a very straight-forward service &#8211; plug me in to the Internet please. That&#8217;s all. Plain and simple. It seems like some ISPs have different ideas as to their roles and responsibilities. Traffic shaping is one of those. Port/Service blocking is its ugly cousin. I don&#8217;t like either. You&#8217;re not my Big Brother. If I wanted one I&#8217;d move to China.</p>
<p><span id="more-93"></span></p>
<p>ISPs enjoy a legal freedom of being considered a <em>mere conduit</em>. That means they&#8217;re not responsible for whatever their customers do with their connection. Nobody can sue the ISP for copyright infringement or any such or other illegal activity. And it makes sense. They&#8217;re just a pipe. If you, as a customer, choose to send poison down the pipe &#8211; it&#8217;s not the ISPs fault. That is, as long as they don&#8217;t control or take part in the communication.</p>
<p>Some ISPs want to have it both ways however. They&#8217;re not happy with some of the traffic, want to reduce their bandwidth and costs, and so they start using some traffic shaping measures. Their customers aren&#8217;t supposed to notice, and they are rarely being told about it either.</p>
<p>Whilst in Israel, I encountered a weird problem with <a href="http://www.012.net">012 Smile</a>, a local ISP. I must have spent hours on the phone to their support until the issues I was having were resolved. Some sites were painfully slow. Watching a youtube video or any video on the BBC, Guardian and many other websites, particularly out of Israel, was simply impossible. The other odd thing I came across was that one TCP port seemed to be blocked completely. One of my hosting providers use port 2095 for webmail. I simply couldn&#8217;t establish a connection. Testing it further, I noticed that the connection on port 2095 was established, but I was getting no response. As if there was some transparent proxy along the way. This whole thing reeked of traffic shaping, or worse, active blocking of services. Convincing the support staff it was an actual problem was no easy feat. I&#8217;m lucky I know enough to explain and insist when necessary, but for the average joe (or average Yossi in this case), 012 makes it next to impossible to get it sorted. Their support blamed it on the computer, on the router, on the cable provider. They blamed it on anything but themselves (oddly, they didn&#8217;t blame it on the boogie!).</p>
<p>So the problem got sorted out eventually. It was painful, but 012 made some magic changes and things got better. I insisted on getting a full explanation about the problem, but was given none. All they said was they fixed it. They claimed to made some routing changes, but no routing changes can affect access to a single port!! Pushing the support staff further, I was hinted about some traffic shaping that 012 are using.</p>
<p>How can you tell your ISP is using traffic shaping? Shouldn&#8217;t it be something they HAVE to tell you about? I think it should be. This is not something you see on their website, or even T&#038;Cs. I personally think legislation is the way forward here. And of course consumer pressure. Most consumers are sadly unaware of it.</p>
<p>I&#8217;m not sure if or how much traffic shaping is done in the UK. However, UK ISPs are reported to show concern about the new Digital Economy Bill. Particularly the need to monitor their own users and track repeat offenders. Without going into debate into the bill itself (for which there is plenty of criticism), those ISPs who use traffic shaping and blocking might find it hard to argue their case. If you do control traffic in some way, you&#8217;re no longer <em>mere conduit</em>, and you CAN be expected by the government to enforce other degrees of control (and responsibility/liability) over your users.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gingerlime.com/get-in-shape/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cron woes &#8211; file timsetamp monitoring plugin for munin</title>
		<link>http://blog.gingerlime.com/cron-woes-file-timsetamp-monitoring-plugin-for-munin</link>
		<comments>http://blog.gingerlime.com/cron-woes-file-timsetamp-monitoring-plugin-for-munin#comments</comments>
		<pubDate>Wed, 02 Jul 2008 13:53:06 +0000</pubDate>
		<dc:creator>Yoav Aner</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.gingerlime.com/?p=27</guid>
		<description><![CDATA[I don&#8217;t like being late. It runs in the family. My dad is so obsessed with being late that he&#8217;s always early. How embarrassing. Unfortunately I seemed to have inherited it from him. I do however try to compensate. I am deliberately late on-time. I usually plan to be a bit late. Anyway, enough about [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t like being late. It runs in the family. My dad is so obsessed with being late that he&#8217;s always early. How embarrassing. Unfortunately I seemed to have inherited it from him. I do however try to compensate. I am deliberately late on-time. I usually <strong>plan</strong> to be a bit late. </p>
<p>Anyway, enough about me.<br />
<span id="more-27"></span></p>
<p>cron cron cron, the mighty scheduler. Making sure things are running on time, but does it? Well, sort of. My cron (or more precisely anacron) has failed me. It appears like a logrotate cron.daily job was stuck due to some random bug in the lighttpd postrotate script (see <a href="http://lists.alioth.debian.org/pipermail/pkg-lighttpd-maintainers/2007-April/000543.html">here</a>). Causing anacron to lock, giving messages like:</p>
<div class="codesnip-container" >Job `cron.weekly&#8217; locked by another anacron &#8211; skipping</div>
<p>I don&#8217;t get it why if one script in the /etc/cron.* directory fails, or hangs, anacron doesn&#8217;t somehow detect it and moves on. I tried searching a bit, but couldn&#8217;t find anything. Any ideas or suggestions are welcome.</p>
<p>I then decided to be a little more careful, and monitor those cron jobs myself. The most important jobs are those running rsnapshot to run regular backups. I was looking for a simple way to check a file/folder modified timestamp and alert me if it reaches certain threshold, i.e. it&#8217;s older than X days.</p>
<p>I am already using <a href="http://munin.projects.linpro.no/">munin,</a> for monitoring cpu, network, diskspace etc and it has a CRITICAL/WARNING email notification built-in, so I thought it might be a good tool to use for this purpose too. The graphs aren&#8217;t going to be particularly useful, but the alerting functionality is. </p>
<p>It&#8217;s my first munin plugin, and one of a few python scripts I&#8217;ve written, so hope you can be forgiving for lack of style or technique</p>
<div class="codesnip-container" >
<div class="python codesnip"><span class="co1">#!/usr/bin/env python</span></p>
<p><span class="kw1">import</span> <span class="kw3">os</span><br />
<span class="kw1">import</span> <span class="kw3">time</span><br />
<span class="kw1">import</span> <span class="kw3">datetime</span><br />
<span class="kw1">import</span> <span class="kw3">sys</span></p>
<p>
<span class="co1"># a python dictionary of file/folders and the threshold to issue a warning for each</span><br />
<span class="co1"># you can add a cron job to &#8216;touch&#8217; a file and check it, or use any file you expect to be up-to-date</span><br />
<span class="co1"># this list covers only the rsnapshot backups. You can see the different threshold for each folder based on the expected update frequency. 1 day for daily, 7 days for weekly, 31 for monthly</span></p>
<p>fileList = <span class="br0">&#123;</span><span class="st0">&quot;/var/cache/rsnapshot/daily.0&quot;</span>:<span class="nu0">1</span>, <span class="st0">&quot;/var/cache/rsnapshot/weekly.0&quot;</span>:<span class="nu0">7</span>, <span class="st0">&quot;/var/cache/rsnapshot/monthly.0&quot;</span>:<span class="nu0">31</span><span class="br0">&#125;</span></p>
<p>
<span class="kw1">if</span> <span class="kw2">len</span><span class="br0">&#40;</span><span class="kw3">sys</span>.<span class="me1">argv</span><span class="br0">&#41;</span> == <span class="nu0">2</span> <span class="kw1">and</span> <span class="kw3">sys</span>.<span class="me1">argv</span><span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span> == <span class="st0">&quot;autoconf&quot;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">print</span> <span class="st0">&quot;yes&quot;</span><br />
<span class="kw1">elif</span> <span class="kw2">len</span><span class="br0">&#40;</span><span class="kw3">sys</span>.<span class="me1">argv</span><span class="br0">&#41;</span> == <span class="nu0">2</span> <span class="kw1">and</span> <span class="kw3">sys</span>.<span class="me1">argv</span><span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span> == <span class="st0">&quot;config&quot;</span>:<br />
&nbsp; &nbsp; <span class="kw1">print</span> <span class="st0">&#8216;graph_title File Modified Date&#8217;</span><br />
&nbsp; &nbsp; <span class="kw1">print</span> <span class="st0">&#8216;graph_vlabel Days Since Modified&#8217;</span><br />
&nbsp; &nbsp; <span class="kw1">print</span> <span class="st0">&#8216;graph_category disk&#8217;</span><br />
&nbsp; &nbsp; <span class="kw1">print</span> <span class="st0">&#8216;graph_scale no&#8217;</span><br />
&nbsp; &nbsp; <span class="kw1">print</span> <span class="st0">&#8216;graph_info Monitors file/folder last modified date and shows how many days since modified. Also supports a warning if a specified number of days exceeds the threshold and a critical warning if file/folder does not exist&#8217;</span></p>
<p>&nbsp; &nbsp; <span class="kw1">for</span> item <span class="kw1">in</span> fileList:<br />
&nbsp; &nbsp; &nbsp; &nbsp;muninItem = item.<span class="me1">replace</span><span class="br0">&#40;</span><span class="st0">&quot;.&quot;</span>,<span class="st0">&quot;_&quot;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;muninItem2 = muninItem.<span class="me1">replace</span><span class="br0">&#40;</span><span class="st0">&quot;/&quot;</span>,<span class="st0">&quot;_&quot;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">print</span> <span class="st0">&#8216;%s.label %s&#8217;</span> <span class="sy0">%</span> <span class="br0">&#40;</span>muninItem2, muninItem<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">print</span> <span class="st0">&#8216;%s.warning %s&#8217;</span> <span class="sy0">%</span> <span class="br0">&#40;</span>muninItem2, fileList<span class="br0">&#91;</span>item<span class="br0">&#93;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">print</span> <span class="st0">&#8216;%s.critical 99998&#8242;</span> <span class="sy0">%</span> <span class="br0">&#40;</span>muninItem2<span class="br0">&#41;</span><br />
<span class="kw1">else</span>:</p>
<p>&nbsp; &nbsp; <span class="kw1">for</span> item <span class="kw1">in</span> fileList:<br />
&nbsp; &nbsp; &nbsp; &nbsp;muninItem = item.<span class="me1">replace</span><span class="br0">&#40;</span><span class="st0">&quot;.&quot;</span>,<span class="st0">&quot;_&quot;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;muninItem2 = muninItem.<span class="me1">replace</span><span class="br0">&#40;</span><span class="st0">&quot;/&quot;</span>,<span class="st0">&quot;_&quot;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">try</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; itemTime = <span class="kw3">time</span>.<span class="me1">localtime</span><span class="br0">&#40;</span><span class="kw3">os</span>.<span class="me1">path</span>.<span class="me1">getmtime</span><span class="br0">&#40;</span>item<span class="br0">&#41;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; itemDTime = <span class="kw3">datetime</span>.<span class="kw3">datetime</span><span class="br0">&#40;</span><span class="sy0">*</span>itemTime<span class="br0">&#91;</span><span class="nu0">0</span>:<span class="nu0">5</span><span class="br0">&#93;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; now = <span class="kw3">time</span>.<span class="me1">localtime</span><span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nowDTime = <span class="kw3">datetime</span>.<span class="kw3">datetime</span><span class="br0">&#40;</span><span class="sy0">*</span>now<span class="br0">&#91;</span><span class="nu0">0</span>:<span class="nu0">5</span><span class="br0">&#93;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">print</span> <span class="st0">&quot;%s.value %s&quot;</span> <span class="sy0">%</span> <span class="br0">&#40;</span>muninItem2, <span class="br0">&#40;</span>nowDTime &#8211; itemDTime<span class="br0">&#41;</span>.<span class="me1">days</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">except</span> <span class="kw2">OSError</span>:<br />
<span class="co1"># &nbsp; &nbsp; &nbsp; &nbsp;if the file doesn&#8217;t exist it returns 99999 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">print</span> <span class="st0">&quot;%s.value 99999&quot;</span> <span class="sy0">%</span> <span class="br0">&#40;</span>muninItem2<span class="br0">&#41;</span></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.gingerlime.com/cron-woes-file-timsetamp-monitoring-plugin-for-munin/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>First post</title>
		<link>http://blog.gingerlime.com/first-post</link>
		<comments>http://blog.gingerlime.com/first-post#comments</comments>
		<pubDate>Sat, 06 May 2006 18:05:39 +0000</pubDate>
		<dc:creator>yoav</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.gingerlime.com/?p=3</guid>
		<description><![CDATA[Welcome to the gingerlime blog]]></description>
			<content:encoded><![CDATA[<p>Welcome to the gingerlime blog</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gingerlime.com/first-post/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
