<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2742224415984805331</id><updated>2024-10-09T04:31:20.220+02:00</updated><category term="security"/><category term="monitoring"/><category term="syslog"/><category term="trendmicro"/><title type='text'>Barbich</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://barbich.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2742224415984805331/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://barbich.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>7</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2742224415984805331.post-7833787637568533966</id><published>2012-07-03T14:19:00.003+02:00</published><updated>2012-07-03T14:20:44.252+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="security"/><title type='text'>Cryptlib</title><content type='html'>If you are playing around with certificates and other encryption tools such as Openssl or GNUTLS you may want to have a look at &lt;a href=&quot;http://goo.gl/xN2jc&quot;&gt;cryptlib&lt;/a&gt;. This is a really nice lib done by Peter Gutmann with a lot of bindings and particularly binding to python.&lt;br /&gt;
As I am working on SCEP implementation lately I hope this will be of some help to get to understand that damn protocol!&lt;br /&gt;
&lt;br /&gt;
I am also running a build to RPM (and hopefully some deb later) &amp;nbsp;for the library.&lt;br /&gt;
You can find it on OpenSUSE Build Service at &lt;a href=&quot;https://build.opensuse.org/package/show?package=cryptlib&amp;amp;project=home%3Asbarbereau%3Aopenca&quot;&gt;home:sbarebreau:openca&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://barbich.blogspot.com/feeds/7833787637568533966/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2742224415984805331/7833787637568533966' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2742224415984805331/posts/default/7833787637568533966'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2742224415984805331/posts/default/7833787637568533966'/><link rel='alternate' type='text/html' href='http://barbich.blogspot.com/2012/07/cryptlib.html' title='Cryptlib'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2742224415984805331.post-6517894576446907421</id><published>2011-11-08T14:02:00.000+01:00</published><updated>2012-07-03T14:11:17.270+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="security"/><title type='text'>Using CARVER to identify risks and vulnerabilities</title><content type='html'>&lt;a href=&quot;http://redteams.tumblr.com/post/11690104332&quot;&gt;Using CARVER to identify risks and vulnerabilities&lt;/a&gt;: &lt;br /&gt;
CARVER is an acronym that stands for Criticality, Accessibility, Recuperability, Vulnerability, Effect and Recognizability. It’s a system used by Special Forces to assess the targets and see which one needs to be addressed first.&lt;br /&gt;
&lt;br /&gt;
Read more at&amp;nbsp;&lt;a href=&quot;http://redteams.tumblr.com/post/11690104332/using-carver-to-identify-risks-and-vulnerabilities&quot;&gt;http://redteams.tumblr.com/post/11690104332/using-carver-to-identify-risks-and-vulnerabilities&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2742224415984805331/posts/default/6517894576446907421'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2742224415984805331/posts/default/6517894576446907421'/><link rel='alternate' type='text/html' href='http://barbich.blogspot.com/2011/11/using-carver-to-identify-risks-and.html' title='Using CARVER to identify risks and vulnerabilities'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2742224415984805331.post-8421440387008541654</id><published>2011-11-07T14:58:00.003+01:00</published><updated>2011-11-07T14:58:59.192+01:00</updated><title type='text'></title><content type='html'>&lt;a href=&quot;https://lastpass.com/&quot;&gt;Lastpass&lt;/a&gt;, the password management solution, is now supporting google two factor authentication service. Well, you need a supported smartphone, but this is really nice.&lt;br /&gt;
&lt;br /&gt;
More information on the service can be found at:&amp;nbsp;&lt;a href=&quot;http://helpdesk.lastpass.com/security-options/google-authenticator/&quot;&gt;http://helpdesk.lastpass.com/security-options/google-authenticator/&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://barbich.blogspot.com/feeds/8421440387008541654/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2742224415984805331/8421440387008541654' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2742224415984805331/posts/default/8421440387008541654'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2742224415984805331/posts/default/8421440387008541654'/><link rel='alternate' type='text/html' href='http://barbich.blogspot.com/2011/11/lastpass-password-management-solution.html' title=''/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2742224415984805331.post-6094424113385703565</id><published>2011-11-07T10:46:00.004+01:00</published><updated>2011-11-07T10:46:38.538+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="monitoring"/><category scheme="http://www.blogger.com/atom/ns#" term="syslog"/><category scheme="http://www.blogger.com/atom/ns#" term="trendmicro"/><title type='text'>Monitoring Trendmicro Officescan log entries</title><content type='html'>I noticed that a Trendmicro officescan installation I have, was not updating the AV patterns for a couple of days. This behaviors happens from time to time (once a month in average), and I still can not pinpoint exactly the cause (wonderful&amp;nbsp;world of windows which does not have proper logging and debugging).&lt;br /&gt;
As there is no automated mechanism to alert you on this phenomena I decided to go back to the proven methods: send logs to syslogs, parse with sec to generate alarm.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Log files&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
Officescan keeps a &quot;server update log&quot; &amp;nbsp;in his home directory:&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt; %PROGRAMFILES/&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, Helvetica, sans-serif; font-size: 12px;&quot;&gt;Trend Micro\OfficeScan\PCCSRV\Log\update.lo&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, Helvetica, sans-serif; font-size: 12px;&quot;&gt;g&lt;/span&gt;&lt;/span&gt;. This flat text file store a line for each of the update operations done by the service and erases the file on a regular basis depending on your settings in the &#39;log maintenance&#39; settings. Example:&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;20111107042518,4,1,1,8.555.00&lt;br /&gt;20111107075300,4,51,1,8.555.00&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
The format is not documented and the only things I identified up to now are: timestamp (first field), product code(3rd field, 1 being AV pattern, 51 being Smartscan pattern), version (5th field)&lt;/blockquote&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Windows to syslog&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
To allow collecting windows events or flat text logfile on a syslog service you will need to deploy some non MS addon. One of the options is &lt;a href=&quot;http://www.intersectalliance.com/projects/EpilogWindows/index.html&quot;&gt;Epilog&lt;/a&gt;&amp;nbsp;for Windows by the IntersecAlliance another is to to use &lt;a href=&quot;http://www.cygwin.com/&quot;&gt;cygwin&lt;/a&gt;(less straightforward).&amp;nbsp;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
Epilogs&#39; installation is really easy and offer some really nice feature to collect events on a windows system (simple web GUI, filtering of log entries, ...). Just point Epilog to your log files, configure the destination to be your syslog server and wait for something to be written to the log (force a manual update of the AV does the trick).&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
If everything does well you will see the log lines appear on your syslog server. In my case I use syslog-ng to get those entries in a dedicated log file. Configuration is something like this:&lt;/blockquote&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;# Log infrastructure servers - OLD&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;filter h_prodnet { netmask(10.1.1.0/24); };&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;destination d_local3 { file(&quot;/var/log/Windows/$HOST-$YEAR$MONTH$DAY.log&quot; create_dirs(yes) perm(0644)); };&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;destination d_local2 { file(&quot;/var/log/Windows/$HOST-FILELOG-$YEAR$MONTH$DAY.log&quot; create_dirs(yes) perm(0644)); };&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Syslog parsing&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
For the log file parsing I am using &lt;a href=&quot;http://simple-evcorr.sourceforge.net/&quot;&gt;SEC&lt;/a&gt; with some&amp;nbsp;customized&amp;nbsp;set of rules. As I am only&amp;nbsp;interested&amp;nbsp;on the update issues with Trendmicro, I only created a single rule:&lt;/blockquote&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;#Trendmicro related event&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;type=Single&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;ptype=RegExp&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;pattern=TRENDMICRO;.*unable to complete.*&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;desc=Trendmicro update problem. Please review console log, stop services and empty all AU_temp directory, reboot server.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;action=pipe &#39;Trendmicro: %s&#39; /usr/bin/mail -s &quot;Trendmicro issue on package updates&quot; youyou@nobody.test&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
Thats it. Now I get spammed when ever the Officescan encounters issues to update its local databases, and this happens way to often in my opinion.&lt;/blockquote&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://barbich.blogspot.com/feeds/6094424113385703565/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2742224415984805331/6094424113385703565' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2742224415984805331/posts/default/6094424113385703565'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2742224415984805331/posts/default/6094424113385703565'/><link rel='alternate' type='text/html' href='http://barbich.blogspot.com/2011/11/monitoring-trendmicro-officescan-log.html' title='Monitoring Trendmicro Officescan log entries'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2742224415984805331.post-8664612480106755375</id><published>2011-11-01T12:18:00.002+01:00</published><updated>2011-11-01T12:18:51.054+01:00</updated><title type='text'>OpenSUSE Build Service</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
I am really a big fan of &lt;b&gt;openSUSE&amp;nbsp;build service&lt;/b&gt;. If you need to build packages for multiple distribution and you development environment is restricted this can be a life saver.&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
I personally use it mainly to backport packages to my production hosts. In other words, it helps me cleanly install these shiny new tools I always like to have (yeah sure, still have some testing to do but ...).&lt;/div&gt;
Benefits:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;keep&amp;nbsp;dependencies&lt;/li&gt;
&lt;li&gt;avoid conflicting installation of same tools (packaged and hand compiled)&lt;/li&gt;
&lt;li&gt;stay on bleeding edge software (can be argued to not be a benefit)&lt;/li&gt;
&lt;li&gt;rapid&amp;nbsp;deployment&amp;nbsp;on multiple hosts&lt;/li&gt;
&lt;li&gt;fun&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Take for example &lt;a href=&quot;http://simple-evcorr.sourceforge.net/&quot;&gt;sec&lt;/a&gt;&amp;nbsp;(simple event correlation). The &#39;sec&#39; package distributed with openSUSE 11.4 is 2.5.3 which date back from December 2009. The most recent version is from September 2011, and adds a few new features which can be practical. In older times, to deploy the most recent version, I would probably have overwritten the installed binaries/scripts. Now, I install a clean package (&lt;a href=&quot;http://download.opensuse.org/repositories/home:/sbarbereau:/branches:/server:/monitoring/&quot; style=&quot;text-align: -webkit-auto;&quot;&gt;a&lt;/a&gt;vailable &lt;a href=&quot;http://download.opensuse.org/repositories/home:/sbarbereau:/branches:/server:/monitoring/&quot;&gt;here&lt;/a&gt;).&amp;nbsp;&lt;/div&gt;
&lt;br /&gt;
I know of some alternatives, but this is like beer, everyone has his favourite.&lt;br /&gt;
Give it a try:&amp;nbsp;&lt;a href=&quot;https://build.opensuse.org/&quot;&gt;https://build.opensuse.org/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://barbich.blogspot.com/feeds/8664612480106755375/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2742224415984805331/8664612480106755375' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2742224415984805331/posts/default/8664612480106755375'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2742224415984805331/posts/default/8664612480106755375'/><link rel='alternate' type='text/html' href='http://barbich.blogspot.com/2011/11/opensuse-build-service.html' title='OpenSUSE Build Service'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2742224415984805331.post-6865773084179791697</id><published>2009-12-15T17:25:00.001+01:00</published><updated>2009-12-15T22:49:37.334+01:00</updated><title type='text'>python-libmemcached replication</title><content type='html'>While adding some &lt;a href=&quot;http://nagios.org/&quot;&gt;Nagios&lt;/a&gt; monitoring checks I was requiring a simple mechanism to replicate data betwen multiple &lt;a href=&quot;http://memcached.org/&quot;&gt;memcached&lt;/a&gt; servers. Since &lt;a href=&quot;http://tangent.org/552/libmemcached.html&quot;&gt;libmemcached&lt;/a&gt; 0.34 this is possible using the &#39;replica&#39; behavior.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Using the memcached_set_behavior function and setting the&amp;nbsp;MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS to some integer you are ensuring that multiple copies of the stored values exist throughout your memcached farm.&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;My only issue was that I am using &lt;a href=&quot;http://code.google.com/p/python-libmemcached/&quot;&gt;python-libmemcached&lt;/a&gt; to access my memcache servers from python and the &#39;replicas&#39; behavior has not yet (as of 0.17.0) been incorporated. So using I had to patch the sources (RPM package is available on OpenSuse Build Service, patch is attached).&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
Usage example:&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;===============================&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;gt;&amp;gt;&amp;gt; import cmemcached as memcache&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;mc=memcache.Client([&#39;netmona:11211&#39;,&#39;netmonb:11211&#39;],debug=1,behaviors={&#39;replicas&#39;:2,&#39;binary&#39;:1})&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;mca=memcache.Client([&#39;netmona:11211&#39;],debug=1,behaviors={})&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;mcb=memcache.Client([&#39;netmonb:11211&#39;],debug=1,behaviors={})&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;mc.set(&#39;replicated-data&#39;,&#39;yeah&#39;,time=600)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;mc.get(&#39;replicated-data&#39;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&#39;yeah&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;mca.get(&#39;replicated-data&#39;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&#39;yeah&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&amp;nbsp;mcb.get(&#39;replicated-data&#39;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&#39;yeah&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;===============================&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Of course, if you set the data on 1 server only it wont be replicated. Never the less ,this simple replication system opens a number of opportunities for some of my projects where I use memcache as a &#39;shared&#39; storage between processes.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #e06666;&quot;&gt;Warning: memcache does not have any security mechanism embedded (access,confidentiality...), use it only on trusted networks.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://barbich.blogspot.com/feeds/6865773084179791697/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2742224415984805331/6865773084179791697' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2742224415984805331/posts/default/6865773084179791697'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2742224415984805331/posts/default/6865773084179791697'/><link rel='alternate' type='text/html' href='http://barbich.blogspot.com/2009/12/python-libmemcached-replication.html' title='python-libmemcached replication'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2742224415984805331.post-8179978411518419677</id><published>2009-12-11T20:02:00.001+01:00</published><updated>2009-12-11T20:03:15.325+01:00</updated><title type='text'>RRDcached for cricket</title><content type='html'>We all have our favorite tools for our daily job.&lt;br /&gt;
&lt;br /&gt;
For statistics collection I like to use Cricket (&lt;a href=&quot;http://cricket.sourceforge.net/&quot;&gt;http://cricket.sourceforge.net/&lt;/a&gt;).&lt;br /&gt;
&lt;br /&gt;
Sure, it is old school but it does the job, and it does it well. I enjoy having a flat configuration and storage structure for the RRD. No fancy database!!! Of course, this comes to the cost of some very old fashioned perl code and performance issues (but have a look at the CVS version).&lt;br /&gt;
&lt;br /&gt;
Never the less,  a few days ago I update the rrdtool version I was using on my SNMP collector host and started to run the new RRDcached service. This was a real pleasure as I could see some real performance improvments and I had to do nothing in term of code for Cricket. Yep, worked out of the box with it.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
What I did was:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Get rrdtool 1.4.2 . As I am running OpenSuse11.1 I wanted to stick to a clean package installation and tried to find the RPM for it. No luck at that time. So second option was to of course make the rrdtool package myself with OBS. Package can be downloaded from &lt;a href=&quot;http://download.opensuse.org/repositories/home:/sbarbereau/openSUSE_11.1/&quot;&gt;http://download.opensuse.org/repositories/home:/sbarbereau/openSUSE_11.1/&lt;/a&gt; .&lt;/li&gt;
&lt;li&gt;&amp;nbsp;Install package&lt;/li&gt;
&lt;li&gt;Start rrdcached. That was probably the most &quot;complex&quot; part. As I wanted to keep this clean I created a pseudo initd scripts as well as a separate config file. For simplicity I could have packed everything together. Here are the files:&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;======== rrdcached.defaults ======== &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;RUN_RRDCACHED=1&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;RRDCACHED_USER=&quot;cricket&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;OPTS=&quot;-w 300 -z 300 -f 1800 -F&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;PIDFILE=&quot;/shared/netmonb/cricket/var/run/rrdcached/rrdcached.pid&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;SOCKFILE=&quot;/shared/netmonb/cricket/var/run/rrdcached/rrdcached.socket&quot;&lt;br /&gt;
JOURNAL=&quot;/shared/netmonb/cricket/var/run/rrdcached/rrdcached.journal&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;SOCKPERMS=0660&lt;br /&gt;
======== rrdcached.defaults ======== &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;======== rrdcached.init ======== &lt;br /&gt;
RRDCACHED_BIN=/usr/bin/rrdcached&lt;br /&gt;
test -x $RRDCACHED_BIN || { echo &quot;$RRDCACHED_BIN not installed&quot;; &lt;br /&gt;
if [ &quot;$1&quot; = &quot;stop&quot; ]; then exit 0;&lt;br /&gt;
else exit 5; fi; }&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;RRDCACHED_CONFIG=/shared/netmonb/cricket/cricket/util/rrdcached/rrdcached.defaults&lt;br /&gt;
test -r $RRDCACHED_CONFIG || { echo &quot;$RRDCACHED_CONFIG not existing&quot;;&lt;br /&gt;
if [ &quot;$1&quot; = &quot;stop&quot; ]; then exit 0;&lt;br /&gt;
else exit 6; fi; }&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;. $RRDCACHED_CONFIG&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
. /etc/rc.status&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;rc_reset&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
case &quot;$1&quot; in&lt;br /&gt;
&amp;nbsp;&amp;nbsp;start)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo -n &quot;Starting rrdcached &quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;startproc -u $RRDCACHED_USER -p $PIDFILE $RRDCACHED_BIN $OPTS \&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;-p $PIDFILE -l $SOCKFILE -j $JOURNAL&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;rc_status -v&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo -n &quot;Setting Permissions &quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;chmod $SOCKPERMS &quot;${SOCKFILE}&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;rc_status -v&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;stop)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo -n &quot;Shutting down rrdcached &quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;killproc -TERM -p $PIDFILE $RRDCACHED_BIN&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;rc_status -v&lt;br /&gt;
&amp;nbsp;&amp;nbsp;;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;try-restart|condrestart)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if test &quot;$1&quot; = &quot;condrestart&quot;; then&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo &quot;${attn} Use try-restart ${done}(LSB)${attn} rather than&amp;nbsp;&amp;nbsp;&amp;nbsp;condrestart ${warn}(RH)${norm}&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fi&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$0 status&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if test $? = 0; then&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$0 restart&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;else&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;rc_reset # Not running is not a failure.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fi&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;rc_status&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;try-start)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$0 status&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if test $? = 0; then&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;rc_reset # Not running is not a failure.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$0 restart&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fi &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;rc_status&lt;br /&gt;
&amp;nbsp;&amp;nbsp;;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;restart)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$0 stop&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$0 start&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;rc_status&lt;br /&gt;
&amp;nbsp;&amp;nbsp;;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;force-reload)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$0 try-restart&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;rc_status&lt;br /&gt;
&amp;nbsp;&amp;nbsp;;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;reload)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo -n &quot;Reload service rrdcached : not supported&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;rc_status -v&lt;br /&gt;
&amp;nbsp;&amp;nbsp;;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;status)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo -n &quot;Checking for service rrdcached &quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;checkproc -p $PIDFILE $RRDCACHED_BIN&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;rc_status -v&lt;br /&gt;
&amp;nbsp;&amp;nbsp;;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;*)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo &quot;Usage: $0 {start|stop|status|try-restart|try-&amp;nbsp;&amp;nbsp;start|restart|force-reload|reload}&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;exit 1&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;;;&lt;br /&gt;
esac&lt;br /&gt;
rc_exit&lt;br /&gt;
======== rrdcached.init ======== &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Obviously you will need to change a few things in the files to (path, users, ...)&lt;br /&gt;
&lt;br /&gt;
But as said, no change in any of the perl stuff from cricket was then required. I just had to set RRDCACHED_ADDRESS in my environment ... &lt;br /&gt;
&lt;br /&gt;
It is really nice to use rrdcached as it really works out of the box with any properly coded program using the standard rrdtool API. Wether it is Cacti, MRTG or similar tools ... it should work! &lt;br /&gt;
&lt;br /&gt;
But there are 2 drawback I found out:&lt;br /&gt;
- if RRDCACHED_ADDRESS is set but points to a non existing socket/file you are going to have problems as RRD will not update your data files.&lt;br /&gt;
- if you use your RRD files to do some monitoring (thresholds detection or similar) the added write delay from the rrdcache is going to pose some problems.&lt;br /&gt;
&lt;br /&gt;
Anyway was fun.</content><link rel='replies' type='application/atom+xml' href='http://barbich.blogspot.com/feeds/8179978411518419677/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/2742224415984805331/8179978411518419677' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2742224415984805331/posts/default/8179978411518419677'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2742224415984805331/posts/default/8179978411518419677'/><link rel='alternate' type='text/html' href='http://barbich.blogspot.com/2009/12/rrdcached-for-cricket.html' title='RRDcached for cricket'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry></feed>