<?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/"
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Linux Experience</title>
	<atom:link href="http://ramarro.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ramarro.wordpress.com</link>
	<description>alt experience</description>
	<lastBuildDate>Fri, 05 Jun 2009 09:47:58 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>it</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='ramarro.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/7e19daa804369a86ba3f41d8b4a03877?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Linux Experience</title>
		<link>http://ramarro.wordpress.com</link>
	</image>
			<item>
		<title>cvs: hash.c:312: findnode: Assertion `key != ((void *)0)&#8217; failed</title>
		<link>http://ramarro.wordpress.com/2007/11/20/cvs-hashc312-findnode-assertion-key-void-0-failed/</link>
		<comments>http://ramarro.wordpress.com/2007/11/20/cvs-hashc312-findnode-assertion-key-void-0-failed/#comments</comments>
		<pubDate>Tue, 20 Nov 2007 13:35:02 +0000</pubDate>
		<dc:creator>ramarro</dc:creator>
				<category><![CDATA[CVS]]></category>

		<guid isPermaLink="false">http://ramarro.wordpress.com/2007/11/20/cvs-hashc312-findnode-assertion-key-void-0-failed/</guid>
		<description><![CDATA[Strano errore
Questo e&#8217; uno strano errore che mi e&#8217; capitato durante la commit di un file:

cvs [commit aborted]: received abort signal
cvs: hash.c:312: findnode: Assertion `key != ((void *)0)&#8217; failed.
cvs commit: saving log message in /tmp/cvsqKD7fM
&#160;
Da cosa puo&#8217; essere causato?

