<?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>synchronisation | LogikDevelopment</title>
	<atom:link href="https://www.logikdev.com/tag/synchronisation/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.logikdev.com</link>
	<description>&#34;Il n&#039;y a pas de problème, il n&#039;y a que des solutions. L&#039;esprit de l&#039;homme invente ensuite le problème.&#34; André Gide</description>
	<lastBuildDate>Tue, 25 Apr 2017 13:57:14 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.4</generator>
	<item>
		<title>Monitor s3sync with Zabbix</title>
		<link>https://www.logikdev.com/2011/11/24/monitor-s3sync-with-zabbix/</link>
					<comments>https://www.logikdev.com/2011/11/24/monitor-s3sync-with-zabbix/#respond</comments>
		
		<dc:creator><![CDATA[smoreau]]></dc:creator>
		<pubDate>Thu, 24 Nov 2011 22:28:53 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Amazon S3]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[s3sync]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[synchronisation]]></category>
		<category><![CDATA[Zabbix]]></category>
		<guid isPermaLink="false">https://www.logikdev.com/?p=1566</guid>

					<description><![CDATA[<p>s3sync is a ruby program that easily transfers directories between a local directory and an S3 bucket:prefix. It behaves somewhat, but not precisely, like the rsync program. I am using this tool to automatically backup the important data from Debian servers to Amazon S3. I am not going to explain here how to install s3sync [&#8230;]</p>
<p>The post <a href="https://www.logikdev.com/2011/11/24/monitor-s3sync-with-zabbix/">Monitor s3sync with Zabbix</a> first appeared on <a href="https://www.logikdev.com">LogikDevelopment</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><a href="https://forums.aws.amazon.com/thread.jspa?threadID=11975&#038;start=0&#038;tstart=0" target="_blank"><strong>s3sync</strong></a> is a ruby program that easily transfers directories between a local directory and an S3 bucket:prefix. It behaves somewhat, but not precisely, like the <strong>rsync</strong> program.</p>
<p>I am using this tool to automatically backup the important data from Debian servers to Amazon S3. I am not going to explain here how to install s3sync as it is not the purpose of this article. However, you can read this very useful article from John Eberly&#8217;s blog: <a href="http://blog.eberly.org/2006/10/09/how-automate-your-backup-to-amazon-s3-using-s3sync/" target="_blank">How I automated my backups to Amazon S3 using s3sync</a>.</p>
<p>If you followed the steps from John Eberly&#8217;s post, you should have an <code>upload.sh</code> script and a crontab job which executes this script periodically.</p>
<p>From this point, here is what you need to do to monitor the success of the synchronisation with <a href="http://www.zabbix.com/" target="_blank"><strong>Zabbix</strong></a>:</p>
<ol>
<li>Add the following code at the end of your <code>upload.sh</code> script:
<pre class="brush: bash; title: ; notranslate">
# print the exit code
RETVAL=$?
&#x5B; $RETVAL -eq 0 ] &amp;&amp; echo &quot;Synchronization succeed&quot;
&#x5B; $RETVAL -ne 0 ] &amp;&amp; echo &quot;Synchronization failed&quot;
</pre>
</li>
<li>Log the output of the cron script as follow:
<pre class="brush: bash; light: true; title: ; notranslate">
30 2 * * sun /path/to/upload.sh &gt; /var/log/s3sync.log 2&gt;&amp;1
</pre>
</li>
<li>On Zabbix, create a new item which will check the existence of the sentence &#8220;Synchronization failed&#8221; in the file <code>/var/log/s3sync.log</code>:<br />
<a href="https://www.logikdev.com/wp-content/uploads/2011/11/zabbix_s3sync_item.png"><img fetchpriority="high" decoding="async" src="https://www.logikdev.com/wp-content/uploads/2011/11/zabbix_s3sync_item-297x300.png" alt="" title="Create a new item on Zabbix to monitor s3sync" width="297" height="300" class="aligncenter size-medium wp-image-1569" srcset="https://www.logikdev.com/wp-content/uploads/2011/11/zabbix_s3sync_item-297x300.png 297w, https://www.logikdev.com/wp-content/uploads/2011/11/zabbix_s3sync_item.png 641w" sizes="(max-width: 297px) 100vw, 297px" /></a><br />
Item key: <code>vfs.file.regmatch[/var/log/s3sync.log,Synchronization failed]</code><br />

</li>
<li>Still on Zabbix, define a new trigger for the previously created item:<br />
<a href="https://www.logikdev.com/wp-content/uploads/2011/11/zabbix_s3sync_trigger.png"><img decoding="async" src="https://www.logikdev.com/wp-content/uploads/2011/11/zabbix_s3sync_trigger-300x160.png" alt="" title="Define a new trigger on Zabbix to monitor s3sync" width="300" height="160" class="aligncenter size-medium wp-image-1570" srcset="https://www.logikdev.com/wp-content/uploads/2011/11/zabbix_s3sync_trigger-300x160.png 300w, https://www.logikdev.com/wp-content/uploads/2011/11/zabbix_s3sync_trigger.png 665w" sizes="(max-width: 300px) 100vw, 300px" /></a><br />
Trigger expression: <code>{Template_AmazonCloud_Debian:vfs.file.regmatch[/var/log/s3sync.log,Synchronization failed].last(0)}=1</code>
</li>
</ol>
<p>With these few steps, you should now receive Zabbix alerts when a backup on S3 fails. 🙂</p><p>The post <a href="https://www.logikdev.com/2011/11/24/monitor-s3sync-with-zabbix/">Monitor s3sync with Zabbix</a> first appeared on <a href="https://www.logikdev.com">LogikDevelopment</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.logikdev.com/2011/11/24/monitor-s3sync-with-zabbix/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
