<?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>Netuality &#187; linux</title>
	<atom:link href="http://www.netuality.ro/tag/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://www.netuality.ro</link>
	<description>Taming the big, bad, nasty websites</description>
	<lastBuildDate>Mon, 07 Nov 2011 16:36:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Monitoring memcached with cacti</title>
		<link>http://www.netuality.ro/monitoring-memcached-with-cacti/tools/20060802</link>
		<comments>http://www.netuality.ro/monitoring-memcached-with-cacti/tools/20060802#comments</comments>
		<pubDate>Wed, 02 Aug 2006 19:54:44 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[cacti]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[memcache]]></category>
		<category><![CDATA[memcached]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[snmp]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.netoo.loco/monitoring-memcached-with-cacti/uncategorized/20060802</guid>
		<description><![CDATA[Memcached is a clusterable cache server from Danga. Or, as they call, it a distributed memory object caching system. Well, whatever. Just note that memcached clients exist for lots of languages (Java, PHP, Python, Ruby, Perl) &#8211; mainstream languages in the web world. A lighter version of server was rewritten in Java by Mr. Jehiah [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.danga.com/memcached/" target="_new">Memcached</a> is a clusterable cache server from <a href="http://www.danga.com/" target="_new">Danga</a>. Or, as they call, it a <strong>distributed memory object caching system</strong>. Well, whatever. Just note that memcached clients exist for lots of languages (Java, PHP, Python, Ruby, Perl) &#8211; mainstream languages in the web world. A lighter version of server was <a href="http://jehiah.com/projects/j-memcached/" target="_new">rewritten in Java</a> by Mr. Jehiah Czebotar. Major websites such as Facebook, Slashdot, Livejournal and Dealnews use memcached in order to scale for the huge load they&#8217;re serving.  Recently, we needed to monitor the memcache servers on a high-performance web cluster serving the <a href="http://www.planigo.com/en/index.html" target="_blank">Planigo</a> websites. By googling and reading the related newsgroups, I was able to find two solutions:</p>
<ul>
<li>from faemalia.net, a script which is integrated with the <a href="http://www.faemalia.net/mysqlUtils/" target="_new">MySQL server templates</a> for Cacti. Uses the Perl client.</li>
<li>from dealnews.com, a dedicated memcached template for Cacti and some scripts based on the Python client. The installation is <a href="http://dealnews.com/developers/cacti/memcached.html" target="_new">thoroughly described here</a>.</li>
</ul>
<p>These two solutions have the same approach &#8211; provide a specialized Cacti template. The charts drawn by these templates are based on data extracted by the execution of memcached client scripts. Maybe very elegant, but could become a pain in the dorsal area. Futzing with Cacti templates was never my favorite pasttime. Just try to import a template exported from a different version of Cacti and you&#8217;ll know what I mean.  In my opinion, there is a simple way, which consists in installing a memcached client on all the memcached servers, then extracting the statistical values using a script. We&#8217;ll use the technique described in <a href="http://www.netuality.ro/monitor-everything-on-your-linux-servers-with-snmp-and-cacti/tools/20060305" target="_blank">one of my previous posts</a>, to expose script results as SNMP OID values. Then, track these values in Cacti via the generic existing mechanism. My approach has the disadvantage of installing a memcached client on all the servers. However, it is very simple to build your own charts and data source templates, as for any generic SNMP data.  All you need now a simple script which will print the memcached statistics, one per line. I will provide one-liners for Python, which will obviously work only on machines having Python and the <a href="ftp://ftp.tummy.com/pub/python-memcached/" target="_new">&#8220;tummy&#8221; client</a> installed. This is the recipe (default location of Python executable on Debian is <em>/usr/bin/python</em> but YMMV):</p>
<p>1. first use this one liner as snmpd exec :</p>
<p><em>/usr/bin/python -c &#8220;import memcache; print (&#8216;%s&#8217;%[memcache.Client(['127.0.0.1:11211'], debug=0).get_stats()[0][1],]).replace(\&#8221;&#8216;\&#8221;,&#8221;).replace(&#8216;,&#8217;,'\n&#8217;).replace(&#8216;[','')<br />
.replace(']&#8216;,&#8221;).replace(&#8216;{&#8216;,&#8221;).replace(&#8216;}&#8217;,&#8221;)&#8221;</em></p>
<p>This will display the name of the memcached statistic along with its value and will allow you to hand pick the OIDs that you want to track. Yes, I know it could be done simpler with <em>translate</em> instead of multiple <em>replace</em>. Left as an exercise for the Python-aware reader.</p>
<p>2. after having a complete list of OIDs use this one-liner:</p>
<p><em>/usr/bin/python -c &#8220;import memcache; print &#8216;##&#8217;.join(memcache.Client(['127.0.0.1:11211'], debug=0).get_stats()[0][1].values()).replace(&#8216;##&#8217;,'\n&#8217;)&#8221;</em></p>
<p>The memcached statistics will be displayed in the same order, but only their values not their names.</p>
<p>And this is the mandatory eye candy:</p>
<p><img src="http://www.jroller.com/resources/a/aspinei/mem1.png" alt="" width="432" height="179" /><br />
<img src="http://www.jroller.com/resources/a/aspinei/mem2.png" alt="" width="426" height="171" /><br />
<img src="http://www.jroller.com/resources/a/aspinei/mem3.png" alt="" width="432" height="178" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.netuality.ro/monitoring-memcached-with-cacti/tools/20060802/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Monitoring Windows servers &#8211; with SNMP</title>
		<link>http://www.netuality.ro/monitoring-windows-servers-with-snmp/tools/20060512</link>
		<comments>http://www.netuality.ro/monitoring-windows-servers-with-snmp/tools/20060512#comments</comments>
		<pubDate>Fri, 12 May 2006 15:52:49 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[cacti]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[snmp]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.netoo.loco/monitoring-windows-servers-with-snmp/uncategorized/20060512</guid>
		<description><![CDATA[My previous article was focused on Linux monitoring. Often, you&#8217;ll have in your datacenter at least a few Windows machines. SQL Server is one of the best excuses these days to get a Microsoft machine in your server room &#8211; and you know what, it&#8217;s a decent database &#8211; well, at least for medium-sized companies [...]]]></description>
			<content:encoded><![CDATA[<p>My <a target="_new">previous</a> <a href="http://www.netuality.ro/monitor-everything-on-your-linux-servers-with-snmp-and-cacti/articles/20060305" target="_blank">article was focused on Linux monitoring</a>. Often, you&#8217;ll have in your datacenter at least a few Windows machines. SQL Server is one of the best excuses these days to get a Microsoft machine in your server room &#8211; and you know what, it&#8217;s a decent database &#8211; well, at least for medium-sized companies like the one I&#8217;m working for right now.</p>
<p>It is less known, but yes you can have SNMP support out of the box with Windows 2000 and XP, and it doesn&#8217;t need to be the Server flavor [obiously it works the same in 2003 Server]:</p>
<ol type="1">
<li>Invoke the <strong>Control Panel</strong>.</li>
<li>Double click the <strong>Add/Remove Programs</strong> icon.</li>
<li>Select <strong>Add/Remove Windows Components</strong>. The Windows Component Wizard is displayed.</li>
<li>Check the Management and Monitoring Tools box.</li>
<li>Click the <strong>Details</strong> button.</li>
<li>Check the Simple Network Management Protocol box and click <strong>OK</strong>, then <strong>Next</strong>. You may have to reboot the machine.</li>
</ol>
<p style="text-align: center;"><img class="aligncenter" src="http://www.jroller.com/resources/a/aspinei/win_snmp1.png" alt="" width="502" height="201" /></p>
<p>After the server is installed, the SNMP service has to be configured. Here&#8217;s how:</p>
<ol type="1">
<li>Invoke the <strong>Control Panel</strong>.</li>
<li>Double click the <strong>Administrative Tools</strong> icon.</li>
<li>Double click the <strong>Services</strong> icon.</li>
<li>Select <strong>SNMP</strong> Service.</li>
<li>Choose the <strong>Security</strong> tab.</li>
<li>Add whatever community name is used in your network. Chances are in a local internal LAN the default <strong>public</strong> works out of the box.</li>
<li>For a sensitive server, you may want to fiddle a little bit with the IP restriction settings, for instance allowing SNMP communication only with the monitoring machine.</li>
<li>Click <strong>OK</strong> then restart the service.</li>
</ol>
<p>Next step is Cacti integration. Unfortunately, there is no Windows-specific profile for devices in Cacti. Therefore if you have lots of Windows machines, you&#8217;ll have to define your own. Or, take a Generic SNMP-enabled host and use it as a scaffold for each device configuration.</p>
<p>Out of the graphs and datasources already defined in Cacti [I am using 0.8.6c] only two work with Windows SNMP agents: processes and interface traffic values.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://www.jroller.com/resources/a/aspinei/procs.png" alt="" width="500" height="93" /></p>
<p>It&#8217;s a good start, but if you are serious about monitoring, you need to dig a little bit deeper. Once again, the <a href="http://www.ireasoning.com/mibbrowser.shtml" target="_new">MIB Browser</a> comes to save the day. It&#8217;s very simple, just search on the Windows machine for any <em>.mib</em> files you are able to find, copy on your workstation, load them into the MIB browser and make some recursive walks (<strong>Get subtree</strong> on the root of the MIB).This way, I was able to find some interesting OID for the Windows machine. For instance, .1.3.6.1.2.1.25.3.3.1.2.1 -&gt; .1.3.6.1.2.1.25.3.3.1.2.4 the OID for CPU load on each of the 4 virtual CPUs [it's a dual Xeon with HT].</p>
<p style="text-align: center;"><img class="aligncenter" src="http://www.jroller.com/resources/a/aspinei/procs2.png" alt="" width="500" height="244" /></p>
<p>Memory-related OIDs for my configuration are :</p>
<ul>
<li>.1.3.6.1.2.1.25.2.3.1.5.6 &#8211; Total physical memory</li>
<li>.1.3.6.1.2.1.25.2.3.1.6.6 &#8211; Used physical memory</li>
<li>.1.3.6.1.2.1.25.2.3.1.6.6 &#8211; Total virtual memory ["virtual"="swap" in Windows lingo]</li>
<li>.1.3.6.1.2.1.25.2.3.1.6.6 &#8211; Used virtual memory</li>
</ul>
<p>Here&#8217;s a neat memory chart for a windows machine. Notice that the values are in &#8220;blocks&#8221; which in my case is 64kb. The total physical memory is 4GB.</p>
<p style="text-align: center;"><img class="aligncenter" src="http://www.jroller.com/resources/a/aspinei/memory.png" alt="" width="499" height="231" /></p>
<p>Most hardware manufacturers do offer SNMP agents for their hardware, as well as the corresponding <em>.mib</em> file . In my case, I was able to install an agent to monitor an LSI Megaraid controller. Here is a chart for the number of disk operations/second:</p>
<p style="text-align: center;"><img class="aligncenter" src="http://www.jroller.com/resources/a/aspinei/raid.png" alt="" width="500" height="180" /></p>
<p>In one of my next articles, we&#8217;ll take a look together at the way you can export &#8220;non-standard&#8221; data over SNMP from Windows, in the same manner we did on Linux, using custom scripts. Till then, have an excellent week.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.netuality.ro/monitoring-windows-servers-with-snmp/tools/20060512/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Monitor everything on your Linux servers &#8211; with SNMP and Cacti</title>
		<link>http://www.netuality.ro/monitor-everything-on-your-linux-servers-with-snmp-and-cacti/tools/20060305</link>
		<comments>http://www.netuality.ro/monitor-everything-on-your-linux-servers-with-snmp-and-cacti/tools/20060305#comments</comments>
		<pubDate>Sun, 05 Mar 2006 14:27:22 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[snmp]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.netoo.loco/monitor-everything-on-your-linux-servers-with-snmp-and-cacti/uncategorized/20060305</guid>
		<description><![CDATA[Two free open-source tools are running the show for network and server-activity monitoring. The oldest and quite popular among network and system administrators is Nagios. Nagios does not only do monitoring, but also event traps, escalation and notification. The younger challenger is called Cacti. Unlike Nagios, it&#8217;s written in a scripting language [PHP] so no [...]]]></description>
			<content:encoded><![CDATA[<p align="left">Two free open-source tools are running the show for network and server-activity monitoring. The oldest and quite popular among network and system administrators is <a href="http://www.nagios.org/" target="_new">Nagios</a>. Nagios does not only do monitoring, but also event traps, escalation and notification. The younger challenger is called <a href="http://www.cacti.net/" target="_new">Cacti</a>. Unlike Nagios, it&#8217;s written in a scripting language [PHP] so no compiling is necessary &#8211; it just runs out of the box<a title="sc1" name="sc1" href="#sn1"><sup>1</sup></a>. Cacti&#8217;s problem is that &#8211; at its current version &#8211; is missing lots of real-time features such as monitoring and notification. All these features are scheduled to be integrated in future versions of the product, but as with any open-source roadmap nothing is guaranteed, Anyway, this article is focusing on Cacti integration because it&#8217;s what I am currently using.</p>
<p align="left">Cacti is built upon an open-source graphing tool called <a title="The Multi Router Traffic Grapher" href="http://people.ee.ethz.ch/~oetiker/webtools/mrtg/" target="_new">MRTG</a> and a communication protocol <a title="Simple Network Management Protocol" href="http://www.snmp.com/protocol/" target="_new">SNMP</a>. SNMP is not exactly a developer&#8217;s cup of tea, being more of a network administrator&#8217;s tool<a title="sc2" name="sc2" href="#sn2"><sup>2</sup></a>. However, a monitoring server comes extremely handy in performance measurement and tuning, especially for complex performance behavior which can only be benchmarked long-term : such as large caches impact on a web application, or performance of long-running operations.</p>
<p align="left">But is that specific variable you need to monitor, available with SNMP out of the box ? There is a strong chance it is. SNMP being an extensible protocol, lots of organization have recorded their own <a title="Management information base" href="http://en.wikipedia.org/wiki/Management_information_base" target="_new">MIB</a>s and respective implementations. Basically, a MIB is a group of unique identifiers called <a title="Object identifier" href="http://en.wikipedia.org/wiki/Object_identifier" target="_new">OID</a>s. An OID is a sequence of numbers separated by dots, for instance &#8216;.1.3.6.1.4.1.2021.11&#8242;; each number has a special meaning in a standard object tree &#8211; this example, the meaning of &#8216;.1.3.6.1.4.1.2021.11&#8242; is &#8216;.iso.org.dod.internet.private.enterprises.ucdavis.systemStats&#8217;. Even you can have your own MIB in the &#8216;.iso.org.dod.internet.private.enterprises&#8217; tree, by applying on <a title="Apply for your own MIB" href="http://www.iana.org/cgi-bin/enterprise.pl" target="_new">this</a> page at <a title="Internet Assigned Numbers Authority" href="http://en.wikipedia.org/wiki/Internet_Assigned_Numbers_Authority" target="_new">IANA</a>.</p>
<p align="left">Most probably you don&#8217;t really need your own MIB, no matter how &#8216;exotic&#8217; your monitoring is, because:</p>
<p>a) it&#8217;s already there, in the huge list of existing MIBs and implementations</p>
<p>and</p>
<p>b) you are not bound to the existing official MIBs, in fact you can create your own MIB as long as you replicate it in the snmp configuration on all the servers that you want to monitor.</p>
<p style="text-align: center"><img src="http://www.netuality.ro/wp-content/uploads/2008/01/snmp1.gif" alt="" width="499" height="298" /></p>
<p align="left">To take a look at existing MIBs, free tools are available on the net, IMHO the best one being <a href="http://www.ireasoning.com/mibbrowser.shtml" target="_new">MibBrowser</a>. This multiplatform [Java] MIB browser has a free version which should be more than enough for our basic task. The screen capture shown here depicts a &#8220;Get Subtree&#8221; operation on the &#8216;.1.3.6.1.4.1.2021.11&#8242; MIB; the result is a list of single value MIBs, such for instance &#8216;.1.3.6.1.4.1.2021.11.11.0&#8242; which has the alias &#8216;ssCpuIdle.0&#8242; and value 97 [meaning that the CPU is 97% idle]. You can see the alias by loading the corresponding MIB file [select File/Load MIB then choose 'UCD-SNMP-MIB.txt' from the list of predefined MIBs].</p>
<p align="left">From command line, in order to display existing MIB values, you can use snmpwalk:</p>
<pre>snmpwalk -Os -c [community_name] -v 1 [hostname] .1.3.6.1.4.1.111111.1</pre>
<p><a title="sc3" name="sc3" href="#sn3"><sup>3</sup></a> and the result is:</p>
<pre>.1.3.6.1.4.1.2021.11 OID (.iso.org.dod.internet.private.enterprises.ucdavis.systemStats)
snmpwalk -v 1 -c sncq localhost .1.3.6.1.4.1.2021.11
UCD-SNMP-MIB::ssIndex.0 = INTEGER: 1
UCD-SNMP-MIB::ssErrorName.0 = STRING: systemStats
UCD-SNMP-MIB::ssSwapIn.0 = INTEGER: 0
UCD-SNMP-MIB::ssSwapOut.0 = INTEGER: 0
UCD-SNMP-MIB::ssIOSent.0 = INTEGER: 4
UCD-SNMP-MIB::ssIOReceive.0 = INTEGER: 2
UCD-SNMP-MIB::ssSysInterrupts.0 = INTEGER: 4
UCD-SNMP-MIB::ssSysContext.0 = INTEGER: 1
UCD-SNMP-MIB::ssCpuUser.0 = INTEGER: 2
UCD-SNMP-MIB::ssCpuSystem.0 = INTEGER: 1
UCD-SNMP-MIB::ssCpuIdle.0 = INTEGER: 96
UCD-SNMP-MIB::ssCpuRawUser.0 = Counter32: 17096084
UCD-SNMP-MIB::ssCpuRawNice.0 = Counter32: 24079
UCD-SNMP-MIB::ssCpuRawSystem.0 = Counter32: 6778580
UCD-SNMP-MIB::ssCpuRawIdle.0 = Counter32: 599169454
UCD-SNMP-MIB::ssCpuRawKernel.0 = Counter32: 6778580
UCD-SNMP-MIB::ssIORawSent.0 = Counter32: 998257634
UCD-SNMP-MIB::ssIORawReceived.0 = Counter32: 799700984
UCD-SNMP-MIB::ssRawInterrupts.0 = Counter32: 711143737
UCD-SNMP-MIB::ssRawContexts.0 = Counter32: 1163331309
UCD-SNMP-MIB::ssRawSwapIn.0 = Counter32: 23015
UCD-SNMP-MIB::ssRawSwapOut.0 = Counter32: 13730</pre>
<p>Each of this values has its own significance, like for instance &#8216;ssCpuIdle.0&#8242; which announces that the CPU is 96% idle.<br />
In order to retrieve just a single value of the list, use its alias as a parameter to the snmpget command, for instance</p>
<pre>snmpget -Os -c [community_name] -v 1 [hostname] UCD-SNMP-MIB::ssCpuIdle.0</pre>
<p align="left">Sometimes, you want to monitor something which you do not seem to find in the list of MIBs. Say, for instance, the performance of a MySQL database that your&#8217;re pounding pretty hard with your webapp<a title="sc4" name="sc4" href="#sn4"><sup>4</sup></a>. The easiest way of doing this is to pass through a script &#8211; snmp implementations can take the result of any script and expose it through the protocol, line by line.</p>
<p>Supposing you want to keep track of the values obtained with the following script:</p>
<pre>#!/bin/sh
/usr/bin/mysqladmin -uroot status | /usr/bin/awk '{printf("%f\n%d\n%d\n",$4/
10,$6/1000,$9)}'</pre>
<p align="left">The <em>mysqladmin</em> command and a bit of simple awk magic display the following three values, each on a separate line:</p>
<ul>
<li>number of opened connections / 10</li>
<li>number of queries / 1000</li>
<li>number of slow queries</li>
</ul>
<p align="left">It is interesting to not that, while the first value is instantaneous gauge-like, the following two are incremental, growing and growing as long as new queries and new slow queries are recorded. Will keep this in mind for later, when we will track these values.</p>
<p align="left">But for now, let&#8217;s see how these three values are exposed through snmp. The first step is to tell the SNMP daemon that the script has an associated MIB. This is done in the configuration file, usually located at <em>/etc/snmp/snmp.d</em>. The following line attaches the script [for example /home/user/myscript.sh] execution to a certain OID:</p>
<pre>exec .1.3.6.1.4.1.111111.1 MySQLParameters /home/user/myscript.sh</pre>
<p align="left">the &#8216;.1.3.6.1.4.1.111111.1&#8242; OID is a branch of &#8216;.1.3.6.1.4.1&#8242; [meaning '.iso.org.dod.internet.private.enterprises']. We tried to make it look &#8216;legitimate&#8217; but obviously you can use here any sequence you want to.</p>
<p align="left">After restarting the daemon, let&#8217;s interrogate Mibbrowser for the freshly created OID, see the following image <em>snmpwalk -Os -c [community_name] -v 1 [hostname] .1.3.6.1.4.1.111111.1</em> ; the result is:</p>
<pre>enterprises.111111.1.1.1 = INTEGER: 1
enterprises.111111.1.2.1 = STRING: "MySQLParameters"
enterprises.111111.1.3.1 = STRING: "/etc/snmp/mysql_params.sh"
enterprises.111111.1.100.1 = INTEGER: 0
enterprises.111111.1.101.1 = STRING: "0.900000"
enterprises.111111.1.101.2 = STRING: "18551"
enterprises.111111.1.101.3 = STRING: "108"
enterprises.111111.1.102.1 = INTEGER: 0
enterprises.111111.1.103.1 = ""</pre>
<p align="left">Great ! Now we have the proof that it really works and our specific values extracted with a custom script are visible through SNMP. Let&#8217;s go back to Cacti and see how we can make some nice charts out of them<a title="sc5" name="sc5" href="#sn5"><sup>5</sup></a>.</p>
<p align="left">Cacti has this nice feature of defining &#8216;templates&#8217; that you can reuse afterwards. My strategy is to define a data template for each one of the 3 parameters I want to chart, using the &#8216;Duplicate&#8217; function applied to the &#8216;SNMP &#8211; Generic OID Template&#8217;.</p>
<p style="text-align: center"><img src="http://www.netuality.ro/wp-content/uploads/2008/01/snmp2.gif" alt="" width="501" height="48" /></p>
<p align="left">On the duplicate datasource template, you have to change the datasource title, name to display in charts, data source type [use DERIVE for incremental counters and GAUGE for instantaneous values], specific OID and the snmp community. Do it for the three values.</p>
<p style="text-align: center"><img src="http://www.netuality.ro/wp-content/uploads/2008/01/snmp3.gif" alt="" width="500" height="172" /></p>
<p align="left">Using the three new datasource templates, create a chart template for &#8216;MySQL Activity&#8217;. That&#8217;s a bit more complicated, but it boils down to the following procedure, repeated for each of the 3 data sources:</p>
<ul>
<li>add a data source and associate a graph [I always use AREA for the first graph as a background and LINE3 for the other, but it's just a matter of taste]</li>
<li>associate labels with current or computed values: CURRENT, AVERAGE, MAX in this example</li>
</ul>
<p>All the rest is really fine tuning &#8211; deciding for better colors, wether to use autoscale or fixed scale and so on. By now, your graph template should be ready to use.</p>
<p style="text-align: center"><img src="http://www.netuality.ro/wp-content/uploads/2008/01/snmp4.gif" alt="" width="501" height="352" /></p>
<p align="left">Note that for the incremental values ['DERIVE' type data sources] I&#8217;ve used titles such as &#8216;Thousands queries/5 min&#8217; &#8211; the 5 minutes come from the Cacti poller which is set to query for data each 5 minutes. The end result is something like this one :</p>
<p style="text-align: center"><img src="http://www.netuality.ro/wp-content/uploads/2008/01/snmp5.gif" alt="" width="500" height="199" /></p>
<p align="left">On this real production chart you&#8217;ll see a few interesting patterns. For instance, at 3 o&#8217;clock in the morning, there is a huge spike in all the charted parameters &#8211; indeed, a cron&#8217;ed script was provoking this spike. From time to time, a small burst of slow queries is recorded &#8211; still under investigation. What is interesting here is that these spikes were previously undetectable on the load average chart, which look clean and innocuous:</p>
<p style="text-align: center"><img src="http://www.netuality.ro/wp-content/uploads/2008/01/snmp6.gif" alt="" width="501" height="220" /></p>
<p align="left">To conclude, SNMP is a valuable resource for server performance monitoring. Often, investigating specific parameters and displaying them in tools such as Cacti can bring interesting insights upon the behavior of servers.</p>
<p align="left">Some SNMP implementations in different programming languages:</p>
<ul>
<li>Java:  <a href="http://snmp.westhawk.co.uk/" target="_new">Westhawk&#8217;s Java SNMP stack</a> [free w commercial support], <a href="http://snmp.adventnet.com/index.html" target="_new">AdventNet SNMP API</a> [commercial, with a feature-restricted un-expiring free version], <a href="http://www.ireasoning.com/snmpapi.shtml" target="_new">iREASONING SNMP API</a> [commercial implementation], <a href="http://www.snmp4j.org/" target="_new">SNMP4J</a> [free and feature-rich implementation - thank you Mathias for the tip]</li>
<li>PHP: client-only supported by the php-snmp extension, <a href="http://ro.php.net/manual/en/ref.snmp.php" target="_new">part of</a> the PHP distribution [free]</li>
<li>Python: <a href="http://pysnmp.sourceforge.net/" target="_new">PySNMP</a> is a Python SNMP framework, client+agents [free].</li>
<li>Ruby: client-only implementation <a href="http://snmplib.rubyforge.org/" target="_new">Ruby SNMP</a> [free]</li>
</ul>
<p><a title="sn1" name="sn1" href="#sc1"><sup>1</sup></a> If you&#8217;re running Debian, Cacti comes with apt so it&#8217;s a breeze to install and run [<em>apt-get install cacti</em>]</p>
<p><a title="sn2" name="sn2" href="#sc2"><sup>2</sup></a> a bit out of the scope of this article, SNMP also allows writing values on remote servers, not only retrieving monitored values.</p>
<p><a title="sn3" name="sn3" href="#sc3"><sup>3</sup></a> Replace [hostname] with the server hostname and [community_name] with the SNMP community &#8211; default being &#8216;public&#8217;. The SNMP community is a way of authenticating a client to a SNMP server; although the system can be used for pretty sophisticated stuff, most of the time the servers have a read-only passwordless community, visible only in the internal network for monitoring purposes.</p>
<p><a title="sn4" name="sn4" href="#sc4"><sup>4</sup></a> In fact, a commercial implementation of SNMP for MySQL does exist.</p>
<p><a title="sn5" name="sn5" href="#sc5"><sup>5</sup></a> The procedure described here applies to Cacti v0.8.6.c</p>
]]></content:encoded>
			<wfw:commentRss>http://www.netuality.ro/monitor-everything-on-your-linux-servers-with-snmp-and-cacti/tools/20060305/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Aggregating webservers logs for an Apache cluster</title>
		<link>http://www.netuality.ro/aggregating-webservers-logs-for-an-apache-cluster/tools/20050925</link>
		<comments>http://www.netuality.ro/aggregating-webservers-logs-for-an-apache-cluster/tools/20050925#comments</comments>
		<pubDate>Sun, 25 Sep 2005 17:20:11 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[j2ee]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.netoo.loco/aggregating-webservers-logs-for-an-apache-cluster/uncategorized/20050925</guid>
		<description><![CDATA[One of the ways of scaling a heavy-traffic LAMP web application is to transform the server into a cluster of servers. Some may opt to walk on the easy path by using an overpriced appliance load balancer, but the most daring [and budget-restrained] will go for free software solutions such as pound or haproxy. Although [...]]]></description>
			<content:encoded><![CDATA[<p>One of the ways of scaling a heavy-traffic LAMP web application is to transform the server into a cluster of servers. Some may opt to walk on the easy path by using an overpriced appliance load balancer, but the most daring [and budget-restrained] will go for free software solutions such as <a href="http://www.apsis.ch/pound/" target="_new">pound</a> or <a href="http://w.ods.org/tools/haproxy/" target="_new">haproxy</a>.</p>
<p>Although excellent performers, these free balancers have lots of missing features when compared with counterpart commercial solutions. One of the most embarrassing misses is the lack of flexibility in producing decent access logs. Both pound (<em>LogLevel 4</em>) and haproxy (<em>option httplog</em>) may generate Apache-like logs in their logfiles or the syslog, however none offers the level of customization encountered in Apache. Basically, you&apos;re left with using the logs from the cluster nodes. These logs present a couple of problems:</p>
<ul>
<li>the originating IP is always the internal IP of the balancer</li>
<li>there is one log/node, while log analysis tools can usually cope with a single log file/report</li>
</ul>
<p>First problem is relatively easy to solve. Start by activating the X-Forwarded-For header in the balancing software : for instance configuring haproxy with <em>option forwardfor</em>. A relatively unknown Apache module called <a href="http://stderr.net/apache/rpaf/" target="_new">mod_rpaf</a> will solve the tedious task of extracting the remote IP from X-Forwarded-For header and copying it in the remote address field of Apache logs. For Debian Linux fans, it&apos;s nice to note that <em>libapache-mod-rpaf</em> is available via apt.</p>
<p>Now that you have N realistic Apache weblogs, 1 per cluster node, you just have to concatenate and put them in a form understandable by your log analysis tools. Just simply <em>cat</em>-ing them in a big file, won&apos;t cut it [arf] because new records will appear in different regions of the file instead of appending chronologically to its tail. The easiest solution in that case is to perform a <a href="http://www.ss64.com/bash/sort.html" target="_new">sort</a> on these logs. Although I am aware of the vague possibility of sorting on the Apache datetime field, even taking the locale into account, I confess my profound inability of finding the right combination of parameters. Instead, I choose to add a custom field in the Apache log; using the following log format:</p>
<pre>

LogFormat "%h %V %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{Cookie}i\" %c %T \"%{%Y%m%d%H%M%S}t\"" combined
</pre>
<p>where <em>%{%Y%m%d%H%M%S}t</em> is a standard projection of current datetime in an easily sortable integer, like for instance 20050925120000 &#8211; equivalent of 25 Sep 2005 12:00:00. Now, considering the quote as a separator in the Apache log format, is easy to sort upon this custom field [the 10th]:</p>
<pre>
sort -b -t "\"" -T /opt -k 10 /logpath/access?.log > /logpath/full.log
</pre>
<p>And there you are, having this nice huge log file to munch on. On a standard P4 with 1GB of RAM it takes less than a minute to obtain a 2GB log file&#8230;
</p>
<p>In case the web traffic is really big and log analysis process impacts the existing web activity, use a separate machine instead of overloading one of the cluster nodes. For automated transfer of log files, generate <a href="http://www.phy.bnl.gov/computing/gateway/ssh-agent.html" target="_new">ssh keys</a> on all the cluster nodes for paswordless login from the web analytics server in the web logfiles owner account. Minimization of traffic between these machines is done by installing rsync on them and them using rsync via ssh:</p>
<pre>
rsync -e ssh -Cavz www-data@node1:/var/log/apache/access.log /logpath/access1.log
</pre>
<p>Now, you know all the steps required to fully automate the log aggregation and its processing. One may ask why all the fuss when in fact a simple subscription to a ASP style web analytics provider should suffice. Yes, it&apos;s true however&#8230; The cluster that I&apos;ve recently configured with this procedure has a few million hits per week. Yes, we&apos;re talking about page hits. At this level of traffic, the cost for a web analytics service starts from 10.000$/year. It&apos;s certainly a nice amount of money, which will allow you to afford your own analytics tool [such as for instance <a href="http://www.urchin.com/products/v5/index.html" target="_new">Urchin v5</a>] and keep some cash from the first year. Some might say that this kind of commercial tools have their own load balancer analysis techniques. Sure, but it all comes with a cost. In the case of Urchin, you just saved 695$/node and some bragging rights with your mates. Relax and enjoy.</p>
<p>PS: Yes we&apos;re talking millions of page hits LAMP solution not J2EE&#8230; Maybe I&apos;ll get into details on another occasion, assuming that somebody is interested. Leave a comment, send a mail or something.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.netuality.ro/aggregating-webservers-logs-for-an-apache-cluster/tools/20050925/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sybase woes &#8211; and Jython saves the day</title>
		<link>http://www.netuality.ro/sybase-woes-and-jython-saves-the-day/tools/20050202</link>
		<comments>http://www.netuality.ro/sybase-woes-and-jython-saves-the-day/tools/20050202#comments</comments>
		<pubDate>Wed, 02 Feb 2005 05:19:55 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.netoo.loco/sybase-woes-and-jython-saves-the-day/uncategorized/20050202</guid>
		<description><![CDATA[Until now, I&apos;ve always had a certain respect for Sybase database. Based on their history, I thought that the product is a sort of MS SQL without the glitzy features &#8211; think Las Vegas without the lights, the cowboy boots and Eiffel Tower. Which gives: huge crowds of fat tourists in tall, dull buildings. But [...]]]></description>
			<content:encoded><![CDATA[<p>Until now, I&apos;ve always had a certain respect for Sybase database.<br />
Based on their history, I thought that the product is a sort of MS SQL<br />
without the glitzy features &#8211; think Las Vegas without the lights, the cowboy boots and Eiffel Tower. Which gives: huge crowds of fat tourists in tall, dull buildings. But you always have Celine Dion, right ?*</p>
<p>Wrong ! Sybase ASE is a large, enormous, huge piece of steaming &#8230;<br />
ummm &#8230; code. Ok, ok, I&apos;m a bit over-reacting. In fact, Sybase is a<br />
very good database &#8211; if you are still living in the 90s and the only<br />
Linux flavour that you are able to manage is RedHat ASE. Otherwise,<br />
it&apos;s a huge &#8230; you know.</p>
<p>Let&apos;s not talk about the extreme fragility of this &#8230; this product.<br />
You never know when it crashes on you without any specific reason.<br />
Sometimes, it&apos;s the bad weather. Crash. Restart. Sometimes, you<br />
flushed twice. Crash. Restart. And maybe, yes maybe, you spent more<br />
than 12 minutes in your lunch break. Crash.</p>
<p>Let&apos;s just talk about the JDBC drivers &#8211; latest version, downloaded<br />
from the site in a temporary moment of insanity. Man, this is cutting<br />
edge. The sharpest cutting edge you&apos;ll ever find &#8211; the more advanced<br />
JDBC drivers bar none ! Excepting of course the fact that these<br />
classes were compiled in that memorable day of 6 January 2002 [the day<br />
when the last Sybase JDBC drivers were compiled]. But, don&apos;t let such<br />
obscure details ruining your enthusiasm. Just download and use them<br />
and you&apos;ll be amazed at their unique features &#8211; it&apos;s the only JDBC<br />
driver which manages to put down DbVisualizer in different and<br />
innovative ways. I&apos;m restarting the poor thing (dbvis) at least 2 or 3<br />
times per day, when working with Sybase.</p>
<p>Also, as a little quasi-undocumented tip, the letter <em>d</em> from<br />
jconn2d.jar does not mean <em>development</em> [drivers] as some of you would be<br />
inclined to think. In fact, it means <em>debug</em> which is the<br />
abbreviation for <em>put me in production poor lousy bastard and I&apos;ll<br />
start spewing reams of useless messages through all the logging APIs<br />
known by man and a few yet to be discovered, therefore instantly<br />
slowing down to a crawl your puny little software</em>.</p>
<p>Ermmm &#8230; well, all this nice introduction just to humbly confess that<br />
we do have a couple of them Sybase licences floating around here and<br />
some of our production databases are on Sybase ASE. While I can assure<br />
you that this is going to change at least on the web backend, it&apos;s<br />
also true that the beast must be alive in order to keep our company up<br />
and running. And, that&apos;s part of my job.</p>
<p>Which is of course very strange for an IT management job. But then again:<br />
when your sole DBA is overwhelmed by a horde of Sybase-specific tasks<br />
(like for instance the log configured to truncate at a specific<br />
threshold which naturally [for Sybase] does not truncate, suddenly<br />
throwing all the users into log suspend in the middle of the peak<br />
production time) &#8211; you have to enter into the damn kitchen and do some<br />
cooking !
<p>My endeavour was to perform simple data mining in order to migrate<br />
some reports from a legacy system [no, you don&apos;t really want to know<br />
what system]. Due to my limited time, starting a mildly complex Java<br />
reporting project was out of the question, so a scripting language was<br />
the natural choice. Python being the first option &#8211; unfortunately,<br />
finding a working Sybase driver for Python is a challenge in itself.<br />
But, thank God for Jython and zxJDBC ! In just a few minutes I was<br />
wiring the tables for reporting. Here&apos;s a fake code snippet which lists the &apos;orders&apos; with amounts < 1000, and you can&apos;t go any simpler:</p>
<pre>
from com.ziclix.python.sql import zxJDBC 

conn = zxJDBC.connect("jdbc:sybase:Tds:myserver.mydomain.com:4110/mydb",\
	"user","pass","com.sybase.jdbc2.jdbc.SybDriver")
cursor = conn.cursor() 

cursor.execute("select count(orderid) from orders")
nb_orders=cursor.fetchone()[0]
print &apos;%.0f total orders ...&apos;%(nb_orders,)

cursor.execute("select orderid, amount from orders where amount <1000")
oids=cursor.fetchall()
for o in oids:
	print &apos;Order %.0f for amount %.2f&apos;%(o[0],o[1])

cursor.close()
conn.close()
</pre>
<p>Easy as pie. And once you got one down, you got&apos;em all. For instance,<br />
yesterday evening I wrote in about an hour a small Jython script which<br />
exports some data. The same export process (running about an order of<br />
magnitude slower) needed previously a couple days of development in<br />
FoxPro. Ah, FoxPro - very juicy subject, but I&apos;ll keep it for my next<br />
horror story. Until then, don&apos;t forget, when you have a monster to<br />
tame and no time at all: try Jython !</p>
<p>*Let&apos;s suppose for a very brief instant that having Celine Dion at a certain location is a positive thing.</br></p>
]]></content:encoded>
			<wfw:commentRss>http://www.netuality.ro/sybase-woes-and-jython-saves-the-day/tools/20050202/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>(Almost) distributed CVS with Eclipse</title>
		<link>http://www.netuality.ro/almost-distributed-cvs-with-eclipse/tools/20040602</link>
		<comments>http://www.netuality.ro/almost-distributed-cvs-with-eclipse/tools/20040602#comments</comments>
		<pubDate>Wed, 02 Jun 2004 10:44:17 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[France]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[velocity]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.netoo.loco/almost-distributed-cvs-with-eclipse/uncategorized/20040602</guid>
		<description><![CDATA[NOTE : unfortunately, this trick is again unavailable starting with Eclipsev3M9, the last version which made that possible was v3M8 In Eclipse 3.0, in the CVS repository properties it is possible to separate the &apos;read&apos; and &apos;write&apos; access locations (see picture). AFAIK, this feature was meant for developers using extssh for CVS connection. They would [...]]]></description>
			<content:encoded><![CDATA[<p><strong>NOTE : unfortunately, this trick is again unavailable starting with Eclipsev3M9, the last version which made that possible was v3M8</strong><br />
<center><br />
<table>
<tr>
<td><img src="http://www.jroller.com/resources/aspinei/districvs.gif" align="left"/></td>
</tr>
</table>
<p></center><br />
In Eclipse 3.0, in the CVS repository properties it is possible to separate the &apos;read&apos; and &apos;write&apos; access locations (see picture). AFAIK, this feature was meant for developers using extssh for CVS connection. They would use an anonymous account for updates in &apos;clear&apos;, and their respective accounts for commits over encrypted link. The basic idea is that clear connections are considerably faster than encrypted ones. However, you may change the whole connection string, not only the login and protocol, thus enabling the usage of two completely different repositories for &apos;read&apos; and &apos;write&apos; actions on CVS.<br/><br />
This might come handy in situations like the one we&apos;ve recently been confronted with, in my team. The main CVS repository is located at a certain geographical distance (in the headquarters, in France) and the VPN bandwidth is nothing to brag about. Working with CVS was decent, but things have started to got meaner lately, mainly because of three reasons:<br/></p>
<ul>
<li>both teams have grown = more activity on the repository,</li>
<li>vast majority of developers is integrating frequently, aka every little bit of functionality is committed as soon as it&apos;s stable and working. Of course, before committing, there&apos;s the mandatory update to check for consistency against the most recent codebase. This means that at least a few synchronizations will be performed by each member of the team, each day.</li>
<li>Code generators. It&apos;s true that common sense dictates that nothing generated should be stored in CVS, because this may be source of frequent conflicts and loads the repository in an inefficient manner. However, when one routine generation (for each of the few modules) may take between 3 and 10 minutes and produces thousands of files, it becomes pretty obvious that it should not become part of the build process. What gives : in the days when the model has some important changes, a few different subsequent versions of 3-15MB jar files are committed on the repository. Update process starts to slow down and soon a part of the team is lagging, waiting to download the update. The irony is that usually everybody is downloading slowly and inefficiently the SAME big file. Of course, there are also other kinds of traffic via the VPN, such as Netmeeting (but you can&apos;t really have a conversation when everybody in the team is updating the codebase and slows the VPN to a crawl).</li>
</ul>
<p>This boils down to having a &apos;read-only&apos; local repository, perfect mirror of the main CVS server, which will be used only for updates. Both the server and its mirror are Linuxes. My choice for mirroring was good old <a HREF="http://samba.anu.edu.au/rsync/" target="_new">rsync</a>. While <a HREF="http://www.cvsup.org/" target="_new">cvsup</a> seems to be all the rage nowadays, I headed towards rsync because a) it comes pre-installed within any decent Linux distro and b) I am using Gentoo on my home desktop, so rsync is a tool that I learned to use [and abuse] almost daily, via portage.<br/><br />
We won&apos;t lose a lot of time explaining how to set up an rsync server, since it&apos;s very well explained in this rather old but useful <a HREF="http://everythinglinux.org/rsync/" target="_new">tutorial</a>. There&apos;s just a small twist : we were planning to synchronize frequently so we ran rsync daemon independently, not via xinetd. The config file on the server:<br/></p>
<table>
<tr>
<td bgcolor="#dddddd">
<pre>
2;root@dev  /etc> more rsyncd.conf<br/>
motd file = /etc/rsyncd.motd<br/>
log file = /var/log/rsyncd.log<br/>
pid file = /var/run/rsyncd.pid<br/>
lock file = /var/run/rsync.lock<br/>
<br/>
[cvs]<br/>
   path = /opt/cvsroot<br/>
   comment = CVS Rsync Server<br/>
   uid = nobody<br/>
   gid = nobody<br/>
   read only = yes<br/>
   list = yes<br/>
   hosts allow = 10.0.10.100/255.255.255.0<br/>
</pre>
</td>
</tr>
</table>
<p>is a classical read-only, anonymous (we&apos;re on VPN, right ?) mirroring setup. Next step is making a rsync service in /etc/init.d or appending the line &#8220;/usr/bin/rsync &#8211;daemon&#8221; to /etc/rc.d/rc.local, to be sure that the daemon restarts after reboot [especially when you are NOT administrating the server].<br/><br />
On the client, there are some small tricks to make it work. First one, setup your client CVS repository in the same location as on the server, &apos;/opt/cvsroot&apos; in our case (because you are going to synchro CVSROOT as well, which contains absolute paths in some if its files).<br/><br />
The mirroring script is something in the spirit of:<br/></p>
<table>
<tr>
<td bgcolor="#dddddd">
<pre>
<span style=&apos;color:#3f7f59; &apos;>#!/bin/bash</span><br/>
<br/>
source /etc/profile<br/>
<span style=&apos;color:#7f0055; font-weight:bold; &apos;>cd</span> /opt/cvsroot<br/>
<br/>
RUN=<span style=&apos;color:#2a00ff; &apos;>`ps x | grep rsync | grep -v grep | wc -l`</span><br/>
<span style=&apos;color:#7f0055; font-weight:bold; &apos;>if</span> [ "$RUN" -gt 0 ]; <span style=&apos;color:#7f0055; font-weight:bold; &apos;>then</span><br/>
    <span style=&apos;color:#3f7f59; &apos;>#already running</span><br/>
    <span style=&apos;color:#7f0055; font-weight:bold; &apos;>exit</span> 1<br/>
<span style=&apos;color:#7f0055; font-weight:bold; &apos;>fi</span><br/>
<br/>
rsync -azv --stats 10.0.3.193::cvs/CVSROOT/<span style=&apos;color:#7f0055; font-weight:bold; &apos;>history</span> /home/cvs/<span style=&apos;color:#7f0055; font-weight:bold; &apos;>history</span> >/tmp/histo<br/>
<br/>
sum1=<span style=&apos;color:#2a00ff; &apos;>`sum /home/cvs/history`</span><br/>
sum2=<span style=&apos;color:#2a00ff; &apos;>`sum /opt/cvsroot/CVSROOT/history`</span><br/>
<br/>
<span style=&apos;color:#7f0055; font-weight:bold; &apos;>if</span> [ "$sum1" = "$sum2" ]; <span style=&apos;color:#7f0055; font-weight:bold; &apos;>then</span><br/>
    <span style=&apos;color:#3f7f59; &apos;>#nothing to do</span><br/>
    date > /tmp/empty<br/>
    <span style=&apos;color:#7f0055; font-weight:bold; &apos;>exit</span> 0<br/>
<span style=&apos;color:#7f0055; font-weight:bold; &apos;>fi</span><br/>
<br/>
date > /tmp/started<br/>
cat /dev/null > /tmp/ended<br/>
rsync -azv --stats --delete --force 10.0.3.193::cvs /opt/cvsroot > /tmp/status<br/>
<span style=&apos;color:#7f0055; font-weight:bold; &apos;>cd</span> /opt<br/>
date > /tmp/ended<br/>
</pre>
<p><br/>
</td>
</tr>
</table>
<p>This (badly written) script is heavily inspired from a script found on a Debian user mailing list:</p>
<ul>
<li>exits in the case of a long running rsync process</li>
<li>assures that the full rsync is triggered by changes in CVSROOT/history. This is a neat trick which minimizes the server activity if you are syncing frequently, as we will do.</li>
<li>outputs stuff in some files in the /tmp directory. This has a double purpose. First is avoiding root mailbox pollution (because we&apos;re &apos;cron-ing&apos; it, the output will be visible as a few hundreds of mails each day). Second is providing data for a web page on the client machine which tells at a glance what is the synchronization status. AFAIK rsync will not write incomplete files, but the usual sound advice is to make an update <em>between</em> successive synchronizations.</li>
</ul>
<p>The small &apos;synchronization status&apos; page (left as an exercise for the reader <img src='http://www.netuality.ro/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ) just prints the dates and the last few lines of the output files; this is a dumbed-down sample :<br/></p>
<table>
<tr>
<td bgcolor="#dddddd">
CVS synchronization started at Mon Feb 23 09:45:18 EET 2004<br />
, ended at <b>Mon Feb 23 09:46:00 EET 2004<br />
</b><br/>Last empty synchronization recorded at <b>Mon Feb 23 09:40:05 EET 2004<br />
</b><br/>No knowledge about recent deleted files<br/><br />
<table bgcolor="#CCCCCC">
<tr>
<th>Last synchronized
<th></tr>
<tr>
<td align="center">_/modules/postpreparation/tools/</td>
</tr>
<tr>
<td align="center">_/modules/postpreparation/tools/velocity/</td>
</tr>
<tr>
<td align="center">_/gateway/</td>
</tr>
<tr>
<td align="center">_/src/mailer/</td>
</tr>
<tr>
<td align="center">_/src/old/</td>
</tr>
<tr>
<td align="center">_/src/tools/</td>
</tr>
<tr>
<td align="center">_/src/tools/Attic/</td>
</tr>
<tr>
<td align="center">_/tools/</td>
</tr>
<tr>
<td align="center">CVSROOT/history</td>
</tr>
<tr>
<td align="center">wrote 60767 bytes  read 471522 bytes  13142.94 bytes/sec</td>
</tr>
</table>
<table bgcolor="#CCAAAA">
<tr>
<th>Last added files
<th></tr>
<tr>
<td align="center">_/ihm/AlignementChamps.java,v</td>
</tr>
</table>
</td>
</tr>
</table>
<p>The only step left is to create a file in cron.d containing the line:<br/><br />
<strong>0-59/5 7-23 * * * cvs your_mirroring_script.sh</strong><br/><br />
(meaning sychronization each 5 minutes from 07:00 to 23:00) and you may start enjoying blazingly fast CVS updates in Eclipse.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.netuality.ro/almost-distributed-cvs-with-eclipse/tools/20040602/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Re: Where are all the SWT applications?</title>
		<link>http://www.netuality.ro/re-where-are-all-the-swt-applications/tools/20040404</link>
		<comments>http://www.netuality.ro/re-where-are-all-the-swt-applications/tools/20040404#comments</comments>
		<pubDate>Sun, 04 Apr 2004 06:52:41 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.netoo.loco/re-where-are-all-the-swt-applications/uncategorized/20040404</guid>
		<description><![CDATA[Mr. Jesus M. Rodriguez asked fellow Java bloggers where are all those SWT apps. Here&apos;s a possible answer. First, do not forget that Eclipse is a big ecosystem. There are a bunch of software development shops making a living from selling Eclipse plugins : Omondo, Genuitec, Instantiations, Exadel, etc. Add here the vast majority of [...]]]></description>
			<content:encoded><![CDATA[<p>Mr. <a HREF="http://jroller.com/comments/jmrodri?anchor=where_are_all_the_swt" target="_new">Jesus M. Rodriguez</a> asked fellow Java bloggers <em>where are all those SWT apps</em>. Here&apos;s a possible answer.<br/><br />
First, do  not forget that Eclipse is a big ecosystem. There are a bunch of software development shops making a living from selling Eclipse plugins : Omondo, Genuitec, Instantiations, Exadel, etc. Add here the vast majority of the older/bigger tool producers (such as Borland/Together, Visual Paradigm &#8230;) which ported their products as Eclipse plugins. Count also important product suites from (of course) IBM (WSDD, Rational, etc.), (for sure) Lotus and (surprise ?) <a HREF="http://www.novell.com/news/press/archive/2004/01/pr04011.html" target="_new">Novell</a> and <a HREF="http://help.sap.com/sapdocu/netweaver/webas/630/helpdata/EN/5c/ad505250c25945b62c3043508dfa38/content.htm" target="_new">SAP</a>. There is life in here and a great deal of it is due to SWT. There are a few strange Swingonian hybrids, but most of the plugins and products are purely SWT-based.<br/><br />
SWT is still young, so unfortunately there are only a few interesting opensourced projects based on SWT. Among them there&apos;s <a HREF="http://azureus.sourceforge.net" target="_new">Azureus</a>, a BitTorrent client which is consistently in the top 5 downloads at SourceForge. I have noticed an interesting fact : Azureus is THE ONLY desktop Java app (which is not an IDE or a development tool) and which I consistently find installed on different systems (friends, coworkers). Add to the list <a HREF="http://sancho-gui.sourceforge.net" target="_new">Sancho</a>, a P2P multiprotocol client, <a HREF="http://sqladmin.sourceforge.net/" target="_new">SQLAdmin</a> another rdb administration tool and <a HREF="http://rssowl.sourceforge.net/" target="_new">RSSOwl</a> plain simple RSS feedreader. These are all decent performing apps and their sources are ripe for grabbing and inspiration.<br/><br />
But this is just the tip of the iceberg. The Eclipse newsgroups are full of people discussing RCP development strategies and asking SWT questions. And &#8211; you know &#8211; they&apos;re not all unemployed ex-dotcommers with Yahoo emails. But let&apos;s not make speculations about people email addresses &#8211; let&apos;s just look at an interesting <strong>existing</strong> product : <a HREF="http://www.gdfsuite.de/" target="_new">GDFSuite</a> is a whole suite/platform targeted at geobusiness applications. In their <a HREF="http://www.eclipsecon.org/program-d.htm#ger_weg" target="_new">presentation</a> from EclipseCon 2004, Frank Gerhardt (SENS) and Chris Wege (DaimlerChrysler AG) shared a few development experiences related with GDFSuite rich client, built upon the Eclipse platform. I bet there are a few other important RCP-based products which will be announced during 2004.<br/><br />
Last, but not least, I have some personal experience to share as well. My current employer sells a production supervision tool targeted at food industry, with a SWT-based rich client. When I say &#8220;sells&#8221; I mean &#8220;already sold quite a few licenses and currently successfully installing at big customers&#8221;. The SWT-client is deployed in its Motif version on P3/500Mhz machines running Linux. It&apos;s fast and slick. It&apos;s not very aesthetically pleasing and you can not play Solitaire on it, but this doesn&apos;t seem to interest the guys cutting meat or the girls which are inspecting the barcodes on the package of your next 1.99$ steak. Some other SWT-based products are undergoing development in our Java department, but of course they are really really really secret, they will be announced as soon as they are ready and they&apos;ll kick some serious ass <img src='http://www.netuality.ro/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  There are probably quite a lot of other companies capitalizing on SWT to make fast (or &apos;rich&apos;) clients for their commercial products.<br/><br />
Swing is beautiful. Swing is conceived with MVC in mind. Swing has Jgoodies. Swing is also slowly-moving and memory-bulimic. When all I have to do is a simple interface with a text displayed in big fonts and a &#8220;Print barcode&#8221; button, does it really have to pass through 10 nested layers of  listeners ? What shall I do with Swing on a CPU-handicapped computer in production environment, where 200ms is considered a big delay ? But of course, if you want intellectual challenges and nicely architectured clients, go for Swing. If all you need is to be efficient and please the customer, take SWT for a ride.<br/><br />
I know, I know &#8211; I may sound like the VB advocates a few years ago. But it&apos;s not the point. It&apos;s a matter of doing the right compromise between a rich functional API and a simple fast API, between generalization and the need for custom coding. My opinion is that Swing has &#8211; for the moment &#8211; failed to reach the good compromise. SWT it&apos;s just the next candidate.<br/><br />
PS <a HREF="http://herzberg.ca.sandia.gov/jess" target="_new">Jess</a> is a dual-licensed inference engine for Java. The next version (7 aka &apos;Charlemagne&apos;) includes an <a HREF="http://herzberg.ca.sandia.gov/jess/devlog.shtml" target="_new">Eclipse-based IDE</a>. Unfortunately, not being a licensed Jess user I do not have access to latest beta versions. Maybe somebody could shed some light upon this question.<br/><br />
PPS There&apos;s some more stuff at <a HREF="http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-swt-home/external.html" target="_new">SWT Community Page</a><br/><br />
PPPS A bit of history : Swing (JFC) was made public in april 1997. SWT became available to developers, along with the Eclipse donation, in november 2001.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.netuality.ro/re-where-are-all-the-swt-applications/tools/20040404/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eclipse 2.1 workspace deadlock &#8211; and a dirty but small workaround</title>
		<link>http://www.netuality.ro/eclipse-21-workspace-deadlock-and-a-dirty-but-small-workaround/tools/20040301</link>
		<comments>http://www.netuality.ro/eclipse-21-workspace-deadlock-and-a-dirty-but-small-workaround/tools/20040301#comments</comments>
		<pubDate>Mon, 01 Mar 2004 14:21:51 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.netoo.loco/eclipse-21-workspace-deadlock-and-a-dirty-but-small-workaround/uncategorized/20040301</guid>
		<description><![CDATA[It happened also on older versions but it does happen more frequently on the &#8220;final&#8221; 2.1 version. FYI : Gentoo Linux, Eclipse gtk, seems to be related somehow with bug 33138 (don&apos;t have the time to dig further). Sometimes the monster simply hangs during a [take your pick : refactoring, new class generation] with an [...]]]></description>
			<content:encoded><![CDATA[<p>It happened also on older versions but it does happen more frequently on the &#8220;final&#8221; 2.1 version. FYI : Gentoo Linux, Eclipse gtk, seems to be related somehow with bug 33138 (don&apos;t have the time to dig further).<br />
Sometimes the monster simply hangs during a [take your pick : refactoring, new class generation] with an empty progress bar in the dialog box and a completely useless &#8220;Cancel&#8221; button. Been there, done that : kill -9 &#8230;<br />
Then, trying to re-start Eclipse leads to a deadlock &#8211; while recovering workspace : dialog box, empty progress bar and useless &#8220;Cancel&#8221;. Freezed !<br />
I have a lot of settings and projects so deleting the whole .metadata directory is just too painful. Therefore, I had to find out a smaller workaround : just delete the file <strong>.metadata/.plugins/org.eclipse.ui.workbench/workbench.xml</strong> and Eclipse restarts with a clean workspace. Some adjustments are lost but hey &#8211; my metadata is still there.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.netuality.ro/eclipse-21-workspace-deadlock-and-a-dirty-but-small-workaround/tools/20040301/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using jython to internationalize a PHP app</title>
		<link>http://www.netuality.ro/using-jython-to-internationalize-a-php-app/tools/20040301</link>
		<comments>http://www.netuality.ro/using-jython-to-internationalize-a-php-app/tools/20040301#comments</comments>
		<pubDate>Mon, 01 Mar 2004 14:20:01 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.netoo.loco/using-jython-to-internationalize-a-php-app/uncategorized/20040301</guid>
		<description><![CDATA[At first, this might seem a mind-boggling combination. What do jython and PHP have in common (excepting the fact that I am a Python fan and my current consulting task is in a PHP project) ? Well, internationalizing a PHP app is pretty much a trivial task. If you are a sensible PHP programmer insisting [...]]]></description>
			<content:encoded><![CDATA[<p>At first, this might seem a mind-boggling combination. What do<br />
<a href="http://www.jython.org/" target="_new"> jython</a> and PHP have in common (excepting the fact that I am a Python fan<br />
and my current consulting task is in a PHP project) ?<br />
Well, internationalizing a PHP app is pretty much a trivial task.<br />
If you are a sensible PHP programmer insisting to use PEAR instead of randomly choosing a script from the tons of snippets<br />
populating the &#8220;scripting websites&#8221;, <a href="http://pear.php.net/package-info.php?pacid=129" target="_new">I18N</a> is probably the<br />
safest choice.<br />
Maybe &#8211; for you &#8211; application maintainability and performance are not exactly important concerns.<br />
For me, they are. This is why I chose to store internationalized texts in files rather than database.<br />
I&apos;d rather keep the database for real data, which is created, modified, aggregated and such.<br />
And I&apos;d rather like to have an internationalized error message on the screen even if the database is down.<br />
Now we know that we&apos;ll use I18N and text will be kept in some php files. However, I am no professional translator and<br />
have no desire to translate or to manually maintain the correspondence between translators files and PHP files<br />
(no, translators won&apos;t modify PHP code, stop this nonsense right away).<br />
Code generation comes immediately in mind.<br />
Basically, my first idea was to investigate wether the files used by the translators can be quickly transformed to PHP,<br />
and if I am able to generate their formats from my own files (aka. &#8220;roundtrip internationalization process&#8221; ?).<br />
Unfortunately, this is not an easy task &#8211; as the only clue was that the translators use Office tools such as Word or Excel, because they<br />
rely upon some specialized translation software integrated with these products.<br />
The easy choice is Excel, since it allows a better organization of data than having to search for tables in a Word document.<br />
The hard choice is the tool that I&apos;d use for automatically reading and even generating Excel files.<br />
<br />
The difficulty comes from the fact I don&apos;t have Windows with Office installed on my desktop, just Gentoo Linux and OpenOffice.<br />
Thus, I am unable to write a simple Python script which could perform my generation tasks via automation.<br />
Fortunately, this is not the first time I am confronted with the issue.<br />
I happen to know that there is a very nice Java tool that I wholeheartedly<br />
recommend for your Excel processing needs :<br />
<a href="http://www.andykhan.com/jexcelapi/" target="_new">JExcelApi</a>.<br />
<br />
Still, Java is a heavyweight programming language &#8211; it would be a really bad idea to fire up the</p>
<href a="http://www.eclipse.org" target="_new">monster</a> just for some easy processing of Excel files.<br />
Here&apos;s why Jython comes naturally into equation. Four hours and about<br />
100 lines of debugged code later, here I am sitting on top of a perfectly functional internationalization tool which :</p>
<li> generates PHP code from a big xls file (the root vocabulary) which centralizes all the internationalization texts</li>
<p></p>
<li> generates 2-language xls files for translators usage</li>
<p></p>
<li> updates the root vocabulary starting from the files modified by the translators</li>
<p>
Automation scripts are already in cron and there&apos;s also a nice text document explaining translators where to get<br />
their files and where to put them after modification. The resulting script is not exactly fast, but this is tooling<br />
and not production so this should not be a problem after all.<br />
<br />
Whatever your project contraints are, give Jython a try and you&apos;ll be amazed &#8230; As they put it on the<br />
<a href="http://uselesspython.com" target="_new">Useless Python</a> site &#8211; <strong>If it were any simpler, it would be illegal.</strong> <br />
Finally there&apos;s a trick not quite related with Jyhon, nevertheless interesting.<br />
There is an easy way of solving the problem of translating phrases with real data inside them, with easy parameter swapping.<br />
We&apos;ll use the good old <strong>sprintf</strong> but not directly. We&apos;ll pass through a not so popular but extremely useful function,<br />
<a href="http://www.php.net/call_user_func_array" target="_new">call_user_func_array</a>. Suppose that our example needs the<br />
user name and authorization profile description to display inside a nice message. All you have to do is to define placeholders<br />
in I18N files which would fit as the first argument for sprintf. The following example should make it clearer:</p>
<table cellspacing="2" border="0" cellpadding="2" align="center" bgcolor="white">
<tbody>
<tr>
<td bgcolor="#89d2ff">localization/en/login.php</td>
</tr>
<tr>
<td bgcolor="#d3ffb4">
<pre>
$messages = array(
&apos;loggedin&apos;=>&apos;You are authenticated successfully as user %1$s with profile %2$s.&apos;
);
$this->set($messages);
</td>
</pre>
</tr>
<tr>
<td bgcolor="#89d2ff">localization/fr/login.php</td>
</tr>
<tr>
<td bgcolor="#d3ffb4">
<pre>
$messages = array(
&apos;loggedin&apos;=>&apos;Vous avez le profile %2$s en tant qu&apos;utilisateur %1$s.&apos;
);
$this->set($messages);
</td>
</pre>
</tr>
<tr>
<td bgcolor="#89d2ff">Simple passing of multiple parameters to I18N in PHP. Example function without error processing or data domain checking.</td>
</tr>
<tr>
<td bgcolor="#d3ffb4">
<pre>
#this is the multiple parameter function
function complexTranslation($i18n, $label, $params)
{
  return call_user_func_array(&apos;sprintf&apos;,array_merge(array($i18n->_($label)),$params));
}
</td>
</pre>
</tr>
<tr>
<td bgcolor="#89d2ff">Then, you have to initialize your I18N object. This can be done in a generic manner for all pages.</td>
</tr>
<tr>
<td bgcolor="#d3ffb4">
<pre>
#specific I18N initialization stuff
require_once &apos;I18N/Messages/File.php&apos;;
$g_language_dir = dirname($_SERVER[&apos;PATH_TRANSLATED&apos;]).&apos;/localization/&apos;;
$i18n =&#038; new I18N_Messages_File($g_langCode,$script_name,$g_language_dir);
</td>
</pre>
</tr>
<tr>
<td bgcolor="#89d2ff">Finally, use the function.</td>
</tr>
<tr>
<td bgcolor="#d3ffb4">
<pre>
#translate the successfull login message
$loginbox = Tools::complexTranslation($i18n,&apos;loggedin&apos;,array($operator->name,$profile->description));
</td>
</pre>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.netuality.ro/using-jython-to-internationalize-a-php-app/tools/20040301/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shy Java, silent Java, sad Java</title>
		<link>http://www.netuality.ro/shy-java-silent-java-sad-java/andeverythingelse/20031204</link>
		<comments>http://www.netuality.ro/shy-java-silent-java-sad-java/andeverythingelse/20031204#comments</comments>
		<pubDate>Thu, 04 Dec 2003 15:16:35 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
				<category><![CDATA[AndEverythingElse]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Sun]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.netoo.loco/shy-java-silent-java-sad-java/uncategorized/20031204</guid>
		<description><![CDATA[Last, week I got to visit Web Services &#38; XML Integration Forum in Paris. It was an interesting day and I&#8217;ll probably come back with some more info, but for now I&#8217;ll just talk about what really impressed me. There was a nice triagle of expo booths somewhere in the &#8216;North-East&#8217; area of the Forum, [...]]]></description>
			<content:encoded><![CDATA[<p>Last, week I got to visit <a href="http://www.technoforum.fr/integ2003/index.html" target="_new">Web Services &amp; XML Integration Forum</a> in Paris. It was an interesting day and I&#8217;ll probably come back with some more info, but for now I&#8217;ll just talk about what really impressed me. There was a nice triagle of expo booths somewhere in the &#8216;North-East&#8217; area of the Forum, three little companies you might&#8217;ve heard about : Microsoft, Sun and Borland.</p>
<p>The difference was striking. Microsoft is <em>by far</em> more prepared for this public event. They weren&#8217;t using presentation rooms, but instead conferencing right there in the booth all day long (with a lunch break of course). Although the presentation rooms were at least 4 times larger than the space they prepared (3 benchesx2m apx), I think they&#8217;ve got the best coverage at the Forum. They and Adobe, but Adobe was slightly off-topic (PDF is king at Adobe, and for a reason).</p>
<p>Instead of using a classic projector, casting large shadows every time they wanted to point something on the screen, MS people installed a large (plasma, I think) flat-screen in their booth. They were the only ones I saw with wireless microphones, which gave them a lot of freedom to walk, wave hands and hypnotize the audience. But wait, there&#8217;s more &#8230; The Microsoft guys were talking &#8220;agile enterprise and processes&#8221; and one of them said once &#8220;you can put any backend database here, say MySQL for instance&#8221;. No, there is no confusion with &#8220;MS SQL&#8221;, the guy standing next to me was as stunned as I was. And to complete a superb marketing image, they wear no suits, no ties &#8211; everybody was relaxed and smiling. The only glitch was that the latest rage among MS employees seems to be cloning Bill&#8217;s haircut. I mean wake up guys, you can cut your hair in differents lenghts an shapes, you know&#8230;</p>
<p>Just a few meters away, in the much smaller Borland booth, there was also a plasma display. However, no real presentations showing. Just a loop of images, logos of products and the word SPEED written in large, red letters. Um, ok. After 30 seconds I had to walk, it was incredibly boring.</p>
<p>No crowd was gathered at Sun&#8217;s booth, neither. Some LCDs were displaying what looked like a non-interactive Project Rave demo and some screenshots of a Windows&#8217;look&#8217;alike Linux distribution, their famous Sun Desktop blabla whatever. WHY were they showing this at a Web Services &amp; XML Forum ? But, probably Sun&#8217;s intentions were to scare away the visitors so they could watch undisturbed Microsoft presentations. In that case, they succeded extremely well. Plus, their unique positioning gave them a perfect view of the presentations &#8211; or was it Microsoft which strategically placed their flat screen in Sun&#8217;s direction ? Hmmm, makes you wonder.</p>
<p>Anyway, to conclude, I watched two Microsoft speeches (one about their Web services strategy and one about Biztalk). It was fun, it was interesting, it was well explained. But it was not Java &#8211; and I am a Java developer. Should I be &#8211; hmm, ashamed or something ? For not watching instead : what, the bored faces of Sun staff ? Or : Jbuilder logo and words in big red letters ? Java has what we call <em>an image problem</em>. Some steps were made (the java.com site for instance) but there&#8217;s still a long way to go. It&#8217;s a matter of &#8216;packaging&#8217; and might seem useless and frivolous. But how will Sun impose &#8216;friendlier&#8217; development tools if the language itself still has a cold, silent, sad, geeky image, competing with .Net platform which has a much &#8220;sexier&#8221; look ?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.netuality.ro/shy-java-silent-java-sad-java/andeverythingelse/20031204/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SWT has an older brother &#8230; wx4j</title>
		<link>http://www.netuality.ro/swt-has-an-older-brother-wx4j/tools/20030605</link>
		<comments>http://www.netuality.ro/swt-has-an-older-brother-wx4j/tools/20030605#comments</comments>
		<pubDate>Thu, 05 Jun 2003 11:43:56 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.netoo.loco/swt-has-an-older-brother-wx4j/uncategorized/20030605</guid>
		<description><![CDATA[wx4j is a Java wrapper around the *tried and tested* wxWindows widget framework. The main idea may be similar with one which gave birth to SWT : hide native widgets behing a [more or less] thin layer of Java. By &#8220;native&#8221; I mean widgets for Windows flavours, Linux/Unix with GTK+ or Motif, and MacOS as [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://wx4j.sourceforge.net/" target="_new">wx4j</a> is a Java wrapper around the *tried and tested* wxWindows widget framework. The main idea may be similar with one which gave birth to SWT : hide native widgets behing a [more or less] thin layer of Java. By &#8220;native&#8221; I mean widgets for Windows flavours, Linux/Unix with GTK+ or Motif, and MacOS as well. However I see some interesting differences :<br />
+++ source code is available for native wxWindows, however not available for native part of SWT ?!?<br />
+++ wx has considerably more C++ than Java. Some layers such as event loop are native to the OS thus (afaik) faster than SWT&apos;s.<br />
&#8212; what about wxEmbedded ? would be nice to integrate also &#8230; SWT has already made some steps in this direction<br />
&#8212; I find somehow questionable the sanity of the &#8220;native&#8221; approach, because we&apos;ll eventually end up writing small Java control layers manipulating native GUIs and native data sources (<a href="http://otl.sourceforge.net/home.htm" target="_new">OTL</a> anyone ?). But then again, this might be a valid approach.<br />
As well as in SWT, there is some ["non-Javaic"] memory management needed such as destroying transient windows containers and deleting memory used by drawing contexts &#8230; Although the library is extremely young the doc is quite useful, even showing non-obvious things like how to deploy a wx4j app with webstart.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.netuality.ro/swt-has-an-older-brother-wx4j/tools/20030605/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

