<?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>Simon Žekar - unix, communications, stupidities &#187; swatch</title>
	<atom:link href="http://simon.zekar.com/tag/swatch/feed/" rel="self" type="application/rss+xml" />
	<link>http://simon.zekar.com</link>
	<description>"Unix is simple, but it takes a genious to understand the simplicity" --Dennis Ritchie</description>
	<lastBuildDate>Fri, 23 Apr 2010 22:11:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>swatch &#8211; alerting you of certain log entries</title>
		<link>http://simon.zekar.com/2009/02/04/swatch-log-monitor/</link>
		<comments>http://simon.zekar.com/2009/02/04/swatch-log-monitor/#comments</comments>
		<pubDate>Wed, 04 Feb 2009 20:53:24 +0000</pubDate>
		<dc:creator>sIMON</dc:creator>
				<category><![CDATA[general bluez]]></category>
		<category><![CDATA[alert]]></category>
		<category><![CDATA[log]]></category>
		<category><![CDATA[swatch]]></category>

		<guid isPermaLink="false">http://simon.zekar.com/?p=65</guid>
		<description><![CDATA[A few minutes before coding my own perl script, which would alert me on certain log entries, I&#8217;ve found a software which does it&#8217;s job very well.
It&#8217;s called swatch &#8211; yes, really impressing web site and lack of documentation, examples is tipical for a geek&#8217;s tool.
example config &#8211; very simple:
watchfor /Security violation occurred/
mail addresses=ninja@level13.org,subject="SWATCH warning [...]]]></description>
			<content:encoded><![CDATA[<p>A few minutes before coding my own <a href="http://www.perl.org/" target="_blank">perl</a> script, which would alert me on certain log entries, I&#8217;ve found a software which does it&#8217;s job very well.</p>
<p>It&#8217;s called <a href="http://swatch.sourceforge.net/" target="_blank">swatch</a> &#8211; yes, really impressing web site and lack of documentation, examples is tipical for a geek&#8217;s tool.</p>
<p>example config &#8211; very simple:<br />
<code>watchfor /Security violation occurred/<br />
mail addresses=ninja@level13.org,subject="SWATCH warning - switch_name"</code></p>
<p>and the command line invocation:<br />
<code># /usr/local/bin/swatch -c /usr/local/etc/swatch/switch_name.conf -t /var/log/syslog/switch_name.log --daemon --use-cpan-file-tail</code></p>
<p><strong>&#8211;daemon</strong> for forking it in the background</p>
<p><strong>&#8211;use-cpan-file-tail</strong> is needed so that the swatch will tail file even after it&#8217;s rotated by the rotating script, but make sure that the perl module <a href="http://search.cpan.org/perldoc?File::Tail" target="_blank">File::Tail</a> is installed</p>
<p>It can of course match multiple patterns (multiple watchfor sections) on the same log file, but you must run multiple instances of the software for tailing multiple log files.</p>
<p>Make sure to read <a href="http://linux.die.net/man/1/swatch" target="_blank">swatch man page</a>.</p>
<p>S.</p>
]]></content:encoded>
			<wfw:commentRss>http://simon.zekar.com/2009/02/04/swatch-log-monitor/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
