<?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>Linux 360° &#124; Italia &#187; debian</title>
	<atom:link href="http://www.linux360.it/tag/debian/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.linux360.it</link>
	<description>Notizie, guide e tutorial per il mondo Linux a 360°</description>
	<lastBuildDate>Tue, 16 Dec 2014 14:03:33 +0000</lastBuildDate>
	<language>it-IT</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=3.9.40</generator>
	<item>
		<title>MySQL Master-Master Replication</title>
		<link>http://www.linux360.it/2014/07/28/mysql-master-master-replication/</link>
		<comments>http://www.linux360.it/2014/07/28/mysql-master-master-replication/#comments</comments>
		<pubDate>Mon, 28 Jul 2014 15:17:41 +0000</pubDate>
		<dc:creator><![CDATA[Paolo Daniele]]></dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[Programmazione]]></category>
		<category><![CDATA[Varie]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[master]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[replication]]></category>

		<guid isPermaLink="false">http://www.paolodaniele.it/?p=1941</guid>
		<description><![CDATA[<p>Oggi voglio pubblicare un qualcosa di interessante che mi è capitato per lavoro. Ipotizziamo di avere 2 database MySQL in due zone geograficamente distanti tra loro. Questi database devono essere consistenti, cioè contenere sempre gli stessi dati, così nel caso di perdita di connessione o di blocco del database 1 tutte le connessioni verranno indirizzate ...</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/07/28/mysql-master-master-replication/">MySQL Master-Master Replication</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Oggi voglio pubblicare un qualcosa di interessante che mi è capitato per lavoro.</p>
<p>Ipotizziamo di avere 2 database MySQL in due zone geograficamente distanti tra loro.</p>
<p>Questi database devono essere consistenti, cioè contenere sempre gli stessi dati, così nel caso di perdita di connessione o di blocco del database 1 tutte le connessioni verranno indirizzate sul database 2 e viceversa.</p>
<p>Vi spiego meglio con una figura:</p>
<p><img class="alignnone  wp-image-1943" src="http://www.paolodaniele.it/wp-content/uploads/2014/07/mysql-active-active.jpg" alt="mysql-active-active" width="576" height="312" /></p>
<p>Abbiamo capito il problema, adesso vediamo come affrontarlo e trovare la soluzione.</p>
<p>In rete ho trovato molte &#8220;strade&#8221; più o meno simili, non è detto che la mia sia giusta, ma so che funziona perchè l&#8217;ho provata praticamente!</p>
<p>La soluzione che vi propongo è stata testata con mysql-server 5.5.37 su Debian 7.1 Wheezy a 64bit</p>
<p>Per prima cosa dobbiamo abilitare su entrambi i database il <strong>BINARY LOGGING </strong>che è un vero e proprio log delle operazioni che vengono effettuate su ogni database.</p>
<p>Modifichiamo il file di configurazione <em><strong>my.cnf</strong></em> come segue:</p>
<p>Database <span style="color: #ff0000;"><strong>MASTER-1</strong></span></p>
<div id="wpshdo_1" class="wp-synhighlighter-outer"><div id="wpshdt_1" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_1"></a><a id="wpshat_1" class="wp-synhighlighter-title" href="#codesyntax_1"  onClick="javascript:wpsh_toggleBlock(1)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_1" onClick="javascript:wpsh_code(1)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_1" onClick="javascript:wpsh_print(1)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_1" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">server_id           = <span class="nu0">1</span>
log_bin             = <span class="sy0">/</span>var<span class="sy0">/</span>log<span class="sy0">/</span>mysql<span class="sy0">/</span>mysql-bin.log
log_bin_index       = <span class="sy0">/</span>var<span class="sy0">/</span>log<span class="sy0">/</span>mysql<span class="sy0">/</span>mysql-bin.log.index
relay_log           = <span class="sy0">/</span>var<span class="sy0">/</span>log<span class="sy0">/</span>mysql<span class="sy0">/</span>mysql-relay-bin
relay_log_index     = <span class="sy0">/</span>var<span class="sy0">/</span>log<span class="sy0">/</span>mysql<span class="sy0">/</span>mysql-relay-bin.index
expire_logs_days    = <span class="nu0">10</span>
max_binlog_size     = 100M
log_slave_updates   = <span class="nu0">1</span>
auto-increment-increment = <span class="nu0">2</span>
auto-increment-offset = <span class="nu0">1</span>
binlog_do_db        = sharedb</pre></div></div>
<p>Database <strong>MASTER-2</strong></p>
<div id="wpshdo_2" class="wp-synhighlighter-outer"><div id="wpshdt_2" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_2"></a><a id="wpshat_2" class="wp-synhighlighter-title" href="#codesyntax_2"  onClick="javascript:wpsh_toggleBlock(2)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_2" onClick="javascript:wpsh_code(2)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_2" onClick="javascript:wpsh_print(2)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_2" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">server_id           = <span class="nu0">2</span>
log_bin             = <span class="sy0">/</span>var<span class="sy0">/</span>log<span class="sy0">/</span>mysql<span class="sy0">/</span>mysql-bin.log
log_bin_index       = <span class="sy0">/</span>var<span class="sy0">/</span>log<span class="sy0">/</span>mysql<span class="sy0">/</span>mysql-bin.log.index
relay_log           = <span class="sy0">/</span>var<span class="sy0">/</span>log<span class="sy0">/</span>mysql<span class="sy0">/</span>mysql-relay-bin
relay_log_index     = <span class="sy0">/</span>var<span class="sy0">/</span>log<span class="sy0">/</span>mysql<span class="sy0">/</span>mysql-relay-bin.index
expire_logs_days    = <span class="nu0">10</span>
max_binlog_size     = 100M
log_slave_updates   = <span class="nu0">1</span>
auto-increment-increment = <span class="nu0">2</span>
auto-increment-offset = <span class="nu0">2</span>
binlog_do_db        = sharedb</pre></div></div>
<p>E&#8217; molto importante definire il parametro <em><strong>auto-increment-offset</strong></em> diverso tra i due database, questo serve per evitare che ci siano conflitti di indici nelle fasi di replicazione.</p>
<p>Prima di riavviare il servizio, procediamo con la creazione/import del database sharedb su entrambi i server (ATTENZIONE consiglio che i databasesiano uguali in questa fase)</p>
<p>Sempre su entrambi i server, da console:</p>
<div id="wpshdo_3" class="wp-synhighlighter-outer"><div id="wpshdt_3" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_3"></a><a id="wpshat_3" class="wp-synhighlighter-title" href="#codesyntax_3"  onClick="javascript:wpsh_toggleBlock(3)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_3" onClick="javascript:wpsh_code(3)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_3" onClick="javascript:wpsh_print(3)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_3" class="wp-synhighlighter-inner" style="display: block;"><pre class="sql" style="font-family:monospace;"><span class="kw1">CREATE</span> user <span class="st0">'replicante'</span>@<span class="st0">'%'</span> <span class="kw1">IDENTIFIED</span> <span class="kw1">BY</span> <span class="st0">'Wp4Suppl1c4nt462!'</span>;
<span class="kw1">GRANT</span> replication slave <span class="kw1">ON</span> <span class="sy0">*.*</span> <span class="kw1">TO</span> <span class="st0">'replicante'</span>@<span class="st0">'%'</span>;</pre></div></div>
<p>Riavviamo il servizio su entrambi i server.</p>
<p>&nbsp;</p>
<p>Operiamo adesso sul server <span style="color: #ff0000;"><strong>MASTER-1</strong></span></p>
<div id="wpshdo_4" class="wp-synhighlighter-outer"><div id="wpshdt_4" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_4"></a><a id="wpshat_4" class="wp-synhighlighter-title" href="#codesyntax_4"  onClick="javascript:wpsh_toggleBlock(4)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_4" onClick="javascript:wpsh_code(4)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_4" onClick="javascript:wpsh_print(4)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_4" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">mysql <span class="re5">-u</span> root - p</pre></div></div>
<div id="wpshdo_5" class="wp-synhighlighter-outer"><div id="wpshdt_5" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_5"></a><a id="wpshat_5" class="wp-synhighlighter-title" href="#codesyntax_5"  onClick="javascript:wpsh_toggleBlock(5)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_5" onClick="javascript:wpsh_code(5)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_5" onClick="javascript:wpsh_print(5)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_5" class="wp-synhighlighter-inner" style="display: block;"><pre class="sql" style="font-family:monospace;"><span class="kw1">SHOW</span> master <span class="kw1">STATUS</span>;</pre></div></div>
<p>Appare una cosa del genere:</p>
<p>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br />
| File                              | Position | Binlog_Do_DB | Binlog_Ignore_DB |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br />
| mysql-bin.000001 |      106     |   sharedb               |                                       |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+</p>
<p>Passiamo su <strong>MASTER-2</strong></p>
<p>Da console sql:</p>
<div id="wpshdo_6" class="wp-synhighlighter-outer"><div id="wpshdt_6" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_6"></a><a id="wpshat_6" class="wp-synhighlighter-title" href="#codesyntax_6"  onClick="javascript:wpsh_toggleBlock(6)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_6" onClick="javascript:wpsh_code(6)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_6" onClick="javascript:wpsh_print(6)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_6" class="wp-synhighlighter-inner" style="display: block;"><pre class="sql" style="font-family:monospace;">slave stop;
<span class="kw1">CHANGE</span> MASTER <span class="kw1">TO</span> MASTER_HOST <span class="sy0">=</span> <span class="st0">'IP-MASTER-1'</span><span class="sy0">,</span> MASTER_USER <span class="sy0">=</span> <span class="st0">'replicante'</span><span class="sy0">,</span> MASTER_PASSWORD <span class="sy0">=</span> <span class="st0">'Wp4Suppl1c4nt462!'</span><span class="sy0">,</span> MASTER_LOG_FILE <span class="sy0">=</span> <span class="st0">'mysql-bin.000001'</span><span class="sy0">,</span> MASTER_LOG_POS <span class="sy0">=</span> <span class="nu0">106</span>;
slave start;
<span class="kw1">SHOW</span> master <span class="kw1">STATUS</span>;</pre></div></div>
<p>Apparirà quealcosa del genere:</p>
<p>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br />
| File                              | Position | Binlog_Do_DB | Binlog_Ignore_DB |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br />
| mysql-bin.000002 |     1060   |   sharedb              |                                       |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+</p>
<p>Torniamo su <span style="color: #ff0000;"><strong>MASTER-1</strong></span></p>
<p>Da console sql:</p>
<div id="wpshdo_7" class="wp-synhighlighter-outer"><div id="wpshdt_7" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_7"></a><a id="wpshat_7" class="wp-synhighlighter-title" href="#codesyntax_7"  onClick="javascript:wpsh_toggleBlock(7)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_7" onClick="javascript:wpsh_code(7)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_7" onClick="javascript:wpsh_print(7)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_7" class="wp-synhighlighter-inner" style="display: block;"><pre class="sql" style="font-family:monospace;">slave stop;
<span class="kw1">CHANGE</span> MASTER <span class="kw1">TO</span> MASTER_HOST <span class="sy0">=</span> <span class="st0">'IP-MASTER-2'</span><span class="sy0">,</span> MASTER_USER <span class="sy0">=</span> <span class="st0">'replicante'</span><span class="sy0">,</span> MASTER_PASSWORD <span class="sy0">=</span> <span class="st0">'Wp4Suppl1c4nt462!'</span><span class="sy0">,</span> MASTER_LOG_FILE <span class="sy0">=</span> <span class="st0">'mysql-bin.000002'</span><span class="sy0">,</span> MASTER_LOG_POS <span class="sy0">=</span> <span class="nu0">1060</span>;
slave start;</pre></div></div>
<p>Il gioco è fatto!</p>
<p>Proviamo a fare un update su uno dei due master e vedremo la replica in tempo (quasi reale!) sull&#8217;altro!</p>
<p>Per essere sicuri, da uno dei due server sempre da console fate un:</p>
<div id="wpshdo_8" class="wp-synhighlighter-outer"><div id="wpshdt_8" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_8"></a><a id="wpshat_8" class="wp-synhighlighter-title" href="#codesyntax_8"  onClick="javascript:wpsh_toggleBlock(8)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_8" onClick="javascript:wpsh_code(8)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_8" onClick="javascript:wpsh_print(8)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_8" class="wp-synhighlighter-inner" style="display: block;"><pre class="sql" style="font-family:monospace;"><span class="kw1">SHOW</span> slave <span class="kw1">STATUS</span>;</pre></div></div>
<p>dovreste ottenere un qualcosa del genere:</p>
<p>&#8230;&#8230;&#8230;.Waiting for master to send event | IP-MASTER &#8230;&#8230;&#8230;&#8230;.</p>
<p>Enjoy!</p>
<p>&nbsp;</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/07/28/mysql-master-master-replication/">MySQL Master-Master Replication</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux360.it/2014/07/28/mysql-master-master-replication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Howto Installare Observium Network Monitoring Tool</title>
		<link>http://www.linux360.it/2014/07/22/howto-installare-observium-network-monitoring-tool/</link>
		<comments>http://www.linux360.it/2014/07/22/howto-installare-observium-network-monitoring-tool/#comments</comments>
		<pubDate>Tue, 22 Jul 2014 13:56:21 +0000</pubDate>
		<dc:creator><![CDATA[Paolo Daniele]]></dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Wireless & Networking]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[monitor]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[observium]]></category>
		<category><![CDATA[snmp]]></category>

		<guid isPermaLink="false">http://www.paolodaniele.it/?p=1932</guid>
		<description><![CDATA[<p>Oggi vi propongo un qualcosa di un po&#8217; più avanzato! Andremo ad installare Observium, un sistema di monitoraggio di rete Open Source. Questo tipo di sistema permette di racchiudere in un unica interfaccia, il monitoraggio di più dispositivi di rete utilizzando il protocollo standard SNMP. Pur essendo uno standard in realtà ci sono diverse varianti ...</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/07/22/howto-installare-observium-network-monitoring-tool/">Howto Installare Observium Network Monitoring Tool</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Oggi vi propongo un qualcosa di un po&#8217; più avanzato!</p>
<p>Andremo ad installare Observium, un sistema di monitoraggio di rete Open Source.</p>
<p><a href="http://www.paolodaniele.it/wp-content/uploads/2014/07/observium-125.png"><img class="alignnone size-full wp-image-1934" src="http://www.paolodaniele.it/wp-content/uploads/2014/07/observium-125.png" alt="observium-125" width="700" height="466" /></a></p>
<p>Questo tipo di sistema permette di racchiudere in un unica interfaccia, il monitoraggio di più dispositivi di rete utilizzando il protocollo standard SNMP.</p>
<p>Pur essendo uno standard in realtà ci sono diverse varianti a seconda del Vendor (Cisco, Mikrotik, Juniper etc.) la maggior parte delle quali sono già integrate dentro il sistema principale.</p>
<p>Per quello che non è integrato, con un po&#8217; di modifiche e un po&#8217; di lavoro sul codice sorgente è possibile implementare SNMP di altri Vendor.</p>
<p>Observium è sviluppato principalmente per sistemi Debian/Ubuntu ma è compatibile anche per altre piattaforme (CentOS, Rhel etc.) ma per queste non viene garantito il supporto.</p>
<p>Vediamo come installare:</p>
<p><strong>REQUISITI FONDAMENTALI</strong></p>
<ul>
<li>Apache</li>
<li>fping</li>
<li>MySQL 5</li>
<li>Net-SNMP 5.4+</li>
<li>RRDtool 1.3+</li>
<li>Graphviz</li>
<li>PHP 5.4+</li>
</ul>
<p>Per le funzionalità aggiuntive:</p>
<ul>
<li>Ipmitool</li>
<li>Libvirt-bin</li>
</ul>
<div id="wpshdo_9" class="wp-synhighlighter-outer"><div id="wpshdt_9" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_9"></a><a id="wpshat_9" class="wp-synhighlighter-title" href="#codesyntax_9"  onClick="javascript:wpsh_toggleBlock(9)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_9" onClick="javascript:wpsh_code(9)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_9" onClick="javascript:wpsh_print(9)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_9" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">apt-get</span> <span class="kw2">install</span> libapache2-mod-php5 php5-cli php5-mysql php5-gd php5-snmp php-pear snmp graphviz php5-mcrypt php5-json 
subversion mysql-server mysql-client rrdtool fping imagemagick whois mtr-tiny <span class="kw2">nmap</span> ipmitool python-mysqldb</pre></div></div>
<p>Per le Libvirt:</p>
<div id="wpshdo_10" class="wp-synhighlighter-outer"><div id="wpshdt_10" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_10"></a><a id="wpshat_10" class="wp-synhighlighter-title" href="#codesyntax_10"  onClick="javascript:wpsh_toggleBlock(10)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_10" onClick="javascript:wpsh_code(10)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_10" onClick="javascript:wpsh_print(10)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_10" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">apt-get</span> <span class="kw2">install</span> libvirt-bin</pre></div></div>
<p><strong>INSTALLAZIONE OBSERVIUM</strong></p>
<p>Creiamo la directory di installazione:</p>
<div id="wpshdo_11" class="wp-synhighlighter-outer"><div id="wpshdt_11" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_11"></a><a id="wpshat_11" class="wp-synhighlighter-title" href="#codesyntax_11"  onClick="javascript:wpsh_toggleBlock(11)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_11" onClick="javascript:wpsh_code(11)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_11" onClick="javascript:wpsh_print(11)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_11" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">mkdir</span> <span class="re5">-p</span> <span class="sy0">/</span>opt<span class="sy0">/</span>observium <span class="sy0">&amp;&amp;</span> <span class="kw3">cd</span> <span class="sy0">/</span>opt</pre></div></div>
<p>Le nuove versioni di Observium si dividono tra la Community Edition e la versione con Sottoscrizione. Per chi vuole solo la Community Edition:</p>
<div id="wpshdo_12" class="wp-synhighlighter-outer"><div id="wpshdt_12" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_12"></a><a id="wpshat_12" class="wp-synhighlighter-title" href="#codesyntax_12"  onClick="javascript:wpsh_toggleBlock(12)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_12" onClick="javascript:wpsh_code(12)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_12" onClick="javascript:wpsh_print(12)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_12" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">wget</span> http:<span class="sy0">//</span>www.observium.org<span class="sy0">/</span>observium-community-latest.tar.gz
<span class="kw2">tar</span> zxvf observium-community-latest.tar.gz</pre></div></div></pre>
<p>Per la revisione NOT-STABLE:</p>
<pre><div id="wpshdo_13" class="wp-synhighlighter-outer"><div id="wpshdt_13" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_13"></a><a id="wpshat_13" class="wp-synhighlighter-title" href="#codesyntax_13"  onClick="javascript:wpsh_toggleBlock(13)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_13" onClick="javascript:wpsh_code(13)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_13" onClick="javascript:wpsh_print(13)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_13" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">svn</span> <span class="kw2">co</span> http:<span class="sy0">//</span>svn.observium.org<span class="sy0">/</span>svn<span class="sy0">/</span>observium<span class="sy0">/</span>trunk observium</pre></div></div></pre>
<p>Per la revisione STABLE:</p>
<pre><div id="wpshdo_14" class="wp-synhighlighter-outer"><div id="wpshdt_14" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_14"></a><a id="wpshat_14" class="wp-synhighlighter-title" href="#codesyntax_14"  onClick="javascript:wpsh_toggleBlock(14)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_14" onClick="javascript:wpsh_code(14)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_14" onClick="javascript:wpsh_print(14)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_14" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">svn</span> <span class="kw2">co</span> http:<span class="sy0">//</span>svn.observium.org<span class="sy0">/</span>svn<span class="sy0">/</span>observium<span class="sy0">/</span>branches<span class="sy0">/</span>stable observium</pre></div></div>
<p><strong>CONFIGURAZIONE OBSERVIUM</strong></p>
<div id="wpshdo_15" class="wp-synhighlighter-outer"><div id="wpshdt_15" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_15"></a><a id="wpshat_15" class="wp-synhighlighter-title" href="#codesyntax_15"  onClick="javascript:wpsh_toggleBlock(15)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_15" onClick="javascript:wpsh_code(15)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_15" onClick="javascript:wpsh_print(15)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_15" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">cp</span> config.php.default config.php</pre></div></div>
<p>Creiamo il Database che conterrà le informazioni del monitoraggio:</p>
<div id="wpshdo_16" class="wp-synhighlighter-outer"><div id="wpshdt_16" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_16"></a><a id="wpshat_16" class="wp-synhighlighter-title" href="#codesyntax_16"  onClick="javascript:wpsh_toggleBlock(16)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_16" onClick="javascript:wpsh_code(16)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_16" onClick="javascript:wpsh_print(16)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_16" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">mysql <span class="re5">-u</span> root <span class="re5">-p</span>
&nbsp;
mysql<span class="sy0">&gt;</span> CREATE DATABASE observium;
mysql<span class="sy0">&gt;</span> GRANT ALL PRIVILEGES ON observium.<span class="sy0">*</span> TO <span class="st_h">'observium'</span><span class="sy0">@</span><span class="st_h">'localhost'</span>
    -<span class="sy0">&gt;</span> IDENTIFIED BY <span class="st_h">'&lt;observium db password&gt;'</span>;</pre></div></div>
<p>Una volta fatto questo editiamo i corrispondenti valori (nome database, utente e password) dentro il file config.php</p>
<p>Installiamo le tabelle di base di Observium:</p>
<div id="wpshdo_17" class="wp-synhighlighter-outer"><div id="wpshdt_17" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_17"></a><a id="wpshat_17" class="wp-synhighlighter-title" href="#codesyntax_17"  onClick="javascript:wpsh_toggleBlock(17)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_17" onClick="javascript:wpsh_code(17)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_17" onClick="javascript:wpsh_print(17)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_17" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">php includes<span class="sy0">/</span>update<span class="sy0">/</span>update.php</pre></div></div>
<p>La directory dei log la possiamo mettere in /var oppure possiamo direttamente specificare di scrivere i file di log nella /var</p>
<p><strong>IMPORTANTE</strong>:</p>
<p>Creare la directory per gli RRD e assegnare i permessi come segue per avere i grafici disegnati in maniera corretta:</p>
<div id="wpshdo_18" class="wp-synhighlighter-outer"><div id="wpshdt_18" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_18"></a><a id="wpshat_18" class="wp-synhighlighter-title" href="#codesyntax_18"  onClick="javascript:wpsh_toggleBlock(18)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_18" onClick="javascript:wpsh_code(18)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_18" onClick="javascript:wpsh_print(18)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_18" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">mkdir</span> rrd
<span class="kw2">chown</span> www-data:www-data rrd</pre></div></div>
<p>Configuriamo il Virtual Host di Apache, nel mio caso ho editato quello di default, ma se avete diversi siti è possibile creare un file separato:</p>
<div id="wpshdo_19" class="wp-synhighlighter-outer"><div id="wpshdt_19" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_19"></a><a id="wpshat_19" class="wp-synhighlighter-title" href="#codesyntax_19"  onClick="javascript:wpsh_toggleBlock(19)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_19" onClick="javascript:wpsh_code(19)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_19" onClick="javascript:wpsh_print(19)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_19" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="sy0">&lt;</span>VirtualHost <span class="sy0">*</span>:<span class="nu0">80</span><span class="sy0">&gt;</span>
       ServerAdmin webmaster<span class="sy0">@</span>localhost
       DocumentRoot <span class="sy0">/</span>opt<span class="sy0">/</span>observium<span class="sy0">/</span>html
       <span class="sy0">&lt;</span>Directory <span class="sy0">/&gt;</span>
               Options FollowSymLinks
               AllowOverride None
       <span class="sy0">&lt;/</span>Directory<span class="sy0">&gt;</span>
       <span class="sy0">&lt;</span>Directory <span class="sy0">/</span>opt<span class="sy0">/</span>observium<span class="sy0">/</span>html<span class="sy0">/&gt;</span>
               Options Indexes FollowSymLinks MultiViews
               AllowOverride All
               Order allow,deny
               allow from all
       <span class="sy0">&lt;/</span>Directory<span class="sy0">&gt;</span>
       ErrorLog  <span class="co1">${APACHE_LOG_DIR}</span><span class="sy0">/</span>error.log
       LogLevel warn
       CustomLog  <span class="co1">${APACHE_LOG_DIR}</span><span class="sy0">/</span>access.log combined
       ServerSignature On
<span class="sy0">&lt;/</span>VirtualHost<span class="sy0">&gt;</span></pre></div></div>
<p>Abilitiamo il modulo rewrite:</p>
<div id="wpshdo_20" class="wp-synhighlighter-outer"><div id="wpshdt_20" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_20"></a><a id="wpshat_20" class="wp-synhighlighter-title" href="#codesyntax_20"  onClick="javascript:wpsh_toggleBlock(20)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_20" onClick="javascript:wpsh_code(20)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_20" onClick="javascript:wpsh_print(20)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_20" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">a2enmod rewrite
service apache2 restart</pre></div></div>
<p>Abbiamo quasi finito!</p>
<p>Aggiungiamo un nuovo utente di livello 10, che sarà il nostro amministratore:</p>
<div id="wpshdo_21" class="wp-synhighlighter-outer"><div id="wpshdt_21" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_21"></a><a id="wpshat_21" class="wp-synhighlighter-title" href="#codesyntax_21"  onClick="javascript:wpsh_toggleBlock(21)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_21" onClick="javascript:wpsh_code(21)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_21" onClick="javascript:wpsh_print(21)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_21" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw3">cd</span> <span class="sy0">/</span>opt<span class="sy0">/</span>observium
.<span class="sy0">/</span>adduser.php admin admin_password <span class="nu0">10</span></pre></div></div>
<p>Aggiungiamo il primo dispositivo da monitorare:</p>
<div id="wpshdo_22" class="wp-synhighlighter-outer"><div id="wpshdt_22" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_22"></a><a id="wpshat_22" class="wp-synhighlighter-title" href="#codesyntax_22"  onClick="javascript:wpsh_toggleBlock(22)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_22" onClick="javascript:wpsh_code(22)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_22" onClick="javascript:wpsh_print(22)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_22" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">.<span class="sy0">/</span>add_device.php ip_oppure_hostname public v2c</pre></div></div>
<p>I parametri che ho usato:</p>
<ul>
<li>ip_oppure_hostname: Indirizzo IP o Hostname della macchina da monitorare;</li>
<li>public: il tipo di community SNMP ( se non siete pratici lasciate public);</li>
<li>v2c: la versione di SNMP utilizzata</li>
</ul>
<p>La versione 2c è quella compatibile con quasi tutti i dispositivi, mentre se volete usare autenticazione dovete usare la v3</p>
<p>Adesso popoliamo di dati il nostro Observium:</p>
<div id="wpshdo_23" class="wp-synhighlighter-outer"><div id="wpshdt_23" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_23"></a><a id="wpshat_23" class="wp-synhighlighter-title" href="#codesyntax_23"  onClick="javascript:wpsh_toggleBlock(23)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_23" onClick="javascript:wpsh_code(23)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_23" onClick="javascript:wpsh_print(23)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_23" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw3">cd</span> <span class="sy0">/</span>opt<span class="sy0">/</span>observium
.<span class="sy0">/</span>discovery.php <span class="re5">-h</span> all
.<span class="sy0">/</span>poller.php <span class="re5">-h</span> all</pre></div></div>
<p>Inseriamo queste opzioni sotto crontab cosichhè sia il sistema a lavorare per noi:</p>
<div id="wpshdo_24" class="wp-synhighlighter-outer"><div id="wpshdt_24" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_24"></a><a id="wpshat_24" class="wp-synhighlighter-title" href="#codesyntax_24"  onClick="javascript:wpsh_toggleBlock(24)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_24" onClick="javascript:wpsh_code(24)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_24" onClick="javascript:wpsh_print(24)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_24" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;">crontab <span class="re5">-e</span>
33  <span class="sy0">*/</span>6   <span class="sy0">*</span> <span class="sy0">*</span> <span class="sy0">*</span>   root    <span class="sy0">/</span>opt<span class="sy0">/</span>observium<span class="sy0">/</span>discovery.php <span class="re5">-h</span> all <span class="sy0">&gt;&gt;</span> <span class="sy0">/</span>dev<span class="sy0">/</span>null 2<span class="sy0">&gt;&amp;</span>1
<span class="sy0">*/</span>5 <span class="sy0">*</span>     <span class="sy0">*</span> <span class="sy0">*</span> <span class="sy0">*</span>   root    <span class="sy0">/</span>opt<span class="sy0">/</span>observium<span class="sy0">/</span>discovery.php <span class="re5">-h</span> new <span class="sy0">&gt;&gt;</span> <span class="sy0">/</span>dev<span class="sy0">/</span>null <span class="nu0">2</span><span class="sy0">&gt;&amp;</span><span class="nu0">1</span>
<span class="sy0">*/</span><span class="nu0">5</span> <span class="sy0">*</span>     <span class="sy0">*</span> <span class="sy0">*</span> <span class="sy0">*</span>   root    <span class="sy0">/</span>opt<span class="sy0">/</span>observium<span class="sy0">/</span>poller-wrapper.py <span class="nu0">1</span> <span class="sy0">&gt;&gt;</span> <span class="sy0">/</span>dev<span class="sy0">/</span>null <span class="nu0">2</span><span class="sy0">&gt;&amp;</span><span class="nu0">1</span></pre></div></div>
<p>Il gioco è fatto!</p>
<p>Andare all&#8217;indirizzo ip http://il_vostro_ip e avrete il vostro sistema di monitoraggio pronto!</p>
<p>Enjoy!</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/07/22/howto-installare-observium-network-monitoring-tool/">Howto Installare Observium Network Monitoring Tool</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux360.it/2014/07/22/howto-installare-observium-network-monitoring-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Asterisk CDR con SQLite3 e PHP</title>
		<link>http://www.linux360.it/2014/04/30/asterisk-cdr-con-sqlite3-e-php/</link>
		<comments>http://www.linux360.it/2014/04/30/asterisk-cdr-con-sqlite3-e-php/#comments</comments>
		<pubDate>Wed, 30 Apr 2014 10:24:36 +0000</pubDate>
		<dc:creator><![CDATA[Paolo Daniele]]></dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[Programmazione]]></category>
		<category><![CDATA[Varie]]></category>
		<category><![CDATA[asterisk]]></category>
		<category><![CDATA[cdr]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.paolodaniele.it/?p=1718</guid>
		<description><![CDATA[<p>Oggi vi propongo una guida interessante. Sempre sviluppata con l&#8217;amico Frank al quale vengono le idee&#8230;e io poi le realizzo! La base è quella di voler realizzare un sistema minimale di CDR (Call Detail Recording) ossia uno strumento che permette di visualizzare i dettagli delle chiamate sui centralini Asterisk. Il sistema classico utilizza MySQL e ...</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/04/30/asterisk-cdr-con-sqlite3-e-php/">Asterisk CDR con SQLite3 e PHP</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Oggi vi propongo una guida interessante.</p>
<p>Sempre sviluppata con l&#8217;amico <a href="http://www.ubuntuserver.it">Frank</a> al quale vengono le idee&#8230;e io poi le realizzo!</p>
<p>La base è quella di voler realizzare un sistema minimale di CDR (Call Detail Recording) ossia uno strumento che permette di visualizzare i dettagli delle chiamate sui centralini Asterisk.</p>
<p>Il sistema classico utilizza MySQL e si trova molto materiale in giro per la rete.</p>
<p>Oggi vi spiego come realizzarlo con SQLite, che è una versione minimal di SQL, da utilizzare su quei dispositivi dove non ci sono molte risorse (vedi centralino asterisk su Raspberry)</p>
<p><strong>Requisiti:</strong></p>
<p>- Asterisk</p>
<p>- Debian (o qualunque altro SO)</p>
<p>- SQLite</p>
<p>- Apache (o un qualunque Web Server)</p>
<p>- Php5 con supporto per SQLite3</p>
<p><strong>Installazione Requisiti:</strong></p>
<p>Per installare SQLite3:</p>
<div id="wpshdo_25" class="wp-synhighlighter-outer"><div id="wpshdt_25" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_25"></a><a id="wpshat_25" class="wp-synhighlighter-title" href="#codesyntax_25"  onClick="javascript:wpsh_toggleBlock(25)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_25" onClick="javascript:wpsh_code(25)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_25" onClick="javascript:wpsh_print(25)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_25" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">sudo</span> <span class="kw2">apt-get</span> <span class="kw2">install</span> libxml2-dev ncurses-dev libsqlite3-dev sqlite3</pre></div></div>
<p>Per installare Apache:</p>
<div id="wpshdo_26" class="wp-synhighlighter-outer"><div id="wpshdt_26" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_26"></a><a id="wpshat_26" class="wp-synhighlighter-title" href="#codesyntax_26"  onClick="javascript:wpsh_toggleBlock(26)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_26" onClick="javascript:wpsh_code(26)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_26" onClick="javascript:wpsh_print(26)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_26" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">sudo</span> <span class="kw2">apt-get</span> <span class="kw2">install</span> apache2</pre></div></div>
<p>Per installare PHP5-SQLite:</p>
<div id="wpshdo_27" class="wp-synhighlighter-outer"><div id="wpshdt_27" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_27"></a><a id="wpshat_27" class="wp-synhighlighter-title" href="#codesyntax_27"  onClick="javascript:wpsh_toggleBlock(27)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_27" onClick="javascript:wpsh_code(27)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_27" onClick="javascript:wpsh_print(27)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_27" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">sudo</span> <span class="kw2">apt-get</span> <span class="kw2">install</span> php5-sqlite3</pre></div></div>
<p>&nbsp;</p>
<p><strong>Procedimento:</strong></p>
<p>Per prima cosa è necessario che asterisk sia compilato con SQLite.</p>
<p>Per fare questo bisogna controllare che nella cartella dove sono installati i noduli di asterisk generalmente <em>/usr/lib/asterisk/modules</em> sia presente il file <strong>cdr_sqlite3_custom.so.</strong></p>
<p>Se non è installato è necessario ricompilare asterisk aggiungendo il modulo indicato sopra facendo:</p>
<div id="wpshdo_28" class="wp-synhighlighter-outer"><div id="wpshdt_28" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_28"></a><a id="wpshat_28" class="wp-synhighlighter-title" href="#codesyntax_28"  onClick="javascript:wpsh_toggleBlock(28)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_28" onClick="javascript:wpsh_code(28)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_28" onClick="javascript:wpsh_print(28)" title="Print code"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.linux360.it/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.linux360.it/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_28" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">make</span> menuselect</pre></div></div>
<p>(Non mi soffermo su questo perchè si trovano molte guide in giro)<br />
Fatto questo bisogna modificare il file <strong>cdr_sqlite3_custom.conf </strong>in <em>/etc/asterisk</em> come nel file in allegato.</p>
<p>Se è già installato SQLite e il <strong>master.db</strong> è già creato è necessario rimuoverlo per adattarlo alla mia conf.(se non volete basta modificare il file cdr_sqlite.php adattandolo alle vostre esigenze!)</p>
<p>Per verificare se il master.db è già creato bisogna vedere se nel percorso <em>/var/log/asterisk</em> è presente.</p>
<p>Una volta modificato il file cdt_sqlite3_custom.conf è necessario riavviare Asterisk (<em>sudo /etc/init.d/asterisk restart</em>)</p>
<p>Fatto questo basta scompattare i file che vi allego dentro una /var/www o comunque la directory principale del vostro web server.</p>
<p>Se tutto è ok potrete vedere i dettagli delle vostre chiamate digitando nel browser: http://localhost/cdr_sqlite.php</p>
<p>Enjoy!</p>
<p><a href="http://www.paolodaniele.it/wp-content/uploads/2014/04/cdr_sqlite.zip">Dowload Sorgenti</a></p>
<p>&nbsp;</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2014/04/30/asterisk-cdr-con-sqlite3-e-php/">Asterisk CDR con SQLite3 e PHP</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux360.it/2014/04/30/asterisk-cdr-con-sqlite3-e-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Howto Debian Raid Software</title>
		<link>http://www.linux360.it/2013/11/16/howto-debian-raid-software/</link>
		<comments>http://www.linux360.it/2013/11/16/howto-debian-raid-software/#comments</comments>
		<pubDate>Sat, 16 Nov 2013 10:07:31 +0000</pubDate>
		<dc:creator><![CDATA[Paolo Daniele]]></dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[kvm]]></category>
		<category><![CDATA[lvm]]></category>
		<category><![CDATA[raid]]></category>

		<guid isPermaLink="false">http://www.paolodaniele.it/?p=1672</guid>
		<description><![CDATA[<p>Videotutorial</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2013/11/16/howto-debian-raid-software/">Howto Debian Raid Software</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Videotutorial</p>

<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2013/11/16/howto-debian-raid-software/">Howto Debian Raid Software</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux360.it/2013/11/16/howto-debian-raid-software/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Postfix Admin update</title>
		<link>http://www.linux360.it/2013/06/25/postfix-admin-update/</link>
		<comments>http://www.linux360.it/2013/06/25/postfix-admin-update/#comments</comments>
		<pubDate>Tue, 25 Jun 2013 06:39:31 +0000</pubDate>
		<dc:creator><![CDATA[Paolo Daniele]]></dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[Programmazione]]></category>
		<category><![CDATA[Varie]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[imap]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[posta]]></category>
		<category><![CDATA[postifixadmin]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://www.paolodaniele.it/?p=1572</guid>
		<description><![CDATA[<p>A chi è del mestiere e lavora con server di posta sotto Linux, sicuramente utilizza Postfix Admin per la gestione degli account di posta elettronica! Sabato ho fatto l&#8217;update sui nostri server a TLCWEB ed è andato tutto ok&#8230;. Ieri apro una casella per modificarla e&#8230; magia! Spunta fuori un bel messaggio di errore: Invalid ...</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2013/06/25/postfix-admin-update/">Postfix Admin update</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>A chi è del mestiere e lavora con server di posta sotto Linux, sicuramente utilizza Postfix Admin per la gestione degli account di posta elettronica!</p>
<p>Sabato ho fatto l&#8217;update sui nostri server a <a href="http://www.tlcweb.com">TLCWEB</a> ed è andato tutto ok&#8230;.</p>
<p>Ieri apro una casella per modificarla e&#8230; magia! Spunta fuori un bel messaggio di errore:</p>
<p><em>Invalid query: Unknown column &#8216;local_part&#8217; in &#8216;field list&#8217;</em></p>
<p><em>Please check the documentation and website for more information.</em></p>
<p><em>Postfix Admin</em><br />
<em> Forums</em></p>
<p>Senza farsi prendere dal panico&#8230;</p>
<p>Basta aprire il file edit-mailbox.php, trovare la riga</p>
<blockquote><p>$formvars['local_part'] = $matches[1];</p></blockquote>
<p>E commentarla!</p>
<p>Il gioco è fatto&#8230;</p>
<p>Enjoy!</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2013/06/25/postfix-admin-update/">Postfix Admin update</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux360.it/2013/06/25/postfix-admin-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debian Raid Software</title>
		<link>http://www.linux360.it/2012/09/07/debian-raid-software/</link>
		<comments>http://www.linux360.it/2012/09/07/debian-raid-software/#comments</comments>
		<pubDate>Fri, 07 Sep 2012 13:25:25 +0000</pubDate>
		<dc:creator><![CDATA[Paolo Daniele]]></dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[kvm]]></category>
		<category><![CDATA[lvm]]></category>
		<category><![CDATA[raid]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.paolodaniele.it/?p=1442</guid>
		<description><![CDATA[<p>Un ringraziamento al mio amico Frank per il tutorial scritto, a breve posteremo il video realizzato da me con i passaggi a video! Visto che è una procedura che faccio spesso, volevo condividerla con voi eseguiamo il boot da cd, e proseguiamo con l’installazione fino a quando l’installer chiede di formattare i dischi, selezioniamo “manuale” ...</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2012/09/07/debian-raid-software/">Debian Raid Software</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Un ringraziamento al mio amico <a href="http://www.ubuntuserver.it/" target="_blank">Frank</a> per il tutorial scritto, a breve posteremo il video realizzato da me con i passaggi a video!</p>
<p>Visto che è una procedura che faccio spesso, volevo condividerla con voi <img src="http://www.ubuntuserver.it/wp-includes/images/smilies/icon_wink.gif" alt=";)" /> eseguiamo il boot da cd, e proseguiamo con l’installazione fino a quando l’installer chiede di formattare i dischi, selezioniamo “manuale” Decidiamo le dimensioni della partizione di root e dello swap, orientativamente 20GB in root sono sufficienti per un’installazione normale, mentre per lo swap come dimensione impostiamo il doppio della ram.<br />
create quindi le partizioni, settiamo il tipo della partizioni a linux raid autodetect , per le partizioni di root, impostiamo anche il flag di boot (di entrambi i dischi).<br />
avremo quindi una cosa di questo tipo…</p>
<p>$ fdisk -l</p>
<p>Disk /dev/sda: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 121601 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes<br />
Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000c67c1<br />
Device Boot      Start         End      Blocks   Id  System /dev/sda1               1         365     2931831   fd<br />
Linux raid autodetect /dev/sda2             366        2797    19535040   fd<br />
Linux raid autodetect Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 121601 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes<br />
Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00053d83<br />
Device Boot      Start         End      Blocks   Id  System /dev/sdb1               1         365     2931831   fd<br />
Linux raid autodetect /dev/sdb2             366        2797    19535040   fd<br />
Linux raid autodetect la 1° partizione è usata come swap (3GB) in alcuni casi ho notato che è meglio non metterla sotto raid la 2° partizione serve per il SO (20GB)<br />
P.S Ricordiamo che se utilizziamo i volumi LVM dobbiamo creare un volume /boot standalone (500MB circa) perche grub non gestisce il boot su volumi LVM<br />
proseguiamo con il programma di partizionamento guidato, creando due dischi RAID in modalita RAID1 seguendo lo schema..</p>
<p>md0 == sda1, sdb1 md1 == sda2, sdb2</p>
<p>a questo punto si completa l’installazione normalmente, ed abbiamo quasi finito, dobbiamo solo ricordarci che il programma che esegue l’installazione ha caricato il grub solo nel primo disco di boot, quindi dobbiamo installarlo anche sul secondo.</p>
<p>### Procedura con Grub v1 ### # $ grub grub&gt; device (hd0) /dev/sda grub&gt; root (hd0,1) grub&gt; setup (hd0) grub&gt; device (hd0) /dev/sdb grub&gt; root (hd0,1) grub&gt; setup (hd0) grub&gt; quit</p>
<p>### Procedura con Grub v2 ### $ grub-install /dev/sda $ grub-install /dev/sdb</p>
<p>Stato RAID: è sempre utile vedere come è fatto  $ mdadm –query –detail /dev/md1 /dev/md1: Version : 0.90 Creation Time : Sat Jun  6 00:15:19 2009 Raid Level : raid1 Array Size : 2931712 (2.80 GiB 3.00 GB) Used Dev Size : 2931712 (2.80 GiB 3.00 GB) Raid Devices : 2 Total Devices : 2 Preferred Minor : 0 Persistence : Superblock is persistent Update Time : Tue Mar 13 22:17:08 2012 State : clean Active Devices : 2 Working Devices : 2 Failed Devices : 0 Spare Devices : 0 UUID : ad249657:82bbcbcd:44c8d3cc:c7bddde2 Events : 0.130 Number   Major   Minor   RaidDevice State 0       8        1        0      active sync   /dev/sda2 1       8       17        1      active sync   /dev/sdb2</p>
<p>Controlliamo lo stato del Raid:  $ cat /proc/mdstat Personalities : [raid1] md3 : active raid1 sda4[0] sdb4[1] 878899968 blocks [2/2] [UU] md2 : active raid1 sda3[0] sdb3[1] 75392960 blocks [2/2] [UU] md1 : active raid1 sda2[0] sdb2[1] 19534976 blocks [2/2] [UU] md0 : active raid1 sda1[0] sdb1[1] 2931712 blocks [2/2] [UU] unused devices: &lt;none&gt;</p>
<p>Sostituzione disco guasto: qualora un disco si rompa, questo deve essere sostituito il prima possibile, magari sfruttando l’hot-swap hardware (come sata). In ogni caso la prima operazione da fare è rimuovere logicamente il disco, togliendolo dal raid con i comadi: Prima di tutto idetifichiamo quale Disco è rotto dai log o dalla query che abbiamo fatto prima:</p>
<p>$ dmesg raid1: Disk failure on sda2, disabling device. raid1: Operation continuing on 1 devices.</p>
<p>Rimuoviamo il disco dal Raid:  $ /sbin/mdadm –assemble –scan $ mdadm /dev/md0 –fail /dev/sda2</p>
<p>$ mdadm –manage /dev/md0 –fail /dev/sda2 $ mdadm /dev/md0 –remove /dev/sda2</p>
<p>Identifichiamo il Disco dal Seriale: $ apt-get install smartmontools $ smartctl -i /dev/sda | grep Serial $ smartctl -i /dev/sdb | grep Serial</p>
<p>Spegniamo la macchina e a questo punto si sostituisce fisicamente il disco e si ricreano le partizioni, facendo attenzione alle dimensioni. è anche possibile copiare la tabella delle partizioni da un’ altro disco:  $ sfdisk -d /dev/sda | sfdisk –force /dev/sdb</p>
<p>se invece vogliamo farlo con DD: $ dd if=/dev/sda of=/tmp/part.bak bs=512 count=1 (Backup) $ #dd if=/tmp/part.bak of=/dev/sdb bs=1 count=64 skip=446 seek=446 (Restore)</p>
<p>Se la tabella delle partizioni non è la classica msdos ma GPT (GUID Partition Table) possiamo copiarla cosi $ parted /dev/sda</p>
<p>GNU Parted 1.9.0 Using /dev/sda Welcome to GNU Parted! Type ‘help’ to view a list of commands. (parted) p Error: /dev/sda: unrecognised disk label (parted) mklabel gpt (parted) mkpart primary ext2 0 10M (parted) mkpart primary ext4 10M 100% (parted) set 1 bios_grub on (parted) p Model: ATA QEMU HARDDISK (scsi) Disk /dev/sda: 1074MB Sector size (logical/physical): 512B/512B Partition Table: gpt  $ sgdisk -R /dev/sdb /dev/sda (Questo comando fa la stessa cosa si sfdisk ma su pt gpt)</p>
<p>attenzione: è possibile che richieda un reboot per vedere correttamente le partizioni. infine si aggiungono le partizioni nei volumi raid: $ mdadm –add /dev/md1 /dev/sda2 $ mdadm –manage /dev/md1 –add /dev/sda2</p>
<p>Creazione nuovi volumi RAID: con fdisk si aggiungono le nuove partizioni poi si crea un nuovo raid: $ mdadm –create –verbose /dev/md3 –level=1 –raid-devices=2 /dev/sda3 /dev/sdb3</p>
<p>Se abbiamo un disco che faceva parte di un raid e vogliamo rimuovere la configurazione rimasta sul disco, basta eseguire i seguenti comandi: $ mdadm –zero-superblock /dev/sdb1 $ mdadm –zero-superblock /dev/sdb2 $ mdadm –zero-superblock /dev/sdb3</p>
<p>un’altra simpatica utility che potrebbe tornare utile è hddtemp, questa software può tenere sotto controllo la temperatura dei dischi ed avvisarvi in caso di valori molto alti, e utile in ambienti dove il RAID è funzione 24/7.</p>
<p>$ apt-get install hddtemp $ hddtemp /dev/sda dev/sda: SAMSUNG HD300LD: 38 °C $ hddtemp /dev/sdb dev/sdb: SAMSUNG HD300LD: 44 °C</p>
<p>L'articolo <a rel="nofollow" href="http://www.linux360.it/2012/09/07/debian-raid-software/">Debian Raid Software</a> sembra essere il primo su <a rel="nofollow" href="http://www.linux360.it">Linux 360° | Italia</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux360.it/2012/09/07/debian-raid-software/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
