<?xml version="1.0" encoding="iso-8859-1"?><!-- generator="b2evolution/3.3.3" -->
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>[[Mathias Chauvin]] - IT stuff</title>
		<link>http://blog.mc-thias.org/</link>
		<atom:link rel="self" type="application/rss+xml" href="http://blog.mc-thias.org/?tempskin=_rss2" />
		<description>Documentation for IT and Geeks.</description>
		<language>en-US</language>
		<docs>http://blogs.law.harvard.edu/tech/rss</docs>
		<admin:generatorAgent rdf:resource="http://b2evolution.net/?v=3.3.3"/>
		<ttl>60</ttl>
				<item>
			<title>Creating a wireless access point in a few minutes</title>
			<link>http://blog.mc-thias.org/?title=creating-a-wireless-access-point-in-a-few-minutes&amp;more=1&amp;c=1&amp;tb=1&amp;pb=1</link>
			<pubDate>Tue, 27 Jul 2010 06:57:42 +0000</pubDate>			<dc:creator>Thias</dc:creator>
			<category domain="main">Linux</category>
<category domain="alt">Debian GNU/Linux</category>
<category domain="alt">Networking</category>			<guid isPermaLink="false">318@http://blog.mc-thias.org/</guid>
						<description>&lt;p&gt;For some any reasons, you need to get a wireless access point running (let say you router or ISP box has just failed&lt;img src=&quot;http://blog.mc-thias.org/rsc/smilies/icon_sad.gif&quot; alt=&quot;&amp;#58;&amp;#40;&quot; class=&quot;middle&quot; /&gt;)&lt;br /&gt;
If you have a spare laptop and an Atheros based wireless card (a Cisco AIR-CB21AG-E PCMCIA is that great!), then you&amp;#8217;re in luck.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;1/ What is needed?&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;
In order to create the wireless access point, the laptop will run Debian GNU/Linux.&lt;br /&gt;
The wireless adapter will be used in &lt;em&gt;Access Point&lt;/em&gt; mode. In order to do so, &lt;strong&gt;&lt;em&gt;hostapd&lt;/em&gt;&lt;/strong&gt; daemon will be used.&lt;br /&gt;
Then, in order to run the router, &lt;strong&gt;&lt;em&gt;iptables&lt;/em&gt;&lt;/strong&gt; rules will need to be setup.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;2/ Install Debian GNU/Linux and configure the OS and network&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;
Get the latest Debian GNU/Linux &lt;a href=&quot;http://www.debian.org/devel/debian-installer/&quot; target=&quot;_blank&quot;&gt;installer&lt;/a&gt; and install Debian GNU/Linux on the spare laptop.&lt;br /&gt;
Install hostapd and shorewall:&lt;/p&gt;
&lt;blockquote&gt;&lt;pre&gt;root@wap:~# apt-get install hostapd 
root@wap:~# apt-get install shorewall shorewall-doc&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;3/ Configure hostapd&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;
The example hostapd.conf file is quite long, detailed and full of options. But you can make it light and quick, as described here.&lt;br /&gt;
Note that this is working for an &lt;em&gt;Atheros&lt;/em&gt; based Wireless adapter, and in this case, the interface is known as &lt;strong&gt;wlan1&lt;/strong&gt; on the system.&lt;/p&gt;
&lt;blockquote&gt;&lt;pre&gt;root@wap:~# cat /etc/hostapd/hostapd.conf
interface=wlan1
driver=nl80211
ssid=TheNameOfTheWirelessNetwork
auth_algs=1
channel=1
hw_mode=g

wpa=1
wpa_passphrase=ThePassphraseOfTheWirelessNetwork
wpa_key_mgmt=WPA-PSK
wpa_pairewise=CCMP
ignore_broadcast_ssid=0
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;Edit the hostadp default file to let the daemon know about its config file:&lt;/p&gt;
&lt;blockquote&gt;&lt;pre&gt;root@wap:~# cat /etc/default/hostapd 
# Defaults for hostapd initscript
#
# See /usr/share/doc/hostapd/README.Debian for information about alternative
# methods of managing hostapd.
#
# Uncomment and set DAEMON_CONF to the absolute path of a hostapd configuration
# file and hostapd will be started during system boot. An example configuration
# file can be found at /usr/share/doc/hostapd/examples/hostapd.conf.gz
#
DAEMON_CONF=&quot;/etc/hostapd/hostapd.conf&quot;

# Additional daemon options to be appended to hostapd command:-
# 	-d   show more debug messages (-dd for even more)
# 	-K   include key data in debug messages
# 	-t   include timestamps in some debug messages
#
# Note that -B (daemon mode) and -P (pidfile) options are automatically
# configured by the init.d script and must not be added to DAEMON_OPTS.
#
#DAEMON_OPTS=&quot;&quot;
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;4/ Configure shorewall&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;
This part is the simplest ever, thanks to Shorewall contributors&amp;#8230; &lt;img src=&quot;http://blog.mc-thias.org/rsc/smilies/icon_wink.gif&quot; alt=&quot;&amp;#59;&amp;#41;&quot; class=&quot;middle&quot; /&gt;&lt;img src=&quot;http://blog.mc-thias.org/rsc/smilies/icon_wink.gif&quot; alt=&quot;&amp;#59;&amp;#41;&quot; class=&quot;middle&quot; /&gt;&lt;img src=&quot;http://blog.mc-thias.org/rsc/smilies/icon_wink.gif&quot; alt=&quot;&amp;#59;&amp;#41;&quot; class=&quot;middle&quot; /&gt;&lt;br /&gt;
If you remember what you&amp;#8217;ve just done in step 2, you&amp;#8217;ve installed both Shorewall and the Shorewall docs.&lt;br /&gt;
In these docs, you&amp;#8217;ll find an example of a two interfaces system, that can easily be configured to route traffic from the wireless adapter to the ethernet adapter (so, from the WLAN to the WAN &lt;img src=&quot;http://blog.mc-thias.org/rsc/smilies/icon_wink.gif&quot; alt=&quot;&amp;#59;&amp;#41;&quot; class=&quot;middle&quot; /&gt;)&lt;/p&gt;

&lt;p&gt;First, copy this example to the shorewall configuration directory:&lt;/p&gt;
&lt;blockquote&gt;&lt;pre&gt;root@wap:~# cd /etc/shorewall
root@wap:~# cp /usr/share/doc/shorewall/examples/two-interfaces/* .&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;Then edit the files to match your network configuration. In my scenario, &lt;strong&gt;eth0&lt;/strong&gt; is the ethernet adapter connected to the WAN, &lt;em&gt;wlan1&lt;/em&gt; is the wireless adapter acting in Access Point mode.&lt;br /&gt;
Here below, the file that have been modified as compared with the example:&lt;/p&gt;
&lt;blockquote&gt;&lt;pre&gt;root@wap:/etc/shorewall# cat interfaces
#ZONE	INTERFACE	BROADCAST	OPTIONS
net     eth0            detect          dhcp,tcpflags,nosmurfs,routefilter,logmartians
loc     wlan1           detect          tcpflags,nosmurfs,routefilter,logmartians

root@wap:/etc/shorewall# cat routestopped 
#INTERFACE	HOST(S)                  OPTIONS
wlan1		-
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;To have shorewall starting on boot, edit the &lt;code class=&quot;codespan&quot;&gt;/etc/shorewall/shorewall.conf&lt;/code&gt; and change the line&lt;/p&gt;
&lt;blockquote&gt;&lt;pre&gt;STARTUP_ENABLED=No&lt;/pre&gt;&lt;/blockquote&gt;&lt;p&gt; to &lt;/p&gt;&lt;blockquote&gt;&lt;pre&gt;STARTUP_ENABLED=Yes&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;&amp;#8220;Et voil&amp;#224;&quot;! Enjoy!!!&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blog.mc-thias.org/?title=creating-a-wireless-access-point-in-a-few-minutes&amp;amp;more=1&amp;amp;c=1&amp;amp;tb=1&amp;amp;pb=1&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>For some any reasons, you need to get a wireless access point running (let say you router or ISP box has just failed<img src="http://blog.mc-thias.org/rsc/smilies/icon_sad.gif" alt="&#58;&#40;" class="middle" />)<br />
If you have a spare laptop and an Atheros based wireless card (a Cisco AIR-CB21AG-E PCMCIA is that great!), then you&#8217;re in luck.</p>

<p><u><strong>1/ What is needed?</strong></u><br />
In order to create the wireless access point, the laptop will run Debian GNU/Linux.<br />
The wireless adapter will be used in <em>Access Point</em> mode. In order to do so, <strong><em>hostapd</em></strong> daemon will be used.<br />
Then, in order to run the router, <strong><em>iptables</em></strong> rules will need to be setup.</p>

<p><u><strong>2/ Install Debian GNU/Linux and configure the OS and network</strong></u><br />
Get the latest Debian GNU/Linux <a href="http://www.debian.org/devel/debian-installer/" target="_blank">installer</a> and install Debian GNU/Linux on the spare laptop.<br />
Install hostapd and shorewall:</p>
<blockquote><pre>root@wap:~# apt-get install hostapd 
root@wap:~# apt-get install shorewall shorewall-doc</pre></blockquote>

<p><u><strong>3/ Configure hostapd</strong></u><br />
The example hostapd.conf file is quite long, detailed and full of options. But you can make it light and quick, as described here.<br />
Note that this is working for an <em>Atheros</em> based Wireless adapter, and in this case, the interface is known as <strong>wlan1</strong> on the system.</p>
<blockquote><pre>root@wap:~# cat /etc/hostapd/hostapd.conf
interface=wlan1
driver=nl80211
ssid=TheNameOfTheWirelessNetwork
auth_algs=1
channel=1
hw_mode=g

wpa=1
wpa_passphrase=ThePassphraseOfTheWirelessNetwork
wpa_key_mgmt=WPA-PSK
wpa_pairewise=CCMP
ignore_broadcast_ssid=0
</pre></blockquote>

<p>Edit the hostadp default file to let the daemon know about its config file:</p>
<blockquote><pre>root@wap:~# cat /etc/default/hostapd 
# Defaults for hostapd initscript
#
# See /usr/share/doc/hostapd/README.Debian for information about alternative
# methods of managing hostapd.
#
# Uncomment and set DAEMON_CONF to the absolute path of a hostapd configuration
# file and hostapd will be started during system boot. An example configuration
# file can be found at /usr/share/doc/hostapd/examples/hostapd.conf.gz
#
DAEMON_CONF="/etc/hostapd/hostapd.conf"

# Additional daemon options to be appended to hostapd command:-
# 	-d   show more debug messages (-dd for even more)
# 	-K   include key data in debug messages
# 	-t   include timestamps in some debug messages
#
# Note that -B (daemon mode) and -P (pidfile) options are automatically
# configured by the init.d script and must not be added to DAEMON_OPTS.
#
#DAEMON_OPTS=""
</pre></blockquote>

<p><u><strong>4/ Configure shorewall</strong></u><br />
This part is the simplest ever, thanks to Shorewall contributors&#8230; <img src="http://blog.mc-thias.org/rsc/smilies/icon_wink.gif" alt="&#59;&#41;" class="middle" /><img src="http://blog.mc-thias.org/rsc/smilies/icon_wink.gif" alt="&#59;&#41;" class="middle" /><img src="http://blog.mc-thias.org/rsc/smilies/icon_wink.gif" alt="&#59;&#41;" class="middle" /><br />
If you remember what you&#8217;ve just done in step 2, you&#8217;ve installed both Shorewall and the Shorewall docs.<br />
In these docs, you&#8217;ll find an example of a two interfaces system, that can easily be configured to route traffic from the wireless adapter to the ethernet adapter (so, from the WLAN to the WAN <img src="http://blog.mc-thias.org/rsc/smilies/icon_wink.gif" alt="&#59;&#41;" class="middle" />)</p>

<p>First, copy this example to the shorewall configuration directory:</p>
<blockquote><pre>root@wap:~# cd /etc/shorewall
root@wap:~# cp /usr/share/doc/shorewall/examples/two-interfaces/* .</pre></blockquote>

<p>Then edit the files to match your network configuration. In my scenario, <strong>eth0</strong> is the ethernet adapter connected to the WAN, <em>wlan1</em> is the wireless adapter acting in Access Point mode.<br />
Here below, the file that have been modified as compared with the example:</p>
<blockquote><pre>root@wap:/etc/shorewall# cat interfaces
#ZONE	INTERFACE	BROADCAST	OPTIONS
net     eth0            detect          dhcp,tcpflags,nosmurfs,routefilter,logmartians
loc     wlan1           detect          tcpflags,nosmurfs,routefilter,logmartians

root@wap:/etc/shorewall# cat routestopped 
#INTERFACE	HOST(S)                  OPTIONS
wlan1		-
</pre></blockquote>

<p>To have shorewall starting on boot, edit the <code class="codespan">/etc/shorewall/shorewall.conf</code> and change the line</p>
<blockquote><pre>STARTUP_ENABLED=No</pre></blockquote><p> to </p><blockquote><pre>STARTUP_ENABLED=Yes</pre></blockquote>

<p>&#8220;Et voil&#224;"! Enjoy!!!</p><div class="item_footer"><p><small><a href="http://blog.mc-thias.org/?title=creating-a-wireless-access-point-in-a-few-minutes&amp;more=1&amp;c=1&amp;tb=1&amp;pb=1">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://blog.mc-thias.org/?title=creating-a-wireless-access-point-in-a-few-minutes&amp;more=1&amp;c=1&amp;tb=1&amp;pb=1#comments</comments>
			<wfw:commentRss>http://blog.mc-thias.org/?tempskin=_rss2&#38;disp=comments&#38;p=318</wfw:commentRss>
		</item>
				<item>
			<title>Oracle VirtualBox and Ubuntu dist-upgrade</title>
			<link>http://blog.mc-thias.org/?title=oracle-virtualbox-and-ubuntu-dist-upgrade&amp;more=1&amp;c=1&amp;tb=1&amp;pb=1</link>
			<pubDate>Thu, 22 Jul 2010 03:55:50 +0000</pubDate>			<dc:creator>Thias</dc:creator>
			<category domain="main">Linux</category>
<category domain="alt">Xen - Virtualisation</category>
<category domain="alt">Ubuntu</category>
<category domain="alt">Active Directory</category>			<guid isPermaLink="false">319@http://blog.mc-thias.org/</guid>
						<description>&lt;p&gt;I&amp;#8217;ve just upgraded an Ubuntu VM from 9.10 to 10.04 LTS running in &lt;em&gt;Oracle VirtualBox 3.2.6&lt;/em&gt;.&lt;br /&gt;
When trying to install the &lt;em&gt;Guest Additions&lt;/em&gt;, I&amp;#8217;ve been facing a non returning script, and a guest which did not allow a higher resolution than 800x600.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;ve figured out that the Ubuntu machine was missing the &lt;strong&gt;&lt;em&gt;DKMS&lt;/em&gt;&lt;/strong&gt; package.&lt;br /&gt;
So in order to have the Guest Additions operational in an Ubuntu 10.04 VM (after a dist-upgrade), make sure to install &lt;em&gt;&lt;strong&gt;DKMS&lt;/strong&gt;&lt;/em&gt;:&lt;/p&gt;
&lt;blockquote&gt;&lt;pre&gt;[user@ubuntu1004:~] sudo apt-get install dkms&lt;/pre&gt;&lt;/blockquote&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blog.mc-thias.org/?title=oracle-virtualbox-and-ubuntu-dist-upgrade&amp;amp;more=1&amp;amp;c=1&amp;amp;tb=1&amp;amp;pb=1&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>I&#8217;ve just upgraded an Ubuntu VM from 9.10 to 10.04 LTS running in <em>Oracle VirtualBox 3.2.6</em>.<br />
When trying to install the <em>Guest Additions</em>, I&#8217;ve been facing a non returning script, and a guest which did not allow a higher resolution than 800x600.</p>

<p>I&#8217;ve figured out that the Ubuntu machine was missing the <strong><em>DKMS</em></strong> package.<br />
So in order to have the Guest Additions operational in an Ubuntu 10.04 VM (after a dist-upgrade), make sure to install <em><strong>DKMS</strong></em>:</p>
<blockquote><pre>[user@ubuntu1004:~] sudo apt-get install dkms</pre></blockquote><div class="item_footer"><p><small><a href="http://blog.mc-thias.org/?title=oracle-virtualbox-and-ubuntu-dist-upgrade&amp;more=1&amp;c=1&amp;tb=1&amp;pb=1">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://blog.mc-thias.org/?title=oracle-virtualbox-and-ubuntu-dist-upgrade&amp;more=1&amp;c=1&amp;tb=1&amp;pb=1#comments</comments>
			<wfw:commentRss>http://blog.mc-thias.org/?tempskin=_rss2&#38;disp=comments&#38;p=319</wfw:commentRss>
		</item>
				<item>
			<title>Upgrading Checkpoint on a Dell PowerEdge 2950</title>
			<link>http://blog.mc-thias.org/?title=upgrading-checkpoint-on-a-dell-poweredge-2950&amp;more=1&amp;c=1&amp;tb=1&amp;pb=1</link>
			<pubDate>Fri, 25 Jun 2010 13:11:19 +0000</pubDate>			<dc:creator>Thias</dc:creator>
			<category domain="alt">Unix</category>
<category domain="main">Networking</category>
<category domain="alt">Services</category>			<guid isPermaLink="false">317@http://blog.mc-thias.org/</guid>
						<description>&lt;p&gt;While trying to upgrade a CheckPoint SmartCenter running SPLAT (SecurePlatform) on a Dell PE2950, I&amp;#8217;ve been facing a few issues.&lt;br /&gt;
The Dell PE2950 on which I&amp;#8217;m running CheckPoint has a DRAC controller and an IDE CD/DVDrom drive.&lt;/p&gt;

&lt;p&gt;The first issue was linked to the IDE CDrom drive, not able to run the installer of CheckPoint. Therefore, the ISO file of the Installation CDrom has been used from the DRAC virtual media.&lt;/p&gt;

&lt;p&gt;The second issue is still linked to this IDE CDrom drive. If enabled, then two cdrom devices are created under the SecurePlatform OS, preventing the use of&lt;/p&gt;
&lt;blockquote&gt;&lt;pre&gt;patch add cd&lt;/pre&gt;&lt;/blockquote&gt;
&lt;p&gt;to do an upgrade.&lt;br /&gt;
By default the upgrade process looks for the CD to be &lt;code class=&quot;codespan&quot;&gt;/dev/cdrom&lt;/code&gt; while both &lt;code class=&quot;codespan&quot;&gt;/dev/cdrom&lt;/code&gt; and &lt;code class=&quot;codespan&quot;&gt;/dev/cdrom1&lt;/code&gt; are available, the first being the IDE CDrom drive, the second being the DRAC Virtual Media.&lt;/p&gt;

&lt;p&gt;In order to run the upgrade, the IDE CDrom can be disabled from the BIOS, and the &lt;code class=&quot;codespan&quot;&gt;/etc/fstab&lt;/code&gt; updated to match the CDrom device to be mounted to &lt;code class=&quot;codespan&quot;&gt;/mnt/cdrom&lt;/code&gt; (using the &lt;code class=&quot;codespan&quot;&gt;expert&lt;/code&gt; mode).&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blog.mc-thias.org/?title=upgrading-checkpoint-on-a-dell-poweredge-2950&amp;amp;more=1&amp;amp;c=1&amp;amp;tb=1&amp;amp;pb=1&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>While trying to upgrade a CheckPoint SmartCenter running SPLAT (SecurePlatform) on a Dell PE2950, I&#8217;ve been facing a few issues.<br />
The Dell PE2950 on which I&#8217;m running CheckPoint has a DRAC controller and an IDE CD/DVDrom drive.</p>

<p>The first issue was linked to the IDE CDrom drive, not able to run the installer of CheckPoint. Therefore, the ISO file of the Installation CDrom has been used from the DRAC virtual media.</p>

<p>The second issue is still linked to this IDE CDrom drive. If enabled, then two cdrom devices are created under the SecurePlatform OS, preventing the use of</p>
<blockquote><pre>patch add cd</pre></blockquote>
<p>to do an upgrade.<br />
By default the upgrade process looks for the CD to be <code class="codespan">/dev/cdrom</code> while both <code class="codespan">/dev/cdrom</code> and <code class="codespan">/dev/cdrom1</code> are available, the first being the IDE CDrom drive, the second being the DRAC Virtual Media.</p>

<p>In order to run the upgrade, the IDE CDrom can be disabled from the BIOS, and the <code class="codespan">/etc/fstab</code> updated to match the CDrom device to be mounted to <code class="codespan">/mnt/cdrom</code> (using the <code class="codespan">expert</code> mode).</p><div class="item_footer"><p><small><a href="http://blog.mc-thias.org/?title=upgrading-checkpoint-on-a-dell-poweredge-2950&amp;more=1&amp;c=1&amp;tb=1&amp;pb=1">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://blog.mc-thias.org/?title=upgrading-checkpoint-on-a-dell-poweredge-2950&amp;more=1&amp;c=1&amp;tb=1&amp;pb=1#comments</comments>
			<wfw:commentRss>http://blog.mc-thias.org/?tempskin=_rss2&#38;disp=comments&#38;p=317</wfw:commentRss>
		</item>
				<item>
			<title>ZFS best practice....</title>
			<link>http://blog.mc-thias.org/?title=zfs-best-practice&amp;more=1&amp;c=1&amp;tb=1&amp;pb=1</link>
			<pubDate>Thu, 17 Jun 2010 12:58:44 +0000</pubDate>			<dc:creator>Thias</dc:creator>
			<category domain="alt">Unix</category>
<category domain="main">Sun Solaris</category>			<guid isPermaLink="false">316@http://blog.mc-thias.org/</guid>
						<description>&lt;p&gt;A quick remark from a Sun tech guy:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&amp;#8220;It is prefered to create a ZFS storage pool using a full disk&amp;#8230;&amp;#8221;&lt;/em&gt;&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blog.mc-thias.org/?title=zfs-best-practice&amp;amp;more=1&amp;amp;c=1&amp;amp;tb=1&amp;amp;pb=1&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>A quick remark from a Sun tech guy:</p>

<p><em>&#8220;It is prefered to create a ZFS storage pool using a full disk&#8230;&#8221;</em></p><div class="item_footer"><p><small><a href="http://blog.mc-thias.org/?title=zfs-best-practice&amp;more=1&amp;c=1&amp;tb=1&amp;pb=1">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://blog.mc-thias.org/?title=zfs-best-practice&amp;more=1&amp;c=1&amp;tb=1&amp;pb=1#comments</comments>
			<wfw:commentRss>http://blog.mc-thias.org/?tempskin=_rss2&#38;disp=comments&#38;p=316</wfw:commentRss>
		</item>
				<item>
			<title>Get serial number on a MS Windows server</title>
			<link>http://blog.mc-thias.org/?title=get-serial-number-on-a-ms-windows-server&amp;more=1&amp;c=1&amp;tb=1&amp;pb=1</link>
			<pubDate>Wed, 16 Jun 2010 14:40:51 +0000</pubDate>			<dc:creator>Thias</dc:creator>
			<category domain="main">Microsoft</category>
<category domain="alt">Scripting</category>			<guid isPermaLink="false">315@http://blog.mc-thias.org/</guid>
						<description>&lt;p&gt;I was looking for a remote server Serial Number and found out that, when running Windows, WMI has a command line tool which can save you a lot of time!&lt;/p&gt;
&lt;blockquote&gt;&lt;pre&gt;C:\&gt;wmic /user:administrator /node:remote-host bios get serialnumber&lt;/pre&gt;&lt;/blockquote&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blog.mc-thias.org/?title=get-serial-number-on-a-ms-windows-server&amp;amp;more=1&amp;amp;c=1&amp;amp;tb=1&amp;amp;pb=1&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>I was looking for a remote server Serial Number and found out that, when running Windows, WMI has a command line tool which can save you a lot of time!</p>
<blockquote><pre>C:\>wmic /user:administrator /node:remote-host bios get serialnumber</pre></blockquote><div class="item_footer"><p><small><a href="http://blog.mc-thias.org/?title=get-serial-number-on-a-ms-windows-server&amp;more=1&amp;c=1&amp;tb=1&amp;pb=1">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://blog.mc-thias.org/?title=get-serial-number-on-a-ms-windows-server&amp;more=1&amp;c=1&amp;tb=1&amp;pb=1#comments</comments>
			<wfw:commentRss>http://blog.mc-thias.org/?tempskin=_rss2&#38;disp=comments&#38;p=315</wfw:commentRss>
		</item>
				<item>
			<title>Enabling ssh on Sun network management console</title>
			<link>http://blog.mc-thias.org/?title=enabling-ssh-on-sun-network-management-console&amp;more=1&amp;c=1&amp;tb=1&amp;pb=1</link>
			<pubDate>Tue, 27 Apr 2010 13:24:04 +0000</pubDate>			<dc:creator>Thias</dc:creator>
			<category domain="alt">Unix</category>
<category domain="main">Sun Solaris</category>			<guid isPermaLink="false">314@http://blog.mc-thias.org/</guid>
						<description>&lt;p&gt;To enable SSH on ALOM, the ALOM variable &amp;#8220;&lt;code class=&quot;codespan&quot;&gt;if_connection&lt;/code&gt;&amp;#8221; has to be set to ssh, followed by ALOM reset:&lt;/p&gt;

&lt;blockquote&gt;&lt;pre&gt;sc&gt; setsc if_connection ssh
sc&gt; resetsc -y&lt;/pre&gt;&lt;/blockquote&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blog.mc-thias.org/?title=enabling-ssh-on-sun-network-management-console&amp;amp;more=1&amp;amp;c=1&amp;amp;tb=1&amp;amp;pb=1&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>To enable SSH on ALOM, the ALOM variable &#8220;<code class="codespan">if_connection</code>&#8221; has to be set to ssh, followed by ALOM reset:</p>

<blockquote><pre>sc> setsc if_connection ssh
sc> resetsc -y</pre></blockquote><div class="item_footer"><p><small><a href="http://blog.mc-thias.org/?title=enabling-ssh-on-sun-network-management-console&amp;more=1&amp;c=1&amp;tb=1&amp;pb=1">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://blog.mc-thias.org/?title=enabling-ssh-on-sun-network-management-console&amp;more=1&amp;c=1&amp;tb=1&amp;pb=1#comments</comments>
			<wfw:commentRss>http://blog.mc-thias.org/?tempskin=_rss2&#38;disp=comments&#38;p=314</wfw:commentRss>
		</item>
				<item>
			<title>Prepare a RedHat Kickstart server automatically...</title>
			<link>http://blog.mc-thias.org/?title=prepare-a-redhat-kickstart-server-automatically&amp;more=1&amp;c=1&amp;tb=1&amp;pb=1</link>
			<pubDate>Mon, 26 Apr 2010 15:33:46 +0000</pubDate>			<dc:creator>Thias</dc:creator>
			<category domain="alt">Linux</category>
<category domain="main">RHEL / CentOS / Fedora</category>
<category domain="alt">Scripting</category>			<guid isPermaLink="false">312@http://blog.mc-thias.org/</guid>
						<description>&lt;p&gt;In order to improve the process of deploying RedHat servers in a development lab, a new script has been written.&lt;br /&gt;
This script is named:&lt;/p&gt;
&lt;blockquote&gt;&lt;pre&gt;kick-setup.sh&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;The aim of this script is to set the kickstart environment for a new RedHat release on a Kickstart server running Solaris 10 or a flavor of Linux OS in a fully automated manner.&lt;br /&gt;
Two steps only are now required to prepare the Kickstart environment for a new RedHat release (can simply be a new RedHat update as well):&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;p&gt;First, connect to the RedHat network &lt;a href=&quot;https://rhn.redhat.com&quot; target=&quot;_blank&quot;&gt;https://rhn.redhat.com&lt;/a&gt; to download the RedHat DVD iso you need and that is not already setup in the kickstart server. &lt;br /&gt;
Place the downloaded iso file in your iso repository. Note that the path to the isos must look like:&lt;/p&gt;
&lt;blockquote&gt;&lt;pre&gt;  /path/to/isos/linux/RHEL?/&lt;/pre&gt;&lt;/blockquote&gt; where &lt;code class=&quot;codespan&quot;&gt;?&lt;/code&gt; is the number of the RedHat release.&lt;/li&gt;
  &lt;li&gt;Connect to your Kickstart server and run the script with the appropriate options.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here below the help for the script, as well as an example:&lt;/p&gt;
&lt;blockquote&gt;&lt;pre&gt;root@ksserver:/export/kickstart# /opt/mc-thias/bin/kick-setup.sh -h  

This script intends to setup the whole Kickstart server 
for a specific release and update of RedHat Enterprise Linux.
This setup will be done according to a few required parameters, 
and thanks to the RHEL DVD iso.

kick-setup.sh is to be used with four mandatory parameters:
  - The release number of the RedHat Enterprise Linux to be deployed. 
    This number is an integer, for instance 5 for RedHat 5.
    This option is:
      -r num
  - The update number of the RedHat Enterprise Linux release to be deployed. 
    This number is an integer, as 4 for RedHat 5 Update 4.
    This option is:
      -u num
  - The arch of the RedHat Enterprise Linux to be deployed. 
    This is either 32b or 64b for 32 or 64 bits x86. 
    This option is:
      -m 32b|64b
  - The iso file of the RedHat EL that is to be setup on the Kickstart server.
    This iso should have first been downloaded from rhn.redhat.com
    This option is:
      -i iso_name

Examples:
To deploy RHEL6 U2 for x86 32bits, you would run the following:
  ./kick-setup.sh -r 6 -u 2 -m 32b -i rhel-server-6.2-i386-dvd.iso&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;Hit the &lt;em&gt;Read More&lt;/em&gt; link to get the script and learn more on how to use it&lt;/p&gt;
&lt;a href=&quot;http://blog.mc-thias.org/?title=prepare-a-redhat-kickstart-server-automatically&amp;amp;more=1&amp;amp;c=1&amp;amp;tb=1&amp;amp;pb=1#more312&quot;&gt;Read more &amp;raquo;&lt;/a&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blog.mc-thias.org/?title=prepare-a-redhat-kickstart-server-automatically&amp;amp;more=1&amp;amp;c=1&amp;amp;tb=1&amp;amp;pb=1&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>In order to improve the process of deploying RedHat servers in a development lab, a new script has been written.<br />
This script is named:</p>
<blockquote><pre>kick-setup.sh</pre></blockquote>

<p>The aim of this script is to set the kickstart environment for a new RedHat release on a Kickstart server running Solaris 10 or a flavor of Linux OS in a fully automated manner.<br />
Two steps only are now required to prepare the Kickstart environment for a new RedHat release (can simply be a new RedHat update as well):</p>

<ol>
  <li><p>First, connect to the RedHat network <a href="https://rhn.redhat.com" target="_blank">https://rhn.redhat.com</a> to download the RedHat DVD iso you need and that is not already setup in the kickstart server. <br />
Place the downloaded iso file in your iso repository. Note that the path to the isos must look like:</p>
<blockquote><pre>  /path/to/isos/linux/RHEL?/</pre></blockquote> where <code class="codespan">?</code> is the number of the RedHat release.</li>
  <li>Connect to your Kickstart server and run the script with the appropriate options.</li>
</ol>

<p>Here below the help for the script, as well as an example:</p>
<blockquote><pre>root@ksserver:/export/kickstart# /opt/mc-thias/bin/kick-setup.sh -h  

This script intends to setup the whole Kickstart server 
for a specific release and update of RedHat Enterprise Linux.
This setup will be done according to a few required parameters, 
and thanks to the RHEL DVD iso.

kick-setup.sh is to be used with four mandatory parameters:
  - The release number of the RedHat Enterprise Linux to be deployed. 
    This number is an integer, for instance 5 for RedHat 5.
    This option is:
      -r num
  - The update number of the RedHat Enterprise Linux release to be deployed. 
    This number is an integer, as 4 for RedHat 5 Update 4.
    This option is:
      -u num
  - The arch of the RedHat Enterprise Linux to be deployed. 
    This is either 32b or 64b for 32 or 64 bits x86. 
    This option is:
      -m 32b|64b
  - The iso file of the RedHat EL that is to be setup on the Kickstart server.
    This iso should have first been downloaded from rhn.redhat.com
    This option is:
      -i iso_name

Examples:
To deploy RHEL6 U2 for x86 32bits, you would run the following:
  ./kick-setup.sh -r 6 -u 2 -m 32b -i rhel-server-6.2-i386-dvd.iso</pre></blockquote>

<p>Hit the <em>Read More</em> link to get the script and learn more on how to use it</p>
<a href="http://blog.mc-thias.org/?title=prepare-a-redhat-kickstart-server-automatically&amp;more=1&amp;c=1&amp;tb=1&amp;pb=1#more312">Read more &raquo;</a><div class="item_footer"><p><small><a href="http://blog.mc-thias.org/?title=prepare-a-redhat-kickstart-server-automatically&amp;more=1&amp;c=1&amp;tb=1&amp;pb=1">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://blog.mc-thias.org/?title=prepare-a-redhat-kickstart-server-automatically&amp;more=1&amp;c=1&amp;tb=1&amp;pb=1#comments</comments>
			<wfw:commentRss>http://blog.mc-thias.org/?tempskin=_rss2&#38;disp=comments&#38;p=312</wfw:commentRss>
		</item>
				<item>
			<title>EMC Networker: export list of clients to csv file</title>
			<link>http://blog.mc-thias.org/?title=emc-networker-export-list-of-clients-to-csv-file&amp;more=1&amp;c=1&amp;tb=1&amp;pb=1</link>
			<pubDate>Thu, 22 Apr 2010 15:28:44 +0000</pubDate>			<dc:creator>Thias</dc:creator>
			<category domain="main">Scripting</category>
<category domain="alt">Services</category>			<guid isPermaLink="false">313@http://blog.mc-thias.org/</guid>
						<description>&lt;p&gt;&lt;strong&gt;&lt;u&gt;1/ Presentation&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
For some reasons, mainly reporting/quality ones &lt;img src=&quot;http://blog.mc-thias.org/rsc/smilies/icon_wink.gif&quot; alt=&quot;&amp;#59;&amp;#41;&quot; class=&quot;middle&quot; /&gt;, one might have to export a list of the clients currently backed up by a Networker server.&lt;/p&gt;

&lt;p&gt;When it comes to access the Networker configuration from the command lines a few tools appear to be very useful:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;codespan&quot;&gt;mminfo&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;codespan&quot;&gt;nsradmin&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;among others. Therefore you are invited to have a look at the man pages of these tools.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;2/ The request one can face&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
In order to comply with some reporting/quality policies, one might want to get the list of Networker clients currently in use, with their &lt;em&gt;Description&lt;/em&gt;, &lt;em&gt;Groups&lt;/em&gt;, &lt;em&gt;Save set&lt;/em&gt;, &lt;em&gt;Browse Policy&lt;/em&gt; and &lt;em&gt;Retention Policy&lt;/em&gt;.&lt;br /&gt;
The &lt;code class=&quot;codespan&quot;&gt;nsradmin&lt;/code&gt; tool will then be used.&lt;br /&gt;
Let&amp;#8217;s see how the nsradmin script looks like:&lt;/p&gt;
&lt;blockquote&gt;&lt;pre&gt;[root@nwserver ~]# cat /tmp/clientlist.cmd
. type: nsr client;scheduled backup: Enabled
show name;group;comment;&quot;save set&quot;;&quot;browse policy&quot;;&quot;retention policy&quot;
print
root@nwserver:~#&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;Running this script leads to the result one might expect, displaying every enabled clients, with their &lt;em&gt;name&lt;/em&gt;, &lt;em&gt;group&lt;/em&gt;, &lt;em&gt;comment/description&lt;/em&gt;, &lt;em&gt;save set&lt;/em&gt; and &lt;em&gt;browse&lt;/em&gt; and &lt;em&gt;retention policies&lt;/em&gt;. But the format of the output is not quite easy to work with when building reports (integration in an Excel spreadsheet for instance).&lt;br /&gt;
Let&amp;#8217;s see an example:&lt;/p&gt;
&lt;blockquote&gt;&lt;pre&gt;[root@nwserver ~]# nsradmin -i /tmp/clientlist.cmd
[...]
                       name: gw.domain.com;
                     comment: Gateway main;
               browse policy: Year;
            retention policy: 10 ans;
                       group: FULL 1st quarter;
                    save set: All;

                        name: logs.domain.com;
                     comment: Logs server;
               browse policy: Year;
            retention policy: 3 ans;
                       group: Full Q2 Q3 Q4;
                    save set: All;
[...]&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;3/ Building a CSV format report from these data&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
In order to make these data easily workable, a Perl script is being used, translating this raw output from &lt;code class=&quot;codespan&quot;&gt;nsradmin&lt;/code&gt; to a CSV format.&lt;/p&gt;

&lt;p&gt;You can fin the script &lt;a href=&quot;http://blog.mc-thias.org/media/blogs/itstuff/networker/getclientlist.pl&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Have a look at the content of this script as you might want to modify some parameters:&lt;/p&gt;
&lt;blockquote&gt;&lt;pre&gt;$nsradmin_cmd = &quot;/nsr/sbin/nsradmin&quot;;
$tmp_cmd_file = &quot;/tmp/clientlist.cmd&quot;;
$tmp_csv_file = &quot;/tmp/clientlist.csv&quot;;&lt;/pre&gt;&lt;/blockquote&gt;
&lt;p&gt;where &lt;code class=&quot;codespan&quot;&gt;tmp_csv_file&lt;/code&gt; is the CSV output file.&lt;/p&gt;

&lt;p&gt;The script is quite simple. It is simply using a hash of hashes to parse the output from the &lt;code class=&quot;codespan&quot;&gt;nsradmin&lt;/code&gt; script:&lt;/p&gt;
&lt;blockquote&gt;&lt;pre&gt;%result = ( &quot;_name&quot; =&gt; {
                comment =&gt; &quot;Description&quot;,
                groups =&gt; {
                        group   =&gt; &quot;Backup Group&quot;,
                        saveset =&gt; &quot;Save set&quot;,
                        brpol   =&gt; &quot;Browse Policy&quot;,
                        retpol  =&gt; &quot;Retention Policy&quot;
                        },
                },
);&lt;/pre&gt;&lt;/blockquote&gt;
&lt;p&gt;This part of the script initializes the hash of hashes with entries that stand for the header of the resulting table.&lt;br /&gt;
Then the hash of hashes is built using a &lt;code class=&quot;codespan&quot;&gt;for&lt;/code&gt; loop:&lt;/p&gt;
&lt;blockquote&gt;&lt;pre&gt;$svrname=&quot;&quot;;
$savegrp=&quot;&quot;;
$grpidx=0;
for $rawlist_el(@rawlist) {
        $field = substr($rawlist_el,0,28);
        $field =~ s/^\s+|\s+$//g;
        chomp $field;
        $data = substr($rawlist_el,30);
        chomp $data;
        chop $data;
        switch ($field) {
                case &quot;name&quot;     { $svrname = $data; $grpidx++; }
                case &quot;comment&quot;  { $result{&quot;$svrname&quot;}{&quot;comment&quot;} = &quot;$data&quot;; }
                case &quot;group&quot;    { 
                       $result{&quot;$svrname&quot;}{&quot;groups$grpidx&quot;}{&quot;group&quot;} = &quot;$data &quot;; }
                case &quot;save set&quot; {
                       $result{&quot;$svrname&quot;}{&quot;groups$grpidx&quot;}{&quot;saveset&quot;} .= &quot;$data &quot;; }
                case &quot;browse policy&quot;    { 
                       $result{&quot;$svrname&quot;}{&quot;groups$grpidx&quot;}{&quot;brpol&quot;} .= &quot;$data &quot;; }
                case &quot;retention policy&quot; { 
                       $result{&quot;$svrname&quot;}{&quot;groups$grpidx&quot;}{&quot;retpol&quot;} .= &quot;$data &quot;; }
                case &quot;&quot; { 
                       $result{&quot;$svrname&quot;}{&quot;groups$grpidx&quot;}{&quot;saveset&quot;} .= &quot;$data &quot;; }
        }
}&lt;/pre&gt;&lt;/blockquote&gt;
&lt;p&gt;An index (&lt;code class=&quot;codespan&quot;&gt;grpidx&lt;/code&gt;) is used as a client can belong to multiple groups.&lt;br /&gt;
The values &lt;code class=&quot;codespan&quot;&gt;28&lt;/code&gt; and &lt;code class=&quot;codespan&quot;&gt;30&lt;/code&gt; might be adjusted but are a match on the server that I&amp;#8217;m working with.&lt;br /&gt;
They are corresponding to the number of char used for the first field in the nsradmin output.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;4/ Use of the output&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
Once the CSV file has been generated, it can be imported in Excel or in any Spreadsheet tool, and can be easily manipulated to generate reports.&lt;/p&gt;

&lt;p&gt;Enjoy&amp;#8230;&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blog.mc-thias.org/?title=emc-networker-export-list-of-clients-to-csv-file&amp;amp;more=1&amp;amp;c=1&amp;amp;tb=1&amp;amp;pb=1&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p><strong><u>1/ Presentation</u></strong><br />
For some reasons, mainly reporting/quality ones <img src="http://blog.mc-thias.org/rsc/smilies/icon_wink.gif" alt="&#59;&#41;" class="middle" />, one might have to export a list of the clients currently backed up by a Networker server.</p>

<p>When it comes to access the Networker configuration from the command lines a few tools appear to be very useful:</p>
<ul>
  <li><code class="codespan">mminfo</code></li>
  <li><code class="codespan">nsradmin</code></li>
</ul>
<p>among others. Therefore you are invited to have a look at the man pages of these tools.</p>

<p><strong><u>2/ The request one can face</u></strong><br />
In order to comply with some reporting/quality policies, one might want to get the list of Networker clients currently in use, with their <em>Description</em>, <em>Groups</em>, <em>Save set</em>, <em>Browse Policy</em> and <em>Retention Policy</em>.<br />
The <code class="codespan">nsradmin</code> tool will then be used.<br />
Let&#8217;s see how the nsradmin script looks like:</p>
<blockquote><pre>[root@nwserver ~]# cat /tmp/clientlist.cmd
. type: nsr client;scheduled backup: Enabled
show name;group;comment;"save set";"browse policy";"retention policy"
print
root@nwserver:~#</pre></blockquote>

<p>Running this script leads to the result one might expect, displaying every enabled clients, with their <em>name</em>, <em>group</em>, <em>comment/description</em>, <em>save set</em> and <em>browse</em> and <em>retention policies</em>. But the format of the output is not quite easy to work with when building reports (integration in an Excel spreadsheet for instance).<br />
Let&#8217;s see an example:</p>
<blockquote><pre>[root@nwserver ~]# nsradmin -i /tmp/clientlist.cmd
[...]
                       name: gw.domain.com;
                     comment: Gateway main;
               browse policy: Year;
            retention policy: 10 ans;
                       group: FULL 1st quarter;
                    save set: All;

                        name: logs.domain.com;
                     comment: Logs server;
               browse policy: Year;
            retention policy: 3 ans;
                       group: Full Q2 Q3 Q4;
                    save set: All;
[...]</pre></blockquote>

<p><strong><u>3/ Building a CSV format report from these data</u></strong><br />
In order to make these data easily workable, a Perl script is being used, translating this raw output from <code class="codespan">nsradmin</code> to a CSV format.</p>

<p>You can fin the script <a href="http://blog.mc-thias.org/media/blogs/itstuff/networker/getclientlist.pl" target="_blank">here</a></p>

<p>Have a look at the content of this script as you might want to modify some parameters:</p>
<blockquote><pre>$nsradmin_cmd = "/nsr/sbin/nsradmin";
$tmp_cmd_file = "/tmp/clientlist.cmd";
$tmp_csv_file = "/tmp/clientlist.csv";</pre></blockquote>
<p>where <code class="codespan">tmp_csv_file</code> is the CSV output file.</p>

<p>The script is quite simple. It is simply using a hash of hashes to parse the output from the <code class="codespan">nsradmin</code> script:</p>
<blockquote><pre>%result = ( "_name" => {
                comment => "Description",
                groups => {
                        group   => "Backup Group",
                        saveset => "Save set",
                        brpol   => "Browse Policy",
                        retpol  => "Retention Policy"
                        },
                },
);</pre></blockquote>
<p>This part of the script initializes the hash of hashes with entries that stand for the header of the resulting table.<br />
Then the hash of hashes is built using a <code class="codespan">for</code> loop:</p>
<blockquote><pre>$svrname="";
$savegrp="";
$grpidx=0;
for $rawlist_el(@rawlist) {
        $field = substr($rawlist_el,0,28);
        $field =~ s/^\s+|\s+$//g;
        chomp $field;
        $data = substr($rawlist_el,30);
        chomp $data;
        chop $data;
        switch ($field) {
                case "name"     { $svrname = $data; $grpidx++; }
                case "comment"  { $result{"$svrname"}{"comment"} = "$data"; }
                case "group"    { 
                       $result{"$svrname"}{"groups$grpidx"}{"group"} = "$data "; }
                case "save set" {
                       $result{"$svrname"}{"groups$grpidx"}{"saveset"} .= "$data "; }
                case "browse policy"    { 
                       $result{"$svrname"}{"groups$grpidx"}{"brpol"} .= "$data "; }
                case "retention policy" { 
                       $result{"$svrname"}{"groups$grpidx"}{"retpol"} .= "$data "; }
                case "" { 
                       $result{"$svrname"}{"groups$grpidx"}{"saveset"} .= "$data "; }
        }
}</pre></blockquote>
<p>An index (<code class="codespan">grpidx</code>) is used as a client can belong to multiple groups.<br />
The values <code class="codespan">28</code> and <code class="codespan">30</code> might be adjusted but are a match on the server that I&#8217;m working with.<br />
They are corresponding to the number of char used for the first field in the nsradmin output.</p>

<p><strong><u>4/ Use of the output</u></strong><br />
Once the CSV file has been generated, it can be imported in Excel or in any Spreadsheet tool, and can be easily manipulated to generate reports.</p>

<p>Enjoy&#8230;</p><div class="item_footer"><p><small><a href="http://blog.mc-thias.org/?title=emc-networker-export-list-of-clients-to-csv-file&amp;more=1&amp;c=1&amp;tb=1&amp;pb=1">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://blog.mc-thias.org/?title=emc-networker-export-list-of-clients-to-csv-file&amp;more=1&amp;c=1&amp;tb=1&amp;pb=1#comments</comments>
			<wfw:commentRss>http://blog.mc-thias.org/?tempskin=_rss2&#38;disp=comments&#38;p=313</wfw:commentRss>
		</item>
			</channel>
</rss>
