<?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; log</title>
	<atom:link href="http://simon.zekar.com/tag/log/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>
		<item>
		<title>Ugotovite kdo se pretirano pogovarja z vašim spletnim strežnikom</title>
		<link>http://simon.zekar.com/2007/06/14/ugotovite-kdo-se-pretirano-pogovarja-z-vasim-spletnim-streznikom/</link>
		<comments>http://simon.zekar.com/2007/06/14/ugotovite-kdo-se-pretirano-pogovarja-z-vasim-spletnim-streznikom/#comments</comments>
		<pubDate>Thu, 14 Jun 2007 20:36:33 +0000</pubDate>
		<dc:creator>sIMON</dc:creator>
				<category><![CDATA[general bluez]]></category>
		<category><![CDATA[flood]]></category>
		<category><![CDATA[log]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://simon.zekar.com/2007/06/14/ugotovite-kdo-se-pretirano-pogovarja-z-vasim-spletnim-streznikom/</guid>
		<description><![CDATA[Če sumite, da vaše spletne strani pretirano berejo roboti ali kakšni nepridipravi in vam pri tem upočasnjujejo strežnik, vam serviram eno enovrstičnico, ki iz apache loga prešteje zahtevke za vsak IP naslov. Prikaže vam IP naslov in število zahtevkov, ki jih je ta IP sprožil.
S spremembo vrednosti spremenljivke $limit lahko določite kje bo meja številka [...]]]></description>
			<content:encoded><![CDATA[<p>Če sumite, da vaše spletne strani pretirano berejo roboti ali kakšni nepridipravi in vam pri tem upočasnjujejo strežnik, vam serviram eno enovrstičnico, ki iz apache loga prešteje zahtevke za vsak IP naslov. Prikaže vam IP naslov in število zahtevkov, ki jih je ta IP sprožil.</p>
<p>S spremembo vrednosti spremenljivke $limit lahko določite kje bo meja številka zahtevkov, da se bo IP pokazal v izpisu.</p>
<p><strong> cat /var/log/apache/access | perl -e &#8216;$limit=100; while(&lt;&gt;){ if(/(d{1,3}.d{1,3}.d{1,3}.d{1,3})/) { $ips-&gt;{$1}++;}} for(keys %$ips){ print &#8220;$_: $ips-&gt;{$_}n&#8221; if $ips-&gt;{$_} &gt;= $limit; } &#8216; |sort -k 2 -n</strong></p>
<p>s.</p>
]]></content:encoded>
			<wfw:commentRss>http://simon.zekar.com/2007/06/14/ugotovite-kdo-se-pretirano-pogovarja-z-vasim-spletnim-streznikom/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
