<?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>asyd's blog</title>
	<atom:link href="http://blog.asyd.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.asyd.net</link>
	<description>unix forever, for everyone. Not convinced, try Mac OS X!</description>
	<lastBuildDate>Thu, 02 Jul 2009 13:23:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to convert a PKCS#12 to JKS</title>
		<link>http://blog.asyd.net/2009/07/how-to-convert-a-pkcs12-to-jks/</link>
		<comments>http://blog.asyd.net/2009/07/how-to-convert-a-pkcs12-to-jks/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 13:20:28 +0000</pubDate>
		<dc:creator>asyd</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Sysadmin]]></category>

		<guid isPermaLink="false">http://blog.asyd.net/?p=347</guid>
		<description><![CDATA[Most of system administrators use OpenSSL (which is not a good idea, but it&#8217;s an another story) to manage their PKI. While OpenSSL is good to create/convert X509 certificates from PEM/DER to PKCS#12 (and vice versa, for sure) it doesn&#8217;t understand the JKS (Java KeyStore) format. JKS are used in Java world, for example Glassfish [...]]]></description>
			<content:encoded><![CDATA[<p>Most of system administrators use OpenSSL (which is not a good idea, but it&#8217;s an another story) to manage their PKI. While OpenSSL is good to create/convert X509 certificates from PEM/DER to PKCS#12 (and vice versa, for sure) it doesn&#8217;t understand the JKS (Java KeyStore) format. JKS are used in Java world, for example Glassfish application server, OpenDS and so more. In this post, I&#8217;ll explain how to convert a PKCS#12 to a JKS using portecle. <a href="http://portecle.sf.net">portecle</a> is a small, but very useful application (written in Java) to manipulate keystores.</p>
<ol>
<li>Download portecle, extract it, and lauch it using <code>java -jar portecle.jar</code> (note that Java 6 seems required for version 1.4.x)</li>
<li>Open your PKCS#12 file, provide the password</li>
<li>Click on <em>Tools/Change KeyStore Type/JKS</em> menu</li>
<li>If you don&#8217;t want to use the default password (which is password), click on the menu keystore password</li>
<li>Save it, that&#8217;s all folks!</li>
</ol>
<p>
You can know list the contents of your JKS using keytool:</p>
<p><code><br />
% keytool -list -v -keystore <em>yourkeystore.jks</em><br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.asyd.net/2009/07/how-to-convert-a-pkcs12-to-jks/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Quick (and dirty?) howto: Solaris IPMP with VLAN tagging</title>
		<link>http://blog.asyd.net/2009/06/quick-and-dirty-howto-solaris-ipmp-with-vlan-tagging/</link>
		<comments>http://blog.asyd.net/2009/06/quick-and-dirty-howto-solaris-ipmp-with-vlan-tagging/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 15:06:20 +0000</pubDate>
		<dc:creator>asyd</dc:creator>
				<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Sysadmin]]></category>

		<guid isPermaLink="false">http://blog.asyd.net/?p=344</guid>
		<description><![CDATA[Here the following commands I use to create a IPMP (IP Multipathing) groups (master/slave):

#!/bin/sh
# Plumb physical interfaces
ifconfig nge1 plumb
ifconfig nge2 plumb
# Plumb 802.1q interfaces
ifconfig nge544001 plumb
ifconfig nge544002 plumb
# Configure interfaces
ifconfig nge544001 group hosts deprecated -failover up
ifconfig nge544002 group hosts deprecated -failover standby up
# Add logicial interface
ifconfig nge544001 addif 10.16.244.60 netmask 255.255.252.0 up

You can also tweak [...]]]></description>
			<content:encoded><![CDATA[<p>Here the following commands I use to create a IPMP (IP Multipathing) groups (master/slave):</p>
<p><code><br />
#!/bin/sh</p>
<p># Plumb physical interfaces<br />
ifconfig nge1 plumb<br />
ifconfig nge2 plumb</p>
<p># Plumb 802.1q interfaces<br />
ifconfig nge544001 plumb<br />
ifconfig nge544002 plumb</p>
<p># Configure interfaces<br />
ifconfig nge544001 group hosts deprecated -failover up<br />
ifconfig nge544002 group hosts deprecated -failover standby up</p>
<p># Add logicial interface<br />
ifconfig nge544001 addif 10.16.244.60 netmask 255.255.252.0 up<br />
</code></p>
<p>You can also tweak the multipath daemon by editing <em>/etc/default/mpathd</em> to decrease the value to detect a NIC failure.</p>
<ul>
<li><a href="http://docs.sun.com/app/docs/doc/816-4554/ipmptm-1?l=en&#038;a=view">Solaris 10 IPMP Documentation reference</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.asyd.net/2009/06/quick-and-dirty-howto-solaris-ipmp-with-vlan-tagging/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Writing a daemon in groovy</title>
		<link>http://blog.asyd.net/2009/06/writing-a-daemon-in-groovy/</link>
		<comments>http://blog.asyd.net/2009/06/writing-a-daemon-in-groovy/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 08:29:38 +0000</pubDate>
		<dc:creator>asyd</dc:creator>
				<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[groovy]]></category>

		<guid isPermaLink="false">http://blog.asyd.net/?p=341</guid>
		<description><![CDATA[I actually need to write a little daemon based on the JVM (I&#8217;ll explain why in a future post). As the groovy fan I am, I was looking for a ready to use receipt, this one is interesting but show only how to write, not to read   After getting some help from Guillaume [...]]]></description>
			<content:encoded><![CDATA[<p>I actually need to write a little daemon based on the JVM (I&#8217;ll explain why in a future post). As the groovy fan I am, I was looking for a ready to use receipt, <a href="http://pleac.sourceforge.net/pleac_groovy/sockets.html">this one</a> is interesting but show only how to write, not to read <img src='http://blog.asyd.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  After getting some help from <a href="http://glaforge.free.fr/weblog/">Guillaume</a> here a working sample:</p>

<div class="wp_syntax"><div class="code"><pre class="groovy groovy" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #a1a100;">java.net.ServerSocket</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #a1a100;">net.asyd.nagios.Hello</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">def</span> listenPort <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">4242</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">def</span> server <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #aaaadd; font-weight: bold;">ServerSocket</span><span style="color: #66cc66;">&#40;</span>listenPort<span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #b1b100;">while</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    server.<span style="color: #006600;">accept</span> <span style="color: #66cc66;">&#123;</span> socket <span style="color: #66cc66;">-&gt;</span>
        <span style="color: #993399;">println</span> <span style="color: #ff0000;">&quot;new connexion&quot;</span>
&nbsp;
        socket.<span style="color: #FFCC33;">withStreams</span> <span style="color: #66cc66;">&#123;</span> input, output <span style="color: #66cc66;">-&gt;</span>
&nbsp;
            <span style="color: #000000; font-weight: bold;">def</span> reader <span style="color: #66cc66;">=</span> input.<span style="color: #006600;">newReader</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
            <span style="color: #000000; font-weight: bold;">def</span> buffer <span style="color: #66cc66;">=</span> reader.<span style="color: #006600;">readLine</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> 
&nbsp;
            output <span style="color: #66cc66;">&lt;&lt;</span> <span style="color: #ff0000;">&quot;Hello world &quot;</span> <span style="color: #66cc66;">+</span> buffer <span style="color: #66cc66;">+</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
&nbsp;
        <span style="color: #66cc66;">&#125;</span>
    <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>As you can see it&#8217;s very simple, thanks to groovy, once again. A thread will be create for each client.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.asyd.net/2009/06/writing-a-daemon-in-groovy/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Présentation GUSES : Métrologie des IOs</title>
		<link>http://blog.asyd.net/2009/06/presentation-guses-metrologie-des-ios/</link>
		<comments>http://blog.asyd.net/2009/06/presentation-guses-metrologie-des-ios/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 22:39:59 +0000</pubDate>
		<dc:creator>asyd</dc:creator>
				<category><![CDATA[OpenSolaris]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[guses]]></category>
		<category><![CDATA[io]]></category>
		<category><![CDATA[performances]]></category>

		<guid isPermaLink="false">http://blog.asyd.net/?p=331</guid>
		<description><![CDATA[Le 16 Juin, à 19h30, se tiendra à Paris, chez Sun (attention, Sun a déménagé) une présentation technique autour de Solaris 10 / OpenSolaris, sur la gestion des IOs. Cette présentation est organisé par l&#8217;association GUSES. Au programme :

Les différents composants : logiciel (système de fichiers), matériel
La gestion du cache
Le rôle du matériel
Mesure de performances [...]]]></description>
			<content:encoded><![CDATA[<p>Le 16 Juin, à 19h30, se tiendra à Paris, chez Sun (<a href="http://maps.google.fr/maps?f=q&#038;source=s_q&#038;hl=fr&#038;geocode=&#038;q=32+rue+monceau,+paris&#038;sll=48.879788,2.313019&#038;sspn=0.003288,0.009452&#038;ie=UTF8&#038;ll=48.878814,2.310734&#038;spn=0.006576,0.018904&#038;z=16&#038;iwloc=A">attention, Sun a déménagé</a>) une présentation technique autour de Solaris 10 / OpenSolaris, sur la gestion des IOs. Cette présentation est organisé par l&#8217;association <a href="http://guses.org/home">GUSES</a>. Au programme :</p>
<ul>
<li>Les différents composants : logiciel (système de fichiers), matériel</li>
<li>La gestion du cache</li>
<li>Le rôle du matériel</li>
<li>Mesure de performances et optimisation</li>
</ul>
<p>Comme vous l&#8217;aurez sans doute remarqué, cette présentation s&#8217;adresse avant tout à des administrateurs systèmes Solaris, mais les concepts abordés sont tout aussi vrai pour les autres UNIX.</p>
<p>Cette présentation sera assurée par Fabrice Bacchella, administrateur système senior.</p>
<p><a href="http://doodle.com/mrpacm8ikd2q63ky">Afin d&#8217;optimiser la place, nous vous serons reconnaissant de vous inscrire.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.asyd.net/2009/06/presentation-guses-metrologie-des-ios/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Test de Glassfish Preview</title>
		<link>http://blog.asyd.net/2009/06/test-de-glassfish-preview/</link>
		<comments>http://blog.asyd.net/2009/06/test-de-glassfish-preview/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 22:20:29 +0000</pubDate>
		<dc:creator>asyd</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[glassfish]]></category>
		<category><![CDATA[xwiki]]></category>

		<guid isPermaLink="false">http://blog.asyd.net/?p=333</guid>
		<description><![CDATA[Depuis quelques jours (heures ?), Glassfish v3 preview est disponible. Comme Alexis est bien mieux placé que moi pour en parler, je vous engage à lire cet article pour la description de cette version. Au travers de ce petit billet, je résume ma toute première utilisation de Preview. Pour cela, mon cas d&#8217;utilisation est tout [...]]]></description>
			<content:encoded><![CDATA[<p>Depuis quelques jours (heures ?), Glassfish v3 preview est disponible. Comme <a href="http://blogs.sun.com/alexismp/entry/glassfish_v3_preview">Alexis est bien mieux placé que moi pour en parler, je vous engage à lire cet article</a> pour la description de cette version. Au travers de ce petit billet, je résume ma toute première utilisation de Preview. Pour cela, mon cas d&#8217;utilisation est tout simple, déployer XWiki en version 1.8 dans un premier temps, mais au travers d&#8217;une source de connexions JDBC. Cas d&#8217;utilisation donc très simple.</p>
<p>Mes remarques, en vrac&nbsp;:</p>
<ul>
<li>Nécessite un JDK 1.6 (java -version pour vérifier). Utilisateur d&#8217;OS X, vous devez définir JAVA_HOME et PATH, la version par défaut étant encore en 1.5</li>
<li>La commande <em>start-domain</em> ne met que quelques secondes à rendre la main ! Néanmoins, la console d&#8217;administration n&#8217;est pas disponible avant d&#8217;autres longues secondes <img src='http://blog.asyd.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . Pour rappel, la version 3 de Glassfish est construit autour d&#8217;OSGI, un système orienté composant.</li>
<li>L&#8217;interface d&#8217;administration est proche de la version 2.1, on s&#8217;y retrouve donc assez facilement. Néanmoins, il y a une différence notable dans la gestion des applications. Il faut que je creuse le sujet.</li>
<li>Il faut que je vérifie, mais lors de la configuration du pool de connexions JDBC, Glassfish me demandait un restart, que j&#8217;ai fait. J&#8217;avoue que cela me dérange un peu si c&#8217;est vraiment nécessaire, c&#8217;est quand même une opération simple !</li>
<li>Temps d&#8217;arrêt très rapide, plutôt appréciable.</li>
<li>J&#8217;en suis presque surpris  (pas taper), mais le déploiement de XWIki est OK du premier coup ! Très bon signe !</li>
<li>L&#8217;URL JMX n&#8217;est plus affiché lors du démarrage du domaine, c&#8217;est bien dommage !</li>
<li>A priori pas de changements sur la taxinomie (namespace) des MBeans, ce qui est plutôt plaisant.</li>
</ul>
<p>Bref, premier contact plutôt positif, même si j&#8217;ai constaté quelques petits soucis dans l&#8217;interface web, mais rien de bien méchant. Vivement la première version de production !</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.asyd.net/2009/06/test-de-glassfish-preview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to build and deploy JRDS</title>
		<link>http://blog.asyd.net/2009/05/how-to-build-and-deploy-jrds/</link>
		<comments>http://blog.asyd.net/2009/05/how-to-build-and-deploy-jrds/#comments</comments>
		<pubDate>Mon, 25 May 2009 19:15:33 +0000</pubDate>
		<dc:creator>asyd</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[jrds]]></category>

		<guid isPermaLink="false">http://blog.asyd.net/?p=318</guid>
		<description><![CDATA[At my work, we currently use nagios and cacti for monitoring, the &#8220;standard&#8221; tools. However, why it&#8217;s difficult to replace nagios &#8211; for many reasons (it use standard flat configuration flies) &#8211; I&#8217;m looking for a way to replace Cacti. Indeed, it&#8217;s written in pure PHP, there is almost no CLI. So, when I add [...]]]></description>
			<content:encoded><![CDATA[<p>At my work, we currently use nagios and cacti for monitoring, the &#8220;standard&#8221; tools. However, why it&#8217;s difficult to replace nagios &#8211; for many reasons (it use standard flat configuration flies) &#8211; I&#8217;m looking for a way to replace Cacti. Indeed, it&#8217;s written in pure PHP, there is almost no CLI. So, when I add a new host, I need to use my browser, and my mouse, and I don&#8217;t like that. By chance, a friend of mine wrote his own tool, called <a href="http://jrds.sourceforge.net">JRDS</a>, in pure Java. I&#8217;m actually in test phase, however, here are some pros:</p>
<ul>
<li>It&#8217;s Java, no need for php, whatever.</li>
<li>JRDS use <a href="http://rrd4j.dev.java.net/">rrd4j</a>, RRDTool Java implementation</li>
<li>Use flat files for configuration, so it&#8217;s very easy to manage</li>
</ul>
<p>However, one of its wort cons i s the lack of documentation! So here some notes to build JRDS :</p>
<ol>
<li>Fetch and extract JRDS sources from the <a href="http://sourceforge.net/scm/?type=svn&#038;group_id=134636">subversion repository</a></li>
<li>Fetch and extract RRD4j sources from the <a href="https://rrd4j.dev.java.net/source/browse/rrd4j/">subversion repository</a> (note: a dev.java.net account seem to be required)</li>
<li>Build RRD4j
<ul>
<li><code># cd rrd4j/rrd4j</code></li>
<li><code># ant</code></li>
<li><code># cp rrd4j-&lt;version&gt;.jar $JRDS_HOME/trunk/lib</code></li>
</ul>
</li>
<li>Build JRDS
<ul>
<li>If you don&#8217;t have it, download <a href="http://ant.apache.org/ivy/">ivy</a> and copy its jar in ~/.ant/lib directory</li>
<li><code># cd $JRDS_HOME/trunk</code></li>
<li><code># ant resolve</code></li>
<li>Extrat <em>c.tld</em> from lib/standard.jar and copy the file in the <em>lib/</em> directory (<code> # unzip lib/standard.jar META-INF/c.tld ; mv META-INF/c.tld lib/ ; rmdir META-INF</code></li>
<li><code># cp local.properties.sample local.properties</code>
<li>
<li>Edit local.properties, don&#8217;t forget to set <em>jai.home</em> at the end of file</li>
<li><code># ant war</code></li>
</ul>
</li>
<li>Before deploy jrds.war, you need to create a properties file, and some directories. See the <a href="http://jrds.sourceforge.net/ug/userguide.html#Initial+setup">inital setup</a> chapter of JRDS Userguide.</li>
<li>Note: to deploy JRDS on Glassfish, the only way I found to create the property is to defined in the JVM options. I also have sometimes a deadlock, if that appears, you need to kill the Glassfish process and restart it.</li>
</ol>
<p><br/></p>
<h3>jrds.properties</h3>
<p><pre>
configdir=/Users/bbonfils/tools/jrds/config
rrddir=/Users/bbonfils/tools/jrds/probe
logfile=/Users/bbonfils/tools/jrds/log/jrds.log
libspath=/Users/bbonfils/sources/jrds/trunk/build/probes.jar
#loglevel=debug
</pre>
</p>
<p><br/></p>
<h3>config/host-kaoru.xml</h3>
<p>
<div class="wp_syntax"><div class="code"><pre class="xml xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;host</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;kaoru.asyd.net&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;snmp</span> <span style="color: #000066;">community</span>=<span style="color: #ff0000;">&quot;secret&quot;</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;2&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;probe</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;TcpSnmp&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;probe</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;IpSnmp&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;probe</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;UdpSnmp&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;probe</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;IcmpSnmp&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;probe</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;MemLinux&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;probe</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;CpuRawTimeLinux&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;probe</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;UcdRawSystemCounter&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;probe</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;PartitionSpace&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;String&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;/&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/probe<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;probe</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;IfSnmp&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
               <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;String&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;eth0&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/probe<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;probe</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;CpuLoadFloat&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;probe</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;TcpStat&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/host<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>
</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.asyd.net/2009/05/how-to-build-and-deploy-jrds/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Create a JDBC Connection Pool using JMX/AMX</title>
		<link>http://blog.asyd.net/2009/05/create-a-jdbc-connection-pool-using-jmxamx/</link>
		<comments>http://blog.asyd.net/2009/05/create-a-jdbc-connection-pool-using-jmxamx/#comments</comments>
		<pubDate>Fri, 22 May 2009 14:20:40 +0000</pubDate>
		<dc:creator>asyd</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[glassfish]]></category>
		<category><![CDATA[groovy]]></category>

		<guid isPermaLink="false">http://blog.asyd.net/?p=315</guid>
		<description><![CDATA[In my previous post, I demonstrate how to set a property for each http-service in a glassfish domain using groovy and jmx. Here the code to create a new JDBC Connection Pool, still using groovy and JMX/AMX APIs.

&#160;
import javax.management.ObjectName
import javax.management.remote.JMXConnectorFactory as JmxFactory
import javax.management.remote.JMXServiceURL as JmxUrl
import javax.management.MBeanServerConnection
&#160;
&#160;
&#160;
//def uri = 'service:jmx:rmi:///jndi/rmi://portal3:46302/jmxrmi'
def uri = 'service:jmx:rmi:///jndi/rmi://localhost:8686/jmxrmi'
def login = 'admin'
def [...]]]></description>
			<content:encoded><![CDATA[<p>In my previous post, I demonstrate how to set a property for each http-service in a glassfish domain using groovy and jmx. Here the code to create a new JDBC Connection Pool, still using groovy and JMX/AMX APIs.</p>

<div class="wp_syntax"><div class="code"><pre class="groovy groovy" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #a1a100;">javax.management.ObjectName</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #a1a100;">javax.management.remote.JMXConnectorFactory</span> <span style="color: #000000; font-weight: bold;">as</span> JmxFactory
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #a1a100;">javax.management.remote.JMXServiceURL</span> <span style="color: #000000; font-weight: bold;">as</span> JmxUrl
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #a1a100;">javax.management.MBeanServerConnection</span>
&nbsp;
&nbsp;
&nbsp;
<span style="color: #808080; font-style: italic;">//def uri = 'service:jmx:rmi:///jndi/rmi://portal3:46302/jmxrmi'</span>
<span style="color: #000000; font-weight: bold;">def</span> uri <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'service:jmx:rmi:///jndi/rmi://localhost:8686/jmxrmi'</span>
<span style="color: #000000; font-weight: bold;">def</span> login <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'admin'</span>
<span style="color: #000000; font-weight: bold;">def</span> password <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'adminadmin'</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #a1a100;">javax.management.Query</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">def</span> jmxurl <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">new</span> JmxUrl<span style="color: #66cc66;">&#40;</span>uri<span style="color: #66cc66;">&#41;</span>
<span style="color: #000000; font-weight: bold;">def</span> attributes <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #aaaadd; font-weight: bold;">Hashtable</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">def</span> buffer <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#91;</span> login, password <span style="color: #66cc66;">&#93;</span>
&nbsp;
attributes.<span style="color: #006600;">put</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;jmx.remote.credentials&quot;</span>, <span style="color: #66cc66;">&#40;</span><span style="color: #aaaadd; font-weight: bold;">String</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span> buffer<span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">def</span> server <span style="color: #66cc66;">=</span> JmxFactory.<span style="color: #006600;">connect</span><span style="color: #66cc66;">&#40;</span>jmxurl, attributes<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">mBeanServerConnection</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">def</span> createJDBCConnectionPool <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#123;</span> name <span style="color: #66cc66;">-&gt;</span>
    <span style="color: #000000; font-weight: bold;">def</span> objectname <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ObjectName<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;amx:j2eeType=X-DomainConfig,name=na&quot;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #000000; font-weight: bold;">def</span> options <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #aaaadd; font-weight: bold;">ArrayList</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
    options.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span>name<span style="color: #66cc66;">&#41;</span>
    options.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;com.mysql.jdbc.jdbc2.optional.MysqlDataSource&quot;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #000000; font-weight: bold;">def</span> properties <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#91;</span>
        <span style="color: #ff0000;">'ResType'</span>:<span style="color: #ff0000;">'javax.sql.DataSource'</span>
    <span style="color: #66cc66;">&#93;</span>
&nbsp;
    options.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span>properties <span style="color: #000000; font-weight: bold;">as</span> <span style="color: #aaaadd; font-weight: bold;">Map</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
    server.<span style="color: #006600;">invoke</span><span style="color: #66cc66;">&#40;</span>objectname, 
                <span style="color: #ff0000;">&quot;createJDBCConnectionPoolConfig&quot;</span>,
                options <span style="color: #000000; font-weight: bold;">as</span> <span style="color: #aaaadd; font-weight: bold;">Object</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>,
                <span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;java.lang.String&quot;</span>,<span style="color: #ff0000;">&quot;java.lang.String&quot;</span>,<span style="color: #ff0000;">&quot;java.util.Map&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #000000; font-weight: bold;">as</span> <span style="color: #aaaadd; font-weight: bold;">String</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#41;</span>
&nbsp;
    <span style="color: #808080; font-style: italic;">/* To add other properties, we need to invoke setProperty to new object */</span>
&nbsp;
    objectname <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ObjectName<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;amx:j2eeType=X-JDBCConnectionPoolConfig,name=&quot;</span> <span style="color: #66cc66;">+</span> name<span style="color: #66cc66;">&#41;</span>
&nbsp;
    server.<span style="color: #006600;">invoke</span><span style="color: #66cc66;">&#40;</span>objectname, <span style="color: #ff0000;">&quot;setPropertyValue&quot;</span>, <span style="color: #66cc66;">&#91;</span> <span style="color: #ff0000;">&quot;user&quot;</span>, <span style="color: #ff0000;">&quot;xwiki&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #000000; font-weight: bold;">as</span> <span style="color: #aaaadd; font-weight: bold;">Object</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>, <span style="color: #66cc66;">&#91;</span> <span style="color: #ff0000;">&quot;java.lang.String&quot;</span>, <span style="color: #ff0000;">&quot;java.lang.String&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #000000; font-weight: bold;">as</span> <span style="color: #aaaadd; font-weight: bold;">String</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>
    server.<span style="color: #006600;">invoke</span><span style="color: #66cc66;">&#40;</span>objectname, <span style="color: #ff0000;">&quot;setPropertyValue&quot;</span>, <span style="color: #66cc66;">&#91;</span> <span style="color: #ff0000;">&quot;password&quot;</span>, <span style="color: #ff0000;">&quot;xwiki&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #000000; font-weight: bold;">as</span> <span style="color: #aaaadd; font-weight: bold;">Object</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>, <span style="color: #66cc66;">&#91;</span> <span style="color: #ff0000;">&quot;java.lang.String&quot;</span>, <span style="color: #ff0000;">&quot;java.lang.String&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #000000; font-weight: bold;">as</span> <span style="color: #aaaadd; font-weight: bold;">String</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>
    server.<span style="color: #006600;">invoke</span><span style="color: #66cc66;">&#40;</span>objectname, <span style="color: #ff0000;">&quot;setPropertyValue&quot;</span>, <span style="color: #66cc66;">&#91;</span> <span style="color: #ff0000;">&quot;databaseName&quot;</span>, <span style="color: #ff0000;">&quot;xwiki&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #000000; font-weight: bold;">as</span> <span style="color: #aaaadd; font-weight: bold;">Object</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>, <span style="color: #66cc66;">&#91;</span> <span style="color: #ff0000;">&quot;java.lang.String&quot;</span>, <span style="color: #ff0000;">&quot;java.lang.String&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #000000; font-weight: bold;">as</span> <span style="color: #aaaadd; font-weight: bold;">String</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>
    server.<span style="color: #006600;">invoke</span><span style="color: #66cc66;">&#40;</span>objectname, <span style="color: #ff0000;">&quot;setPropertyValue&quot;</span>, <span style="color: #66cc66;">&#91;</span> <span style="color: #ff0000;">&quot;serverName&quot;</span>, <span style="color: #ff0000;">&quot;localhost&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #000000; font-weight: bold;">as</span> <span style="color: #aaaadd; font-weight: bold;">Object</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>, <span style="color: #66cc66;">&#91;</span> <span style="color: #ff0000;">&quot;java.lang.String&quot;</span>, <span style="color: #ff0000;">&quot;java.lang.String&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #000000; font-weight: bold;">as</span> <span style="color: #aaaadd; font-weight: bold;">String</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>
    server.<span style="color: #006600;">invoke</span><span style="color: #66cc66;">&#40;</span>objectname, <span style="color: #ff0000;">&quot;setPropertyValue&quot;</span>, <span style="color: #66cc66;">&#91;</span> <span style="color: #ff0000;">&quot;port&quot;</span>, <span style="color: #ff0000;">&quot;3306&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #000000; font-weight: bold;">as</span> <span style="color: #aaaadd; font-weight: bold;">Object</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>, <span style="color: #66cc66;">&#91;</span> <span style="color: #ff0000;">&quot;java.lang.String&quot;</span>, <span style="color: #ff0000;">&quot;java.lang.String&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #000000; font-weight: bold;">as</span> <span style="color: #aaaadd; font-weight: bold;">String</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>
    server.<span style="color: #006600;">invoke</span><span style="color: #66cc66;">&#40;</span>objectname, <span style="color: #ff0000;">&quot;setPropertyValue&quot;</span>, <span style="color: #66cc66;">&#91;</span> <span style="color: #ff0000;">&quot;networkProtocol&quot;</span>, <span style="color: #ff0000;">&quot;tcp&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #000000; font-weight: bold;">as</span> <span style="color: #aaaadd; font-weight: bold;">Object</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>, <span style="color: #66cc66;">&#91;</span> <span style="color: #ff0000;">&quot;java.lang.String&quot;</span>, <span style="color: #ff0000;">&quot;java.lang.String&quot;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #000000; font-weight: bold;">as</span> <span style="color: #aaaadd; font-weight: bold;">String</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
createJDBCConnectionPool<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;xwikiPool&quot;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>As you probably noticed, I can&#8217;t create properties directly using the invokation of createJDBCConnectionPool. Indeed, we can specifly only few properties (take a look at <a href="https://glassfish.dev.java.net/nonav/javaee5/amx/javadoc/com/sun/appserv/management/config/JDBCConnectionPoolConfigKeys.html">the complete list</a>). However, once the object is created, we can use the setPropertValue to create any properties we want.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.asyd.net/2009/05/create-a-jdbc-connection-pool-using-jmxamx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Soirée CloudCamp à Paris le 11 Juin</title>
		<link>http://blog.asyd.net/2009/05/soiree-cloudcamp-a-paris-le-11-juin/</link>
		<comments>http://blog.asyd.net/2009/05/soiree-cloudcamp-a-paris-le-11-juin/#comments</comments>
		<pubDate>Tue, 19 May 2009 18:27:11 +0000</pubDate>
		<dc:creator>asyd</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[cloudcomputing]]></category>

		<guid isPermaLink="false">http://blog.asyd.net/?p=307</guid>
		<description><![CDATA[Comme tout le monde, vous entendez parler du cloud computing, mais vous ne savez pas forcément ce qui se cache derrière ce terme ? Vous connaissez déjà, mais vous voulez en savoir plus ? Bref, dans tous les cas, si ce sujet vous intéresse, je vous invite à participer à la soirée organiser par cloudcamp. [...]]]></description>
			<content:encoded><![CDATA[<p>Comme tout le monde, vous entendez parler du <i>cloud computing</i>, mais vous ne savez pas forcément ce qui se cache derrière ce terme ? Vous connaissez déjà, mais vous voulez en savoir plus ? Bref, dans tous les cas, si ce sujet vous intéresse, je vous invite à participer à la soirée organiser par cloudcamp. Cette soirée aura lieu le 11 Juin, à partir de 18h30. Pour ma part, je dois y intervenir pour parler de la sécurité.</p>
<p>Je me permet de rappeler, pour mes fidèles lecteurs, que Solaris/OpenSolaris est très proche du concept de <i>cloud computing</i> notamment grâce aux containers (zones + resource shapping), et OpenStorage.</p>
<ul>
<li><a href="http://blogs.sun.com/EricBezille/entry/sur_les_pas_du_premier">Introduction au <i>cloud computing</i> par Éric Bezille</a></li>
<li><a href="http://www.cloudcamp.com/?page_id=748">Programme complet et inscription</a> </li>
<li><a href="http://blogs.sun.com/EricBezille/entry/openstorage_la_r%C3%A9volution_dans_la">Un billet d&#8217;Éric Bezille sur OpenStorage</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.asyd.net/2009/05/soiree-cloudcamp-a-paris-le-11-juin/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Configure glassfish via JMX and Groovy</title>
		<link>http://blog.asyd.net/2009/05/configure-glassfish-via-jmx-and-groovy/</link>
		<comments>http://blog.asyd.net/2009/05/configure-glassfish-via-jmx-and-groovy/#comments</comments>
		<pubDate>Tue, 19 May 2009 15:31:55 +0000</pubDate>
		<dc:creator>asyd</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[glassfish]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[jmx]]></category>

		<guid isPermaLink="false">http://blog.asyd.net/?p=311</guid>
		<description><![CDATA[At my new work, we have a lot of glassfish in production. For some of them, we even have almost 10 instances per DAS (Domain Admin Server). As a (good) system administrator, I&#8217;m a lazy man. After having to installed and created a glassfish with 10 instances, I was really tired to click, click, and [...]]]></description>
			<content:encoded><![CDATA[<p>At my new <a href="http://www.rtl.fr/">work</a>, we have a lot of glassfish in production. For some of them, we even have almost 10 instances per DAS (Domain Admin Server). As a (good) system administrator, I&#8217;m a lazy man. After having to installed and created a glassfish with 10 instances, I was really tired to click, click, and click again through the web interface. Yes I know, it&#8217;s possible to edit the files directly, but I think it&#8217;s not very convenient. First, it&#8217;s easy to make mistakes, it&#8217;s not atomic, and finally you need to restart/reload the instance.</p>
<p>So, I was wondering if it&#8217;s possible to proceed some configuration using JMX/<a href="https://glassfish.dev.java.net/javaee5/amx/docs/amx-impl.html">AMX</a> (AppServer Management Extensions). I start to browse MBeans using JConsole, and check that&#8217;s really possible to modify the configuration, and the answer is yes. Ok, my first try is a simple one, I just want enable access.log, meaning set accessLoggingEnabled property to true for each http-service. Since I&#8217;m not really good to write Java, I wrote a groovy script. Here it comes :</p>

<div class="wp_syntax"><div class="code"><pre class="groovy groovy" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #a1a100;">javax.management.ObjectName</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #a1a100;">javax.management.remote.JMXConnectorFactory</span> <span style="color: #000000; font-weight: bold;">as</span> JmxFactory
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #a1a100;">javax.management.remote.JMXServiceURL</span> <span style="color: #000000; font-weight: bold;">as</span> JmxUrl
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #a1a100;">javax.management.MBeanServerConnection</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">def</span> uri <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'service:jmx:rmi:///jndi/rmi://localhost:8686/jmxrmi'</span>
<span style="color: #000000; font-weight: bold;">def</span> login <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'admin'</span>
<span style="color: #000000; font-weight: bold;">def</span> password <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'adminadmin'</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #a1a100;">javax.management.Query</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">def</span> jmxurl <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">new</span> JmxUrl<span style="color: #66cc66;">&#40;</span>uri<span style="color: #66cc66;">&#41;</span>
<span style="color: #000000; font-weight: bold;">def</span> attributes <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #aaaadd; font-weight: bold;">Hashtable</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">def</span> buffer <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#91;</span> login, password <span style="color: #66cc66;">&#93;</span>
&nbsp;
attributes.<span style="color: #006600;">put</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;jmx.remote.credentials&quot;</span>, <span style="color: #66cc66;">&#40;</span><span style="color: #aaaadd; font-weight: bold;">String</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span> buffer<span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">def</span> server <span style="color: #66cc66;">=</span> JmxFactory.<span style="color: #006600;">connect</span><span style="color: #66cc66;">&#40;</span>jmxurl, attributes<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">mBeanServerConnection</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">def</span> enableAccessLog <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#123;</span> serviceUri <span style="color: #66cc66;">-&gt;</span>
    properties <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#91;</span> <span style="color: #ff0000;">&quot;accessLoggingEnabled&quot;</span>, <span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #66cc66;">&#93;</span>
    <span style="color: #000000; font-weight: bold;">def</span> signature <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#91;</span> <span style="color: #ff0000;">&quot;java.lang.String&quot;</span>, <span style="color: #ff0000;">&quot;java.lang.String&quot;</span><span style="color: #66cc66;">&#93;</span>
    server.<span style="color: #006600;">invoke</span><span style="color: #66cc66;">&#40;</span>serviceUri, <span style="color: #ff0000;">&quot;setPropertyValue&quot;</span>, properties <span style="color: #000000; font-weight: bold;">as</span> <span style="color: #aaaadd; font-weight: bold;">Object</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>, signature <span style="color: #000000; font-weight: bold;">as</span> <span style="color: #aaaadd; font-weight: bold;">String</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">def</span> checkAccessLog <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#123;</span> serviceUri <span style="color: #66cc66;">-&gt;</span>
    <span style="color: #000000; font-weight: bold;">def</span> properties <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#91;</span> <span style="color: #ff0000;">&quot;accessLoggingEnabled&quot;</span> <span style="color: #66cc66;">&#93;</span>
    <span style="color: #000000; font-weight: bold;">def</span> answer <span style="color: #66cc66;">=</span> server.<span style="color: #006600;">invoke</span><span style="color: #66cc66;">&#40;</span>serviceUri, <span style="color: #ff0000;">&quot;getPropertyValue&quot;</span>, properties <span style="color: #000000; font-weight: bold;">as</span> <span style="color: #aaaadd; font-weight: bold;">Object</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>, <span style="color: #ff0000;">&quot;java.lang.String&quot;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #993399;">println</span> <span style="color: #ff0000;">&quot;Access log for: &quot;</span> <span style="color: #66cc66;">+</span> serviceUri <span style="color: #66cc66;">+</span> <span style="color: #ff0000;">&quot; enabled: &quot;</span> <span style="color: #66cc66;">+</span> answer
<span style="color: #66cc66;">&#125;</span>
&nbsp;
&nbsp;
<span style="color: #000000; font-weight: bold;">def</span> query <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ObjectName<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;amx:*,j2eeType=X-HTTPServiceConfig&quot;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
server.<span style="color: #006600;">queryNames</span><span style="color: #66cc66;">&#40;</span>query, <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #663399;">each</span> <span style="color: #66cc66;">&#123;</span> service <span style="color: #66cc66;">-&gt;</span>
    checkAccessLog<span style="color: #66cc66;">&#40;</span>service<span style="color: #66cc66;">&#41;</span>
    enableAccessLog<span style="color: #66cc66;">&#40;</span>service<span style="color: #66cc66;">&#41;</span>
    checkAccessLog<span style="color: #66cc66;">&#40;</span>service<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>That&#8217;s magic&#8230; Sure I&#8217;ll post some others script to manage more complex configuration, like create a connection pool, etc.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.asyd.net/2009/05/configure-glassfish-via-jmx-and-groovy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Petit amusement du lundi</title>
		<link>http://blog.asyd.net/2009/05/petit-amusement-du-lundi/</link>
		<comments>http://blog.asyd.net/2009/05/petit-amusement-du-lundi/#comments</comments>
		<pubDate>Mon, 18 May 2009 12:03:36 +0000</pubDate>
		<dc:creator>asyd</dc:creator>
				<category><![CDATA[Social]]></category>

		<guid isPermaLink="false">http://blog.asyd.net/?p=304</guid>
		<description><![CDATA[Vu sur un blog sur lequel je suis tombé par hasard :
ZFS ? Un outil de masturbation intellectuelle. Je préfère encore le btrfs des linux.
Enfin, il vaut mieux en rire qu&#8217;en pleurer, ah ces linuxiens ! Et dire que j&#8217;étais comme ça il y a une certaine (mais lointaine) époque.
]]></description>
			<content:encoded><![CDATA[<p>Vu sur un <a href="http://frederic.bezies.free.fr/blog/?p=2170">blog</a> sur lequel je suis tombé par hasard :</p>
<blockquote><p>ZFS ? Un outil de masturbation intellectuelle. Je préfère encore le btrfs des linux.</p></blockquote>
<p>Enfin, il vaut mieux en rire qu&#8217;en pleurer, ah ces linuxiens ! Et dire que j&#8217;étais comme ça il y a une certaine (mais lointaine) époque.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.asyd.net/2009/05/petit-amusement-du-lundi/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