File system full sul repository
Fine degli inode sul server cvs
Una precedente  commit andata male : Il [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ramarro.wordpress.com&blog=1340588&post=12&subd=ramarro&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><h3>Strano errore</h3>
<p>Questo e&#8217; uno strano errore che mi e&#8217; capitato durante la commit di un file:</p>
<blockquote>
<p align="left">cvs [commit aborted]: received abort signal<br />
cvs: hash.c:312: findnode: Assertion `key != ((void *)0)&#8217; failed.<br />
cvs commit: saving log message in /tmp/cvsqKD7fM</p></blockquote>
<p align="left">&nbsp;</p>
<h3>Da cosa puo&#8217; essere causato?</h3>
<ol>
<li>File system full sul repository</li>
<li>Fine degli inode sul server cvs</li>
<li>Una precedente  commit andata male : Il file esite nel repository ma ne&#8217; dalla update ne&#8217; dal checkout viene estrapolato. Il file risulta inserito nel repository ma non e&#8217; utilizzabile : invisibile al client</li>
</ol>
<h3>Soluzioni</h3>
<ol>
<li>controllare il fs ed eventualmente liberare spazio</li>
<li>testare con una touch se e&#8217; possibile aggiungere un file vuoto al filesystem</li>
<li>cancellare manulamente dal repository il file corrotto</li>
</ol>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ramarro.wordpress.com/12/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ramarro.wordpress.com/12/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ramarro.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ramarro.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ramarro.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ramarro.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ramarro.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ramarro.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ramarro.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ramarro.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ramarro.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ramarro.wordpress.com/12/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ramarro.wordpress.com&blog=1340588&post=12&subd=ramarro&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ramarro.wordpress.com/2007/11/20/cvs-hashc312-findnode-assertion-key-void-0-failed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a34507ee12a9c81fe699ee9dd7e756e8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ramarro</media:title>
		</media:content>
	</item>
		<item>
		<title>Fetchlog</title>
		<link>http://ramarro.wordpress.com/2007/09/25/fetchlog/</link>
		<comments>http://ramarro.wordpress.com/2007/09/25/fetchlog/#comments</comments>
		<pubDate>Tue, 25 Sep 2007 20:59:22 +0000</pubDate>
		<dc:creator>ramarro</dc:creator>
				<category><![CDATA[monitoring]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[log]]></category>

		<guid isPermaLink="false">http://ramarro.wordpress.com/2007/09/25/fetchlog/</guid>
		<description><![CDATA[Introduzione
Questa simpatica utility serve per tenere sotto controllo un qualsiasi log. Generalmente viene utilizzata per tenere sotto controllo il messages in modo semplice ed efficace.
Installazione
procuriamoci l&#8217;utility dal sito : http://fetchlog.sourceforge.net/
il formato e&#8217; il classico tar.gz  			fetchlog-1.0.tar.gz
perciò da utente digitiamo
$ tar xvfz fetchlog-1.0.tar.gz
$ cd  fetchlog-1.0
$ make
diventiamo root e digitiamo
# make install
Questo installerà il sw [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ramarro.wordpress.com&blog=1340588&post=8&subd=ramarro&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><h3>Introduzione</h3>
<p>Questa simpatica utility serve per tenere sotto controllo un qualsiasi log. Generalmente viene utilizzata per tenere sotto controllo il messages in modo semplice ed efficace.</p>
<h3>Installazione</h3>
<p>procuriamoci l&#8217;utility dal sito : <a title="fetchlog" href="http://fetchlog.sourceforge.net/" target="_blank">http://fetchlog.sourceforge.net/</a></p>
<p>il formato e&#8217; il classico tar.gz  			<a href="http://downloads.sourceforge.net/fetchlog/fetchlog-1.0.tar.gz?modtime=1080259200&amp;big_mirror=0">fetchlog-1.0.tar.gz</a></p>
<p>perciò da utente digitiamo</p>
<p>$ tar xvfz fetchlog-1.0.tar.gz</p>
<p>$ cd  fetchlog-1.0</p>
<p>$ make</p>
<p>diventiamo root e digitiamo</p>
<p># make install</p>
<p>Questo installerà il sw in INSTDIR/bin e la pagina di man in INSTDIR/man/man1.</p>
<p>Comunque è presente all&#8217;interno del pacchetto anche un file readme per l&#8217;integrazione con NAGIOS e SNMP.</p>
<h3>Utilizzo</h3>
<p>Vediamo come funziona:</p>
<p>fetchlog -F prima_colonna:ultima_colonna:lunghezza:conv logfile bookmarkfile [pattern ...]</p>
<p>fetchlog -f prima_colonna:ultima_colonna:lunghezza:conv logfile bookmarkfile [pattern ...]</p>
<p>Il programma una volta lanciato scorre il logfile indicato ed estrapola le righe che contengono la stringa di testo definita con pattern solo se compresa tra  prima_colonna e ultima_colonna; in output avremo una righa di tanti caratteri quanto indicati dalla condizione lunghezza.</p>
<p>il parametro -f indica che fetchlog utilizzarà un file bookmark che avrà nome e path indicato. Questo file serve come segnalibro: indica da quale punto ripartire alla prossima iterazione dell&#8217; utility.</p>
<p>il parametro -F indica di non usare il bookmark file</p>
<p>il parametro conv indica che tipo di convenzone usare per il pattern-matching di solito si utilizza s di shell, per ulteriori approfondimenti rimando alla pagina del man.</p>
<p>un interessante utilizzo e&#8217; quello creare uno script schedulato a intervalli regolari nel cron che permette di ricercare particolari stringhe nel file messages (errori di applicazioni,problemi kernel etc) e se ne trova mandare una mail all&#8217;amministratore.</p>
<p>Il vantaggio di questa utility e&#8217; la possibilita&#8217; di usare piu&#8217; segnalibri per il medesimo file in modo da differenziare la stringa di ricerca.</p>
<h3>Esempi</h3>
<p>Piccola script che ho schedulato nel crontab di un sistema per controllare se vengono rivelati eventuali errori del raid o dei dischi scsi. Se la condizione e&#8217; verificata vengono inviate due mail per segnalare l&#8217;errore con lo stralcio del /var/log/messages relativo</p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:8pt;font-family:Arial,sans-serif;color:green;">#!/bin/sh</span><span style="font-size:8pt;font-family:Arial,sans-serif;"> </span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:8pt;font-family:Arial,sans-serif;color:green;"><span> </span>HOST=`/bin/cat /etc/hosts| /bin/grep \`echo $HOSTNAME\&#8220;</span><span style="font-size:8pt;font-family:Arial,sans-serif;"> </span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:8pt;font-family:Arial,sans-serif;color:green;"><span> </span>DATA=`/bin/date`<span> </span></span><span style="font-size:8pt;font-family:Arial,sans-serif;"> </span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:8pt;font-family:Arial,sans-serif;color:green;"><span> </span>SPAZI=&#8221;########################################################&#8221;</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:8pt;font-family:Arial,sans-serif;color:green;"><span> </span>FETCHLOG=&#8221;/usr/local/bin/fetchlog -F 1:100:200:s&#8221;</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:8pt;font-family:Arial,sans-serif;color:green;"><span> </span>TO=&#8221;tuo.indirizzo@dominio.it&#8221;</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:8pt;font-family:Arial,sans-serif;color:green;"><span> </span><span> </span>CC=&#8221;cc.indirizzo@dominio.it&#8221;</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:8pt;font-family:Arial,sans-serif;color:green;"><span> </span></span><span style="font-size:8pt;font-family:Arial,sans-serif;color:green;">MSGINT=&#8221;\n$SPAZI\n<span> </span>$DATA \n$SPAZI\n&#8221;</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:8pt;font-family:Arial,sans-serif;"><span> </span></span><span style="font-size:8pt;font-family:Arial,sans-serif;color:green;">#controllo errori megaraid</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:8pt;font-family:Arial,sans-serif;color:green;"><span> </span>MSG=`$FETCHLOG /var/log/messages /var/megaraid.sgn &#8216;kernel: megaraid: abort&#8217;`</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:8pt;font-family:Arial,sans-serif;color:green;"><span> </span>if [ $? -gt 0 ]; then</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:8pt;font-family:Arial,sans-serif;color:green;"><span> </span>echo -e &#8220;$SPAZI \nErrore Megaraid<span> </span>\n$SPAZI\n $MSGINT \n $MSG \n$SPAZI \n \n\n Nodo: $HOST<span> </span>&#8220;|/bin/mail -i -s &#8220;MEGARAID ERROR : $HOSTNAME&#8221; -c $CC $TO</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:8pt;font-family:Arial,sans-serif;color:green;"><span> </span>fi</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:8pt;font-family:Arial,sans-serif;color:lime;"><span> </span></span><span style="font-size:8pt;font-family:Arial,sans-serif;color:green;"># controllo errori scsi</span><span style="font-size:8pt;font-family:Arial,sans-serif;color:lime;"><br />
<span> </span></span><span style="font-size:8pt;font-family:Arial,sans-serif;color:green;">MSG=`$FETCHLOG /var/log/messages /var/scsioff.sgn &#8216;kernel: scsi: Device offlined&#8217;`</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:8pt;font-family:Arial,sans-serif;color:green;"><span> </span>if [ $? -gt 0 ]; then</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:8pt;font-family:Arial,sans-serif;color:green;"><span> </span>echo -e &#8220;$SPAZI \n ERRORE SCSI DEVICE MESSO IN OFFLINE\n$SPAZI\nNodo: $HOST \n$MSGINT \n $MSG \n$SPAZI &#8220;|/bin/mail -i -s &#8220;SCSI ERROR : $HOSTNAME&#8221; -c $CC $TO</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:8pt;font-family:Arial,sans-serif;color:green;"><span> </span></span><span style="font-size:8pt;font-family:Arial,sans-serif;color:green;">fi</span></p>
<p align="justify">
<p align="left">
<h3>Conclusioni</h3>
<p>Ho trovato questa utility molto utile per risolvere alcuni problemi che avevo nel gestire i log da remoto in maniera semplice pulita e senza dover utilizzare prodotti troppo pesanti</p>
<p>Fatemi sapere la vostra opinioe</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ramarro.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ramarro.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ramarro.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ramarro.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ramarro.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ramarro.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ramarro.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ramarro.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ramarro.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ramarro.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ramarro.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ramarro.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ramarro.wordpress.com&blog=1340588&post=8&subd=ramarro&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ramarro.wordpress.com/2007/09/25/fetchlog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a34507ee12a9c81fe699ee9dd7e756e8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ramarro</media:title>
		</media:content>
	</item>
	</channel>
</rss>