<?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>kristijan.org</title>
	<atom:link href="http://www.kristijan.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kristijan.org</link>
	<description>Ramblings of a sysadmin</description>
	<lastBuildDate>Wed, 26 Oct 2011 10:19:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>NFS cross-mounts in PowerHA/HACMP</title>
		<link>http://www.kristijan.org/2011/07/nfs-cross-mounts-in-powerhahacmp/</link>
		<comments>http://www.kristijan.org/2011/07/nfs-cross-mounts-in-powerhahacmp/#comments</comments>
		<pubDate>Tue, 26 Jul 2011 08:38:57 +0000</pubDate>
		<dc:creator>Kristijan</dc:creator>
				<category><![CDATA[AIX]]></category>
		<category><![CDATA[HACMP]]></category>
		<category><![CDATA[PowerHA]]></category>
		<category><![CDATA[aix]]></category>
		<category><![CDATA[cross mount]]></category>
		<category><![CDATA[hacmp]]></category>
		<category><![CDATA[nfs]]></category>
		<category><![CDATA[powerha]]></category>

		<guid isPermaLink="false">http://www.kristijan.org/?p=238</guid>
		<description><![CDATA[Combining NFS with PowerHA we can achieve a HANFS (Highly Available Network File System). The basic concept behind this solution is that one node in the cluster mounts the resource locally, and offers that as an exported resource via a serviceable IP. Another node in the cluster is then configured  [...]]]></description>
			<content:encoded><![CDATA[<p>Combining NFS with PowerHA we can achieve a HANFS (Highly Available Network File System). The basic concept behind this solution is that one node in the cluster mounts the resource locally, and offers that as an exported resource via a serviceable IP. Another node in the cluster is then configured to take on the resource in the event of failure.</p>
<p>If you&#8217;re following this, I&#8217;m taking the assumption that your cluster is already configured, you have a working IP network and have set up a shared volume group between the cluster nodes that will be handling the HANFS failover. Before we get started though, there are a few things which need to be installed/verified.<br />
<span id="more-238"></span><br />
<strong><font size="4">Prerequisites</font></strong><br />
The cluster.es.nfs.rte fileset needs to be installed so that PowerHA can work with HANFS.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># lslpp -l cluster.es.nfs.rte
  Fileset                      Level  State      Description
  ----------------------------------------------------------------------------
Path: /usr/lib/objrepos
  cluster.es.nfs.rte         5.5.0.1  COMMITTED  ES NFS Support
&nbsp;
Path: /etc/objrepos
  cluster.es.nfs.rte         5.5.0.1  COMMITTED  ES NFS Support</pre></div></div>

<p>Also, since we&#8217;re dealing with NFS, we need to make sure we have the portmapper daemon running.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># lssrc -s portmap
Subsystem         Group            PID          Status
 portmap          portmap          213160       active</pre></div></div>

<p>To have the portmapper daemon start during system boot, you&#8217;ll need to modify /etc/rc.tcpip and uncomment the start line below.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># Start up Portmapper
start /usr/sbin/portmap &quot;$src_running&quot;</pre></div></div>

<p><strong><font size="4">Scenario</font></strong><br />
Below is a table of what the HANFS layout looks like (click image to expand).</p>
<p><a href="http://www.kristijan.org/images/layout.png" rel="lightbox[layout]" title="HANFS Resource Group layout"><img src="http://www.kristijan.org/images/layout_small.png" align="center" border="0"></a></p>
<p>We have a Resource Group (RG_nfs) which contains an Application Server (app_nfsv4) and a Service IP Label (serviceip-nfs). There is a Shared Volume Group (haNFSvg) which contains some Shared Logical Volumes &amp; Filesystems. The thing to take note here, is that we are only exporting two of the three filesystems that you see in the table. The /nfs_stable filesystem will be the NFSv4 stable storage path location. The below is taken from the IBM website[1]. I recommend you read it for further information on NFSv4 stable storage and PowerHA.</p>
<blockquote><p>&#8220;Stable Storage is a file system space that is used to save the state information by the NFSv4 server. This is very crucial for maintaining NFSv4 client&#8217;s state information to facilitate smooth and transparent fallover/fallback/move of the Resource group from one node to other.&#8221;</p></blockquote>
<p><strong><font size="4">Configuration</font></strong><br />
With the above information in hand, we&#8217;re ready to start configuring HANFS.</p>
<p><strong>Step 1 (All Nodes) Set the NFS domain</strong><br />
The NFSv4 domain needs to be set on all cluster nodes which will be responsible for taking on the RG_nfs resource group in the event of a failure.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># chnfsdom	          &lt;- This will show the current NFS domain
# chnfsdom [new_domain]	  &lt;- To set a new NFS domain</pre></div></div>

<p><strong>Step 2 (All Nodes) Create mount points</strong><br />
The mount points need to be created on all cluster nodes which will be responsible for taking on the RG_nfs resource group in the event of a failure.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># mkdir -p /home/kristian
# mkdir -p /data</pre></div></div>

<p>Take note that we&#8217;re only creating the mount points here, and not the logical volumes or filesystems.</p>
<p><strong>Step 3 &#8211; Create logical volumes and filesystems</strong><br />
Now we create the following logical volumes:</p>
<ul>
<li>hanfs_kris_lv</li>
<li>hanfs_data_lv</li>
<li>hanfs_nfsstable_lv</li>
</ul>
<p>Create the logical volumes using the following path.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># smit hacmp
	-&gt; System Management (C-SPOC)
		-&gt; HACMP Logical Volume Management
			-&gt; Shared Logical Volumes
				-&gt; Add a Shared Logical Volume</pre></div></div>

<p>Create the filesystems using the following path.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># smit hacmp
	-&gt; System Management (C-SPOC)
		-&gt; HACMP Logical Volume Management
			-&gt; Shared File Systems
				-&gt; Enhanced Journaled File Systems
					-&gt; Add an Enhanced Journaled File System on a Previously Defined Logical Volume</pre></div></div>

<p>We should now see the 2 filesystems which we are exporting and the stable storage filesystem apart of the shared volume group</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># lsvg -l haNFSvg
haNFSvg:
LV NAME              TYPE       LPs     PPs     PVs  LV STATE      	MOUNT POINT
hanfs_kris_lv        jfs2       107     107     1    open/syncd		/hanfs_home_kristian
hanfs_data_lv        jfs2       32      32      1    open/syncd  	/hanfs_data
hanfs_nfsstable_lv   jfs2       75      75      1    open/syncd  	/nfs_stable</pre></div></div>

<p><strong>Step 4 &#8211; Configure the Application Server</strong><br />
Luckily for us, IBM have made this step rather easy and have provided start, stop and monitor scripts. The location of these scripts are below.</p>
<ul>
<li> /usr/es/sbin/cluster/apps/clas_nfsv4/start</li>
<li> /usr/es/sbin/cluster/apps/clas_nfsv4/stop</li>
<li> /usr/es/sbin/cluster/apps/clam_nfsv4/monitor</li>
</ul>
<p>Create an Application Server using the following path.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># smit hacmp
	-&gt; Extended Configuration
		-&gt; Extended Resource Configuration
			-&gt; HACMP Extended Resources Configuration
				-&gt; Configure HACMP Applications Servers
					-&gt; Add an Application Server</pre></div></div>

<p>To configure Application Server monitoring, use the following path.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># smit hacmp
	-&gt; Extended Configuration
		-&gt; Extended Resource Configuration
			-&gt; HACMP Extended Resources Configuration
				-&gt; Configure HACMP Application Monitoring
					-&gt; Configure Custom Application Monitors
						-&gt; Add a Custom Application Monitor</pre></div></div>

<p><strong>Step 5 &#8211; Configure the Resource Group for HANFS</strong><br />
The next step is to configure the RG_nfs resource group with the values needed for HANFS.</p>
<p>Modify the resource group using the following path.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># smit hacmp
	-&gt; Extended Configuration
		-&gt; Extended Resource Configuration
			-&gt; HACMP Extended Resource Group Configuration
				-&gt; Change/Show Resources and Attributes for a Resource Group</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Service IP Labels/Addresses				[serviceip-nfs]
Application Servers					[app_nfsv4]
&nbsp;
Filesystems (empty is ALL for VGs specified)		[/hanfs_home_kristian /hanfs_data /nfs_stable]
Filesystems Consistency Check				fsck
Filesystems Recovery Method				sequential
Filesystems mounted before IP configured		true
Filesystems/Directories to Export (NFSv2/3)		[]
&nbsp;
Filesystems/Directories to Export (NFSv4)		[/hanfs_home_kristian /hanfs_data]
Stable Storage Path (NFSv4)				[/nfs_stable]
Filesystems/Directories to NFS Mount			[/home/kristian;/hanfs_home_kristian /data;/hanfs_data]</pre></div></div>

<p>Most vaules are self explainatory. We set &#8220;Filesystems mounted before IP configured&#8221; to true so we prevent access from clients before the filesystems are ready. We also specify mount points in the following format [mount point];[exported filesystem]</p>
<p><strong>Step 6 &#8211; HANFS exports file</strong><br />
Just like NFS has /etc/exports, HANFS has /usr/es/sbin/cluster/etc/exports. If you need to specify NFS options, you MUST use /usr/es/sbin/cluster/etc/exports and not /etc/exports. For help creating the exports file, you can use &#8220;smit mknfsexp&#8221;</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">* Pathname of directory to export			[]
  Anonymous UID						[-2]
  Public filesystem?					no
* Export directory now, system restart or both		both
  Pathname of alternate exports file			[/usr/es/sbin/cluster/etc/exports]
  ...
  ...</pre></div></div>

<p><strong>Step 7 &#8211; Synchronize the cluster</strong><br />
We now need to synchronize our changes to the other cluster nodes</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># smit hacmp
	-&gt; Extended Configuration
		-&gt; Extended Verification and Synchronization</pre></div></div>

<p><strong>Step 8 &#8211; Bring the Resource Group online</strong><br />
We now bring the resource group online. It&#8217;s a good idea at this stage to tail the hacmp.out file to see any errors.</p>
<p>To bring the resource group online.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># smit hacmp
	-&gt;  System Management (C-SPOC)
		-&gt; HACMP Resource Group and Application Management
			-&gt; Bring a Resource Group Online</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># tail -f /var/hacmp/log/hacmp.out
...
+RG_nfs:cl_activate_nfs(.110):/home/kristian;/hanfs_home_kristian[nfs_mount+102] : Attempt 0/5 to NFS-mount at Jul 26 11:01:21.000
+RG_nfs:cl_activate_nfs(.110):/home/kristian;/hanfs_home_kristian[nfs_mount+103] mount -o vers=4,hard,intr serviceip-nfs:/hanfs_home_kristian /home/kristian</pre></div></div>

<p>You should now see the filesystems mounted.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># mount
  node       	mounted        		   mounted over    		 vfs       date        options
--------      --------------  	          ---------------  		------ ------------ ---------------
...
		/dev/hanfs_kris_lv 	   /hanfs_home_kristian 	jfs2   Jul 26 14:36 rw,log=INLINE
		/dev/hanfs_data_lv 	   /hanfs_data      		jfs2   Jul 26 14:36 rw,log=INLINE
		/dev/hanfs_nfsstable_lv    /nfs_stable       		jfs2   Jul 26 14:36 rw,log=INLINE
serviceip-nfs 	/hanfs_home_kristian	   /home/kristian    		nfs4   Jul 26 14:36 vers=4,hard,intr
serviceip-nfs 	/hanfs_data 		   /data 			nfs4   Jul 26 14:36 vers=4,hard,intr</pre></div></div>

<p>What you&#8217;re seeing above is the output from the mount command ran from the cluster node which currently has the RG_nfs resource group ONLINE. You&#8217;ll notice that it has the shared logical volumes and filesystems mounted, then a local NFS export from itself to mount /home/kristian and /data. On the other cluster nodes, you will only see the NFS mounts.</p>
<p>There you have it, NFS cross-mounts with PowerHA.</p>
<p>[1] &#8211; <a href="http://publib.boulder.ibm.com/infocenter/aix/v6r1/index.jsp?topic=/com.ibm.aix.hacmp.plangd/ha_plan_nfs_stable_storage.htm">http://publib.boulder.ibm.com/infocenter/aix/v6r1/index.jsp?topic=/com.ibm.aix.hacmp.plangd/ha_plan_nfs_stable_storage.htm</a></p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://www.kristijan.org/2011/07/nfs-cross-mounts-in-powerhahacmp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mac OSX Lion and AFP shares</title>
		<link>http://www.kristijan.org/2011/07/mac-osx-lion-afp-shares/</link>
		<comments>http://www.kristijan.org/2011/07/mac-osx-lion-afp-shares/#comments</comments>
		<pubDate>Sun, 24 Jul 2011 06:56:50 +0000</pubDate>
		<dc:creator>Kristijan</dc:creator>
				<category><![CDATA[OSX]]></category>
		<category><![CDATA[afp]]></category>
		<category><![CDATA[lion]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">http://www.kristijan.org/?p=230</guid>
		<description><![CDATA[Like most Apple Mac users this week, I updated from 10.6 Snow Leopard to 10.7 Lion of Apples operating system. Everything seemed to go fine, I noticed a few little quirks, but the one that gave me the biggest &#8220;Oh no, can I go back!?&#8221; was when I tried mounting my AFP share on my FreeNAS  [...]]]></description>
			<content:encoded><![CDATA[<p>Like most Apple Mac users this week, I updated from 10.6 Snow Leopard to 10.7 Lion of Apples operating system. Everything seemed to go fine, I noticed a few little quirks, but the one that gave me the biggest &#8220;Oh no, can I go back!?&#8221; was when I tried mounting my AFP share on my FreeNAS server.<br />
<span id="more-230"></span></p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">iMac:~ kristijan$ mount_afp -i afp://kristijan@nas/Media ./Media/
Password: 
mount_afp: AFPMountURL returned error -5002, errno is -5002</pre></div></div>

<p>For those that use the &#8220;Connect to server&#8230;&#8221; option from Finder would have come across the following pop up error message: &#8220;The version of the server you are trying to connect to is not supported. Please contact your system administrator to resolve the problem.&#8221;</p>
<p>So after some searching around, I found out that OSX Lion no longer supports AFP (and SMB/CIFS) servers which use the DHCAST128 authentication method. Apple flagged this is a security risk, and outright disabled it in Lion. Now I could have just scrapped AFP all together and started using NFS shares, but AFP just works a hell of a lot better with OSX clients.</p>
<p>Some more searching found this page[1], and a solution to my problem. Full credits to this solution go to Alexander Wilde.</p>
<p>Follow the below to enable DHCAST128 under Mac OSX Lion</p>
<p>Launch Terminal.app (/Applications/Utilities/Terminal.app) and run the following two commands.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">iMac:~ kristijan$ sudo chmod o+w /Library/Preferences
Password:
iMac:~ kristijan$ defaults write /Library/Preferences/com.apple.AppleShareClient afp_host_prefs_version -int 1</pre></div></div>

<p>Now restart your computer.</p>
<p>Launch Terminal.app or Finder and attempt to mount the AFP share again. This will fail, but what it will do is recreate the full preferences file.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">iMac:~ kristijan$ mount_afp -i afp://kristijan@nas/Media ./Media/
Password: 
mount_afp: AFPMountURL returned error -5002, errno is -5002</pre></div></div>

<p>Now run the following two commands.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">iMac:~ kristijan$ sudo defaults write /Library/Preferences/com.apple.AppleShareClient afp_disabled_uams -array &quot;Cleartxt Passwrd&quot; &quot;MS2.0&quot; &quot;2-Way Randnum exchange&quot;
Password:
iMac:~ kristijan$ sudo chmod o-w /Library/Preferences</pre></div></div>

<p>Restart your computer and mount the AFP share again, it should now work.</p>
<p>[1] &#8211; <a href="http://www.alexanderwilde.com/2011/04/os-x-lion-connection-error-with-afp-and-workaround">http://www.alexanderwilde.com/2011/04/os-x-lion-connection-error-with-afp-and-workaround</a></p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://www.kristijan.org/2011/07/mac-osx-lion-afp-shares/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>VIO: Virtual Media Library</title>
		<link>http://www.kristijan.org/2011/06/vio-virtual-media-library/</link>
		<comments>http://www.kristijan.org/2011/06/vio-virtual-media-library/#comments</comments>
		<pubDate>Thu, 09 Jun 2011 07:30:32 +0000</pubDate>
		<dc:creator>Kristijan</dc:creator>
				<category><![CDATA[AIX]]></category>
		<category><![CDATA[PowerVM]]></category>
		<category><![CDATA[VIO]]></category>
		<category><![CDATA[aix]]></category>
		<category><![CDATA[loopmount]]></category>
		<category><![CDATA[vio]]></category>
		<category><![CDATA[virtual media library]]></category>
		<category><![CDATA[vml]]></category>

		<guid isPermaLink="false">http://www.kristijan.org/?p=206</guid>
		<description><![CDATA[The first LPAR that I normally build post VIOS installation is a NIM LPAR. Once you have your NIM server setup, building the rest of your LPAR&#8217;s becomes a much simpler task. However, what do you do when there isn&#8217;t an existing NIM environment, or you don&#8217;t have access to the physical servers to  [...]]]></description>
			<content:encoded><![CDATA[<p>The first LPAR that I normally build post VIOS installation is a NIM LPAR. Once you have your NIM server setup, building the rest of your LPAR&#8217;s becomes a much simpler task. However, what do you do when there isn&#8217;t an existing NIM environment, or you don&#8217;t have access to the physical servers to insert a disc to perform the AIX install? This is where the Virtual Media Library comes to the rescue. The Virtual Media Library is a feature of the Virtual I/O Server which allows you to present an ISO image to underlying LPAR&#8217;s. The best thing about the Virtual Media Library is that it&#8217;s very quick and simple to set up.<br />
<span id="more-206"></span><br />
From here on out, I&#8217;ll be referring to the Virtual Media Library as VML.</p>
<p>Getting right into it, we first want to define the VML. Now you can create a new volume group for the VML, or simply use rootvg. If you do decide to use rootvg, just be sure to exclude the filesystem when you do your VIO mksysb backups. The other paramater that we need to specify is the size of the VML. Make it big enough to cater for all your ISO volumes that you wish to present to underlying LPAR&#8217;s. In the example below, I&#8217;ve gone with 10G.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ mkrep -sp rootvg -size 10G
Virtual Media Repository Created
Repository created within &quot;VMLibrary&quot; logical volume</pre></div></div>

<p>We&#8217;ve now created an empty VML repository which backs onto the /var/vio/VMLibrary filesystem. You can view the VML repository by running the lsrep command.</p>
<p>Now it&#8217;s time to upload your ISO images over to the VIOS. At this stage, I&#8217;ll bring up a root shell in the VIOS and change the root password. This will allow me to SCP across the ISO images into the /var/vio/VMLibrary folder.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ oem_setup_env
# passwd</pre></div></div>

<p>Upload your ISO images into /var/vio/VMLibrary</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># ls -l /var/vio/VMLibrary/AIX-6100-06-01-Disk1.iso
-r--------    1 root     system   4236148736 Apr 06 18:07 /var/vio/VMLibrary/AIX-6100-06-01-Disk1.iso</pre></div></div>

<p>Check the VML repository to see the new image available for use.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ lsrep
Size(mb) Free(mb) Parent Pool         Parent Size      Parent Free
   10198     6158 rootvg                   279552           236288
&nbsp;
Name                                    File Size Optical         Access
AIX-6100-06-01-Disk1.iso                     4040 None            ro</pre></div></div>

<p>Great, so we now have some media in the VML library ready to be used. What we need to do from here is create a File Backed Optical Device for the particular LPAR you want cd0 to appear on.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ mkvdev -fbo -vadapter vhost1
vtopt0 Available</pre></div></div>

<p>Now let&#8217;s load the image from the VML into vtopt0.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ loadopt -vtd vtopt0 -disk AIX-6100-06-01-Disk1.iso
$ lsmap -vadapter vhost1
SVSA            Physloc                                      Client Partition ID
--------------- -------------------------------------------- ------------------
vhost1          U9133.55A.066EB4H-V1-C34                     0x00000000
&nbsp;
VTD                   vtopt0
Status                Available
LUN                   0x8200000000000000
Backing device        /var/vio/VMLibrary/AIX-6100-06-01-Disk1.iso
Physloc
Mirrored              N/A</pre></div></div>

<p>Now you can boot the LPAR off CD/DVD and perform the AIX install.</p>
<p>Two other useful commands to know:</p>
<p>To unload the image.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ unloadopt -vtd vtopt0</pre></div></div>

<p>If you&#8217;re prompted for another disk (for example, disc 2 during the AIX install).</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ loadopt -f -vtd vtopt0 -disk AIX-6100-06-01-Disk2.iso</pre></div></div>

<p>There you have it, a quick and simple way of getting AIX installed onto a LPAR if you don&#8217;t have any other method of installation. Another thing to take note of, is that you can load any ISO image into the VML, it doesn&#8217;t have to be an AIX installation image. Quite useful for when you have to install any bit of software and all you have is the ISO image.</p>
<p>On that note though, the loopmount command was added in AIX 6.1 TL4. This allows you to mount ISO images directly from AIX without using the VML.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># loopmount -i image.iso -o &quot;-V cdrfs -o ro&quot; -m /mountpoint</pre></div></div>

<p>Good luck, enjoy, and any questions can be popped into the comments below.</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://www.kristijan.org/2011/06/vio-virtual-media-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgrading your AIX environment using multibos</title>
		<link>http://www.kristijan.org/2011/03/upgrading-your-aix-environment-using-multibos/</link>
		<comments>http://www.kristijan.org/2011/03/upgrading-your-aix-environment-using-multibos/#comments</comments>
		<pubDate>Thu, 31 Mar 2011 00:52:56 +0000</pubDate>
		<dc:creator>Kristijan</dc:creator>
				<category><![CDATA[AIX]]></category>
		<category><![CDATA[aix]]></category>
		<category><![CDATA[filesystem]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[volume group]]></category>

		<guid isPermaLink="false">http://www.kristijan.org/?p=197</guid>
		<description><![CDATA[If you haven&#8217;t clued on by now, AIX is my operating system of choice. I&#8217;m sure there are many arguments for and against, but looking at it from a systems administrator view point, it&#8217;s second to none. Anyway, that&#8217;s a story for another time. What I&#8217;m writing about today is patching your AIX  [...]]]></description>
			<content:encoded><![CDATA[<p>If you haven&#8217;t clued on by now, AIX is my operating system of choice. I&#8217;m sure there are many arguments for and against, but looking at it from a systems administrator view point, it&#8217;s second to none. Anyway, that&#8217;s a story for another time. What I&#8217;m writing about today is patching your AIX installations using multibos. Now before I get started, I&#8217;ll stress two points:</p>
<p>1) Chris Gibson has already written two great (and far more in depth) articles on multibos, which I recommend reading before going any further (Links: <a href="http://www.ibmsystemsmag.com/aix/trends/aix/AIX-Updates-With-Multibos/">here</a> and <a href="http://www.ibmsystemsmag.com/aix/administrator/systemsmanagement/Working-With-multibos/">here</a>).<br />
2) This blog of mine serves two purposes; To share some of the things I come about during my sysadmin activities and secondly also a dumping ground for documents I write for myself. This post is the latter, as multibos isn&#8217;t something that I use daily (maybe a few times a year), and really, who&#8217;s going to remember all those syntax switches <img src='http://www.kristijan.org/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>Now, assuming you&#8217;ve read both articles, I don&#8217;t need to go into the benefits of multibos and I&#8217;ll dive straight into the how. I&#8217;ll be working on upgrading an AIX instance running 6100-05-01-1016 to the latest ML which at the time of writing is 6100-06-04-1112<br />
<span id="more-197"></span><br />
<strong>PREREQUISITES</strong><br />
First things first, we need to make sure the current environment is ready to be copied. The two main things that I look for are:</p>
<p><strong>1.</strong> Make sure the current environment doesn&#8217;t have any missing filesets.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@AIX / &gt; oslevel -s
6100-05-01-1016
root@AIX / &gt; instfix -i | grep ML
    All filesets for 6100-00_AIX_ML were found.
    All filesets for 6100-01_AIX_ML were found.
    All filesets for 6100-02_AIX_ML were found.
    All filesets for 6100-03_AIX_ML were found.
    All filesets for 6100-04_AIX_ML were found.
    All filesets for 6100-05_AIX_ML were found.</pre></div></div>

<p>**Note: If a particular ML doesn&#8217;t return positive (e.g. 6100-05_AIX_ML), use <strong>instfix -ciqk 6100-05_AIX_ML | grep &#8220;:-:&#8221;</strong> to see the fileset causing issues and rectify it.</p>
<p><strong>2.</strong> Make sure all filesets have been committed. Now I&#8217;m not entirely sure if this is a requirement, but I prefer to work with an as clean environment as possible.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@AIX / &gt; lslpp -l | grep -i applied</pre></div></div>

<p>**Note: If you have software which is in an applied state, commit it.</p>
<p>Now that we&#8217;re happy with the state of the environment, you need to verify that there is enough room in rootvg to make copies of the following logical volumes [/ (hd4), /usr (hd2), /var (hd9var), /opt (hd10opt) and the boot logical volume (hd5)].</p>
<p>Once we&#8217;ve satisfied the above requirement, we can get started with the multibos work. I&#8217;m not going to dissect each command, so I suggest reading the multibos man pages to know what each switch does. The only one that I&#8217;ll explain is -p, which does a preview of the multibos command executed.</p>
<p><strong>MULTIBOS</strong><br />
<strong>1.</strong> Remove any previous standby multibos environments. The below command will return a FAILURE status if you don&#8217;t have a standby multibos environment. If you&#8217;re using multibos for the first time, this will be the case.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@AIX / &gt; multibos -RX
Initializing multibos methods ...
Initializing log /etc/multibos/logs/op.alog ...
Gathering system information ...
multibos: 0565-077 Unable to locate standby BOS.
&nbsp;
Log file is /etc/multibos/logs/op.alog
Return Status: FAILURE</pre></div></div>

<p><strong>2.</strong> Create the standby BOS. New logical volumes and filesystems will be created prefixed and with bos_. This can take a while to complete.</p>
<p>This will preview the creation of the multibos environment and list all the logical volumes that will be copied.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@AIX / &gt; multibos -sXp
...
...
Log file is /etc/multibos/logs/op.alog
Return Status = SUCCESS</pre></div></div>

<p>You can also view the log file using the alog command.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@AIX / &gt; alog -of /etc/multibos/logs/op.alog</pre></div></div>

<p>If everything completed successfully, run the command again without the preview.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@AIX / &gt; multibos -sX</pre></div></div>

<p>Once complete, you&#8217;ll notice that the new logical volumes will be prefixed with bos_</p>
<p><strong>3.</strong> Once complete, you can drop into a multibos shell and check oslevel, it should be the same as the host OS.</p>
<p>The below command will mount all the filesystems required and drop you in a MULTIBOS> prompt</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@AIX / &gt; multibos -S
...
...
MULTIBOS&gt; oslevel -s
6100-05-01-1016</pre></div></div>

<p>To umount all the filesystems and break out of the multibos environment.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">MULTIBOS&gt; exit</pre></div></div>

<p><strong>4.</strong> Apply the TL/ML to the multibos environment.</p>
<p>The below command will tell multibos to apply the updates from the specified location (which is the location that your new ML resides).</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@AIX / &gt; multibos -Xac -l /home/kristijan/6100-06-04</pre></div></div>

<p>Drop into the multibos shell again and check that the ML has been successfully applied.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@AIX / &gt; multibos -S
MULTIBOS&gt; oslevel -s
6100-06-04-1112
MULTIBOS&gt; instfix -i | grep ML
    	All filesets for 6100-00_AIX_ML were found.
    	All filesets for 6.1.0.0_AIX_ML were found.
    	All filesets for 6100-01_AIX_ML were found.
    	All filesets for 6100-02_AIX_ML were found.
    	All filesets for 6100-03_AIX_ML were found.
    	All filesets for 6100-04_AIX_ML were found.
    	All filesets for 6100-05_AIX_ML were found.
    	All filesets for 6100-06_AIX_ML were found.
MULTIBOS&gt; exit</pre></div></div>

<p><strong>5.</strong> Verify that the bootlist now contains blv=bos_hd5. bos_hd5 is the location of the new boot logical volume. It will be at the top of the list when you run the bootlist command.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@AIX / &gt; bootlist -m normal -o
hdisk0 blv=bos_hd5 pathid=0
hdisk0 blv=hd5 pathid=0</pre></div></div>

<p>You can now reboot into the new environment and verify that all went to plan.</p>
<p><strong>6.</strong> If you need to back out of the change for any reason, just change the bootlist order back to blv=hd5 and reboot. Now, while this doesn&#8217;t bother me, it may bother others. You&#8217;ll notice after the reboot that your environment is now using the bos_ logical volumes. The only way to get your environment back to how it was using the original logical volume names is to create another multibos environment, and reboot into it. Since your current boot environment is using the bos_ logical volumes, it will create it using the original logical volume names (i.e. without the bos_). For those that want to do that, redo step 2 and reboot. However, I suggest not doing this for a week or so to be sure you&#8217;re happy with the new changes, as creating a new multibos environment will remove the backup environment with the previous ML.</p>
<p>As always, post comments/questions below.</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://www.kristijan.org/2011/03/upgrading-your-aix-environment-using-multibos/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>CSM Commands (dsh, dping, dcp and dshbak) for AIX</title>
		<link>http://www.kristijan.org/2011/02/csm-commands-dsh-dping-dcp-and-dshbak-for-aix/</link>
		<comments>http://www.kristijan.org/2011/02/csm-commands-dsh-dping-dcp-and-dshbak-for-aix/#comments</comments>
		<pubDate>Mon, 28 Feb 2011 03:28:45 +0000</pubDate>
		<dc:creator>Kristijan</dc:creator>
				<category><![CDATA[AIX]]></category>
		<category><![CDATA[aix]]></category>
		<category><![CDATA[dcp]]></category>
		<category><![CDATA[dping]]></category>
		<category><![CDATA[dsh]]></category>
		<category><![CDATA[dshbak]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://www.kristijan.org/?p=187</guid>
		<description><![CDATA[Cluster Systems Management (CSM) software provides a bunch of tools to manage from a single point of control your AIX environment. There are a number of commands available[1] but the main four which I find quite useful are dsh, dping, dcp and dshbak. In this post, I&#8217;ll go over each command and some  [...]]]></description>
			<content:encoded><![CDATA[<p>Cluster Systems Management (CSM) software provides a bunch of tools to manage from a single point of control your AIX environment. There are a number of commands available[1] but the main four which I find quite useful are dsh, dping, dcp and dshbak. In this post, I&#8217;ll go over each command and some of its uses.<br />
<span id="more-187"></span><br />
Before we begin, we need to select a server which is going to be the point of control. While this can be any AIX server on the network, it&#8217;s mainly common to have your NIM server as the point of control. In the case of dsh and dcp, we&#8217;re going to be using SSH, so keys[2] need to be setup between your point of control server and the rest of your environment.</p>
<p><strong>DSH/DSHBAK</strong><br />
Distributed Shell (dsh) allows you to concurrently run commands on remote nodes. It requires very little setup, but it&#8217;s one of those hidden AIX commands that few administrators know about. As you may have already guessed, dsh comes with the CSM client filesets. Specifically, it comes from the csm.dsh fileset which creates a symbolic link &#8211; /usr/bin/dsh -> /opt/csm/bin/dsh</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@AIX / &gt; lslpp -w /usr/bin/dsh
  File                                        Fileset               Type
  ----------------------------------------------------------------------------
  /usr/bin/dsh                                csm.dsh               Symlink</pre></div></div>

<p>There are a few environmental variables that we need to setup first.</p>
<p><em>DSH_NODE_RSH=/usr/bin/ssh</em> &#8211; By default, dsh uses rsh to execute remote commands. If you don&#8217;t know why using rsh is a bad idea, hand in your sysadmin card now. We need to tell dsh to execute all remote commands via ssh.<br />
<em>DCP_NODE_RCP=/usr/bin/scp</em> &#8211; As above, dcp uses rcp to send files remotely, so lets change that to use scp<br />
<em>DSH_NODE_OPTS=-q</em> &#8211; This passes the -q option to ssh to suppress the banner message from showing. This just makes the output much easier to read when working with a number of nodes.<br />
<em>DSH_NODE_LIST=/.dsh/model</em> &#8211; You can feed a list of nodes to dsh a number of ways, but I find using text files the best way to manage it.</p>
<p>Most places have a typical dev/mod/prod setup which can consist of a number of servers within each environment. I have four node text files in my /.dsh directory.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">-rw-rw-r--    1 root     system          577 Jan 11 10:19 all
-rw-r--r--    1 root     system           71 Feb 12 13:06 dev
-rw-r--r--    1 root     system           75 Oct 28 10:38 mod
-rw-r--r--    1 root     system          106 Jan 25 13:00 prod</pre></div></div>

<p>This way I can run commands on all the nodes in a specific environment, or across all nodes. The easiest way to switch between lists is by using aliases.</p>
<p>In my .kshrc file</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">alias dshmod='export DSH_NODE_LIST=/.dsh/mod'
alias dshprod='export DSH_NODE_LIST=/.dsh/prod'
alias dshdev='export DSH_NODE_LIST=/.dsh/dev'
alias dshall='export DSH_NODE_LIST=/.dsh/all'</pre></div></div>

<p>The contents of the node text files is each node on a single line.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@AIX / &gt; cat /.dsh/mod
SERVER1
SERVER2
SERVER3</pre></div></div>

<p>That&#8217;s it for the configuration. You can run dsh -q to show the current configured variables. Look at the man page for dsh to see further configurable options and the IBM website[3].</p>
<p>Let&#8217;s see if it works.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@AIX / &gt; dshmod
root@AIX / &gt; dsh date
SERVER1: Mon Feb 28 12:59:34 EETDT 2011
SERVER2: Mon Feb 28 12:53:58 EETDT 2011
SERVER3: Mon Feb 28 12:56:51 EETDT 2011</pre></div></div>

<p>If you only wanted to run the command on a select number of hosts, you can use the -w switch.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@AIX / &gt; dsh -w SERVER1,SERVER3 &quot;date&quot;
SERVER1: Mon Feb 28 13:01:20 EETDT 2011
SERVER3: Mon Feb 28 12:55:43 EETDT 2011</pre></div></div>

<p>We can make that output look a bit neater by piping through the dshbak command.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@AIX / &gt; dsh -w SERVER1,SERVER3 &quot;date&quot; | dshbak
HOST: SERVER1
-------------
Mon Feb 28 13:17:17 EETDT 2011
&nbsp;
HOST: SERVER3
-------------
Mon Feb 28 13:11:41 EETDT 2011</pre></div></div>

<p><strong>DCP</strong><br />
Just like the dsh command, dcp allows you to send files concurrently to multiple hosts. dcp requires the same environmental setup as dsh. Seeing as that&#8217;s already setup, we can use it straight away.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@AIX / &gt; lmktemp test 1M
test
root@AIX / &gt; dcp test /
root@AIX / &gt; dsh ls -l /test
SERVER1: -rw-r--r--   1 root     system      1048576 Feb 28 13:32 /test
SERVER2: -rw-r--r--   1 root     system      1048576 Feb 28 13:32 /test
SERVER3: -rw-r--r--   1 root     system      1048576 Feb 28 13:32 /test</pre></div></div>

<p>What I did above is created a 1M file called test, used dcp to send it to my hosts, then verified the file was on each node using dsh. You can find more about dcp from the man pages and the IBM website[4].</p>
<p><strong>DPING</strong><br />
The dping command allows you to ping nodes in parallel (with the option of serially). Now, it doesn&#8217;t read the DSH_NODE_LIST variable like dsh/dcp, but you can pass the -f option and tell it to.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@AIX / &gt; dping -f /.dsh/mod
SERVER1: ping (alive)
SERVER2: ping (alive)
SERVER3: ping (alive)
SERVER4: noping (unreachable)</pre></div></div>

<p>If you only want to ping a select few hosts, then you can use the -n switch.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@AIX / &gt; dping -n SERVER1,SERVER3
SERVER1: ping (alive)
SERVER3: ping (alive)</pre></div></div>

<p>You can find more on dping by reading the man pages and on the IBM website[5]. Like dsh, you can also pipe the output of dping through dshbak.</p>
<p>If you have any questions on the above, use the comment section below.</p>
<p>[1] &#8211; <a href="http://publib.boulder.ibm.com/infocenter/clresctr/vxrx/index.jsp?topic=/com.ibm.cluster.csm16.cmds.doc/am7cm_csmcomm.html">http://publib.boulder.ibm.com/infocenter/clresctr/vxrx/index.jsp?topic=/com.ibm.cluster.csm16.cmds.doc/am7cm_csmcomm.html</a><br />
[2] &#8211; <a href="http://www.ece.uci.edu/~chou/ssh-key.html">http://www.ece.uci.edu/~chou/ssh-key.html</a><br />
[3] &#8211; <a href="http://publib.boulder.ibm.com/infocenter/clresctr/vxrx/index.jsp?topic=/com.ibm.cluster.csm16.cmds.doc/am7cm_dsh.html">http://publib.boulder.ibm.com/infocenter/clresctr/vxrx/index.jsp?topic=/com.ibm.cluster.csm16.cmds.doc/am7cm_dsh.html</a><br />
[4] &#8211; <a href="http://publib.boulder.ibm.com/infocenter/clresctr/vxrx/index.jsp?topic=/com.ibm.cluster.csm16.cmds.doc/am7cm_dcp.html">http://publib.boulder.ibm.com/infocenter/clresctr/vxrx/index.jsp?topic=/com.ibm.cluster.csm16.cmds.doc/am7cm_dcp.html</a><br />
[5] &#8211; <a href="http://publib.boulder.ibm.com/infocenter/clresctr/vxrx/index.jsp?topic=/com.ibm.cluster.csm16.cmds.doc/am7cm_dping.html">http://publib.boulder.ibm.com/infocenter/clresctr/vxrx/index.jsp?topic=/com.ibm.cluster.csm16.cmds.doc/am7cm_dping.html</a></p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://www.kristijan.org/2011/02/csm-commands-dsh-dping-dcp-and-dshbak-for-aix/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Quickly show memory usage under AIX</title>
		<link>http://www.kristijan.org/2011/01/quickly-show-memory-usage-under-aix/</link>
		<comments>http://www.kristijan.org/2011/01/quickly-show-memory-usage-under-aix/#comments</comments>
		<pubDate>Wed, 05 Jan 2011 23:36:40 +0000</pubDate>
		<dc:creator>Kristijan</dc:creator>
				<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[aix]]></category>
		<category><![CDATA[ksh]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[usage]]></category>

		<guid isPermaLink="false">http://www.kristijan.org/?p=183</guid>
		<description><![CDATA[Very quick and basic shell script to show total/free/used memory on a host running AIX.

kristijan@AIX &#62; ./meminfo
&#160;
Memory Information
==================
total memory = 1884 MB
free memory  = 94 MB
used memory  = 1790 MB


Script uses standard AIX command line utilities to work out all the values.  [...]]]></description>
			<content:encoded><![CDATA[<p>Very quick and basic shell script to show total/free/used memory on a host running AIX.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">kristijan@AIX &gt; ./meminfo
&nbsp;
Memory Information
==================
total memory = 1884 MB
free memory  = 94 MB
used memory  = 1790 MB</pre></div></div>

<p><span id="more-183"></span></p>
<p>Script uses standard AIX command line utilities to work out all the values. I haven&#8217;t tested it across all versions of AIX (I wrote this on AIX 6.1), but I believe it should work fine. Let me know in the comments if it doesn&#8217;t.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/ksh</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Quick view of memory usage under AIX</span>
<span style="color: #666666; font-style: italic;">#</span>
&nbsp;
<span style="color: #007800;">USED</span>=<span style="color: #000000; font-weight: bold;">`</span>svmon <span style="color: #660033;">-G</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">head</span> <span style="color: #660033;">-2</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #660033;">-1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ print $3 }'</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">USED</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">expr</span> <span style="color: #007800;">$USED</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000;">256</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">TOTAL</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">lsattr</span> <span style="color: #660033;">-El</span> sys0 <span style="color: #660033;">-a</span> realmem <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{ print $2 }'</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">TOTAL</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">expr</span> <span style="color: #007800;">$TOTAL</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000;">1000</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">FREE</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">expr</span> <span style="color: #007800;">$TOTAL</span> - <span style="color: #007800;">$USED</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>Memory Information&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;==================&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;total memory = <span style="color: #007800;">$TOTAL</span> MB&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;free memory  = <span style="color: #007800;">$FREE</span> MB&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;used memory  = <span style="color: #007800;">$USED</span> MB&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></pre></div></div>

<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://www.kristijan.org/2011/01/quickly-show-memory-usage-under-aix/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Mounting external USB NTFS drive to FreeNAS</title>
		<link>http://www.kristijan.org/2010/12/mounting-external-usb-ntfs-drive-to-freenas/</link>
		<comments>http://www.kristijan.org/2010/12/mounting-external-usb-ntfs-drive-to-freenas/#comments</comments>
		<pubDate>Thu, 16 Dec 2010 09:15:59 +0000</pubDate>
		<dc:creator>Kristijan</dc:creator>
				<category><![CDATA[NAS]]></category>
		<category><![CDATA[external drive]]></category>
		<category><![CDATA[freenas]]></category>
		<category><![CDATA[nas]]></category>
		<category><![CDATA[ntfs]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://www.kristijan.org/?p=175</guid>
		<description><![CDATA[This is a quick post on how to mount an external USB NTFS formatted hard drive (or memory stick) to FreeNAS. All that&#8217;s needed is to load the fuse driver, but it had me stumped for a bit until I found it in a forum post.
First things first, let&#8217;s plug in our drive and find out the device ID FreeNAS  [...]]]></description>
			<content:encoded><![CDATA[<p>This is a quick post on how to mount an external USB NTFS formatted hard drive (or memory stick) to FreeNAS. All that&#8217;s needed is to load the fuse driver, but it had me stumped for a bit until I found it in a forum post.</p>
<p>First things first, let&#8217;s plug in our drive and find out the device ID FreeNAS assigns it.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># dmesg
...
umass1: &lt;ASMedia AS2105, class 0/0, rev 2.10/1.00, addr 3&gt; on uhub4
da1 at umass-sim1 bus 1 target 0 lun 0
da1: &lt;ST950042 0AS 0002&gt; Fixed Direct Access SCSI-0 device 
da1: 40.000MB/s transfers
da1: 476940MB (976773168 512 byte sectors: 255H 63S/T 60801C)</pre></div></div>

<p><span id="more-175"></span><br />
Now we create a mount point for the drive and try mount it like we normally would.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># mkdir /mnt/usb
# mount -t ntfs /dev/da1s1 /mnt/usb/</pre></div></div>

<p>You&#8217;ll receive the following error:<br />
<strong>fuse: failed to open fuse device: No such file or directory</strong></p>
<p>Now lets load the fuse driver and try again.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># kldload fuse
# mount -t ntfs /dev/da1s1 /mnt/usb/
# ls -l /mnt/usb
total 4589868
drwxrwxrwx  1 root  wheel        4096 Sep 25 17:48 $RECYCLE.BIN
drwxrwxrwx  1 root  wheel           0 Nov 27 14:25 .Trashes
-rwxrwxrwx  1 root  wheel        4096 Nov 22 18:15 ._.Trashes
...</pre></div></div>

<p>SUCCESS!</p>
<p>It&#8217;s probably easier to load the driver on boot instead of loading it manually like I have above. I haven&#8217;t tried it, but it should work if you call it from loader.conf. I can reboot my NAS at the moment, but if someone wants to give it a shot and post to the comments, that would be great. You can follow instructions on how to edit loader.conf in a previous post [1] of mine.</p>
<p>[1] &#8211; <a href="http://www.kristijan.org/2010/11/freenas-realtek-network-card/">http://www.kristijan.org/2010/11/freenas-realtek-network-card/</a></p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://www.kristijan.org/2010/12/mounting-external-usb-ntfs-drive-to-freenas/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>FreeNAS and Realtek RTL8168C/RTL8111DP/RTL8111E network card</title>
		<link>http://www.kristijan.org/2010/11/freenas-realtek-network-card/</link>
		<comments>http://www.kristijan.org/2010/11/freenas-realtek-network-card/#comments</comments>
		<pubDate>Fri, 12 Nov 2010 11:56:09 +0000</pubDate>
		<dc:creator>Kristijan</dc:creator>
				<category><![CDATA[NAS]]></category>
		<category><![CDATA[freenas]]></category>
		<category><![CDATA[mount]]></category>
		<category><![CDATA[realtek]]></category>

		<guid isPermaLink="false">http://www.kristijan.org/?p=148</guid>
		<description><![CDATA[Quick links to compiled v1.80 drivers
Ethernet Driver for Intel
Ethernet Driver for AMD64 (Thanks to Ruslan)
As I mentioned in a previous post, I built myself a NAS based on FreeNAS. It&#8217;s been rock solid for about 3 weeks now, no hiccups. One initial issue I did have was getting the  [...]]]></description>
			<content:encoded><![CDATA[<p>Quick links to compiled v1.80 drivers<br />
<a href="http://www.kristijan.org/downloads/if_re.ko">Ethernet Driver for Intel</a><br />
<a href="http://www.kristijan.org/downloads/if_re_amd64.ko">Ethernet Driver for AMD64</a> (Thanks to Ruslan)</p>
<p>As I mentioned in a previous post, I built myself a NAS based on FreeNAS. It&#8217;s been rock solid for about 3 weeks now, no hiccups. One initial issue I did have was getting the RTL8168C/RTL8111DP/RTL8111E network card chipset to work. There is no FreeNAS out of the box support for this chipset, so I had to compile my own from source found on the Realtek website which you can find <a href="http://www.realtek.com.tw/DOWNLOADS/DOWNLOADSVIEW.ASPX?LANGID=1&#038;PNID=13&#038;PFID=5&#038;LEVEL=5&#038;CONN=4&#038;DOWNTYPEID=3&#038;GETDOWN=FALSE">here</a>. If you have issues downloading or compiling it, I&#8217;ve compiled version 1.80 which you can download from the top of this page. Ruslan has kindly compiled an AMD64 version as well.</p>
<p>First and foremost, verify that the module actually works and you can bring up your network card and get some activity over it. I&#8217;m going to assume at this point that you have no way of copying something onto your FreeNAS other than USB, so copy if_re.ko to a USB stick and plug it into your NAS.<br />
<span id="more-148"></span><br />
To mount the USB device, let&#8217;s first create a mount point.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># mkdir /mnt/usb</pre></div></div>

<p>Now we need to find the USB device you just plugged in.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># dmesg
...
umass1: &lt;USB 2 Flash Disk, class 0/0, rev 2.00/0.00, addr 3&gt; on uhub4
da1 at umass-sim1 bus 1 target 0 lun 0
da1: &lt;USB 2.0 Flash Disk 2.20&gt; Removable Direct Access SCSI-2 device 
da1: 40.000MB/s transfers
da1: 119MB (244480 512 byte sectors: 64H 32S/T 119C)</pre></div></div>

<p>What we&#8217;re looking for here is the <b>da1</b></p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># mount_msdosfs /dev/da1 /mnt/usb</pre></div></div>

<p>Now let&#8217;s see if we can load the module.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># kldload /mnt/usb/if_re.ko</pre></div></div>

<p>If you don&#8217;t get any errors, you should see the module loaded.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># kldstat
Id Refs Address    Size     Name
 1   12 0x80400000 b134e4   kernel
 2    1 0x80f14000 195b4    if_re.ko
 3    1 0x8c32e000 e350     isboot.ko
 4    1 0x8c33d000 6a4f0    acpi.ko
 5    1 0x92284000 123000   zfs.ko
 6    1 0x923a7000 3000     opensolaris.ko
 7    1 0x92843000 4000     geom_nop.ko
 8    1 0x938cf000 9000     aio.ko
 9    1 0xa8768000 13000    geom_vinum.ko</pre></div></div>

<p>So far so good, now bring up the interface and see if you can assign an IP address to it and ping another node on your network.<br />
Sweet, all good, all we need to do now is copy the module to a location that isn&#8217;t going to get overwritten at boot, and edit loader.conf.</p>
<p>/cf is the filesystem where we will copy the module to, but it&#8217;s mounted as read only on boot, so let&#8217;s remount it as read/write.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># df /cf
Filesystem 1K-blocks  Used Avail Capacity  Mounted on
/dev/da0a      71062 64438  6624    91%    /cf</pre></div></div>

<p>Substitue /dev/da0a to match your install.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># umount /cf
# mount -o rw /dev/da0a /cf</pre></div></div>

<p>Copy if_re.ko from the USB to /cf/boot/kernel</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># cp /mnt/usb/if_re.ko /cf/boot/kernel</pre></div></div>

<p>Edit /cf/boot/loader.conf and add the following line.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">if_re_load=&quot;YES&quot;</pre></div></div>

<p>That should be it, you can now unmount the USB stick which you used to copy the module and reboot. If all goes well, your network card should come up on boot. If you do have any issues with this, please post to the comments.</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://www.kristijan.org/2010/11/freenas-realtek-network-card/feed/</wfw:commentRss>
		<slash:comments>51</slash:comments>
		</item>
		<item>
		<title>Automount AFP shares in OSX</title>
		<link>http://www.kristijan.org/2010/11/automount-afp-shares-in-osx/</link>
		<comments>http://www.kristijan.org/2010/11/automount-afp-shares-in-osx/#comments</comments>
		<pubDate>Fri, 12 Nov 2010 11:03:10 +0000</pubDate>
		<dc:creator>Kristijan</dc:creator>
				<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[afp]]></category>
		<category><![CDATA[autofs]]></category>
		<category><![CDATA[automount]]></category>
		<category><![CDATA[mount]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">http://www.kristijan.org/?p=137</guid>
		<description><![CDATA[So I&#8217;ve finally got around to building my NAS. It&#8217;s a pretty 12TB FreeNAS using RAIDZ&#8230;she runs very nicely   At first, I was using SMB, but found the performance from AFP better, that&#8217;s for another post though. For the life of me, I couldn&#8217;t find the &#8220;Mac&#8221; way of auto mounting an AFP share. So  [...]]]></description>
			<content:encoded><![CDATA[<p>So I&#8217;ve finally got around to building my NAS. It&#8217;s a pretty 12TB FreeNAS using RAIDZ&#8230;she runs very nicely <img src='http://www.kristijan.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  At first, I was using SMB, but found the performance from AFP better, that&#8217;s for another post though. For the life of me, I couldn&#8217;t find the &#8220;Mac&#8221; way of auto mounting an AFP share. So being the sysadmin ninja that I am, I just went along and did it my own way.</p>
<p>Luckily for us, the pretty OSX frontend sits on top of a UNIX backend. In short, I ended up using autofs, and it works rather well. Below is how to get it working.<br />
<span id="more-137"></span><br />
1. Bust open Terminal.app and do the following.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">sudo vi /etc/fstab</pre></div></div>

<p>&#8230;and paste the below:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># Mount AFP share from NAS
(hostname):(share) (mount_point) url automounted,url==afp://(username):(password)@(hostname)/(share) (mount_point) 0 0</pre></div></div>

<p>Replacing the following:<br />
(hostname):(share) &#8211; With the hostname and share of the NAS.<br />
(mount_point) &#8211; The mount point in OSX.<br />
(username):(password) &#8211; Credentials to connect to the share.</p>
<p>For example:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">192.168.0.109:/Media /Users/kristijan/Media url automounted,url==afp://kristijan:fakepass@192.168.0.109/Media /Users/kristijan/Media 0 0</pre></div></div>

<p>2. Either reboot or run &#8220;sudo automount -vc&#8221; to mount your share.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">iMac:~ kristijan$ sudo automount -vc
automount: /net updated
automount: /home updated
automount: /Users/kristijan/Media mounted
automount: no unmounts</pre></div></div>

<p>All done.<br />
Since we&#8217;re using autofs, NAS&#8217;s that hibernate shouldn&#8217;t cause OSX any issues, as autofs can mount/umount as needed.</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://www.kristijan.org/2010/11/automount-afp-shares-in-osx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Keeping an eye on TSM volumes</title>
		<link>http://www.kristijan.org/2010/09/keeping-an-eye-on-tsm-volumes/</link>
		<comments>http://www.kristijan.org/2010/09/keeping-an-eye-on-tsm-volumes/#comments</comments>
		<pubDate>Tue, 21 Sep 2010 03:29:21 +0000</pubDate>
		<dc:creator>Kristijan</dc:creator>
				<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[monitor]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[tsm]]></category>

		<guid isPermaLink="false">http://www.kristijan.org/?p=126</guid>
		<description><![CDATA[I wrote a quick script which tells me when volumes in TSM (Tivoli Storage Manager) have access and/or media issues and shoots me off an email. The script does two things:
1) Checks for volumes which are NOT in the states READWRITE or OFFSITE.
2) Checks for volumes which have a read/write error  [...]]]></description>
			<content:encoded><![CDATA[<p>I wrote a quick script which tells me when volumes in TSM (Tivoli Storage Manager) have access and/or media issues and shoots me off an email. The script does two things:</p>
<p>1) Checks for volumes which are NOT in the states READWRITE or OFFSITE.<br />
2) Checks for volumes which have a read/write error count >0.</p>
<p>I&#8217;m sure that most people running TSM in their environment have some sort of daily reporting that gets sent out. If that&#8217;s the case, you can simply extract the SQL from the script and use it in your own reporting tools.<br />
<span id="more-126"></span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/ksh</span>
&nbsp;
<span style="color: #007800;">USER</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">grep</span> USER <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>aixuser<span style="color: #000000; font-weight: bold;">/</span>tsm_creds <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span> = <span style="color: #ff0000;">'{ print $2 }'</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">PASS</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">grep</span> PASS <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>aixuser<span style="color: #000000; font-weight: bold;">/</span>tsm_creds <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span> = <span style="color: #ff0000;">'{ print $2 }'</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #007800;">DSMADMC</span>=<span style="color: #ff0000;">&quot;/usr/bin/dsmadmc -id=<span style="color: #007800;">$USER</span> -pass=<span style="color: #007800;">$PASS</span> -dataonly=yes&quot;</span>
<span style="color: #007800;">DATE</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #ff0000;">&quot;%Y%m%d&quot;</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">DATE_SHORT</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #ff0000;">&quot;%a&quot;</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">TEMP_OLD</span>=<span style="color: #ff0000;">&quot;/tmp/tsm.temp.old&quot;</span>
<span style="color: #007800;">TEMP_NEW</span>=<span style="color: #ff0000;">&quot;/tmp/tsm.temp.new&quot;</span>
<span style="color: #007800;">MAILTO</span>=<span style="color: #ff0000;">&quot;email@host.com&quot;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-f</span> <span style="color: #007800;">$TEMP_OLD</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #c20cb9; font-weight: bold;">touch</span> <span style="color: #007800;">$TEMP_OLD</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #007800;">MACRO1</span>=<span style="color: #ff0000;">&quot;select VOLUME_NAME,ACCESS from volumes where access !='READWRITE' and access !='OFFSITE'&quot;</span>
&nbsp;
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;VOLUMES WITH STATUS ISSUES&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$TEMP_NEW</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>VOLUME_NAME            ACCESS&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$TEMP_NEW</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;------------------     ------------------&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$TEMP_NEW</span>
    <span style="color: #007800;">$DSMADMC</span> <span style="color: #007800;">$MACRO1</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$TEMP_NEW</span>
&nbsp;
<span style="color: #007800;">MACRO2</span>=<span style="color: #ff0000;">&quot;SELECT volumes.volume_name, volumes.stgpool_name, volumes.pct_utilized, volumes.status, volumes.write_errors, volumes.read_errors FROM volumes, libvolumes WHERE volumes.volume_name=libvolumes.volume_name AND ( volumes.write_errors&gt;0 OR volumes.read_errors&gt;0 )&quot;</span>
&nbsp;
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>VOLUMES WITH READ/WRITE ISSUES&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$TEMP_NEW</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>VOLUME_NAME            STGPOOL_NAME           PCT_UTILIZED     STATUS                 WRITE_ERRORS     READ_ERRORS&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$TEMP_NEW</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;------------------     ------------------     ------------     ------------------     ------------     -----------&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$TEMP_NEW</span>
    <span style="color: #007800;">$DSMADMC</span> <span style="color: #007800;">$MACRO2</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$TEMP_NEW</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">diff</span> <span style="color: #007800;">$TEMP_OLD</span> <span style="color: #007800;">$TEMP_NEW</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span>
   <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$?</span> == <span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #007800;">$TEMP_NEW</span> <span style="color: #000000; font-weight: bold;">|</span> mail <span style="color: #660033;">-s</span> <span style="color: #ff0000;">&quot;Warning: TSM Media Issues&quot;</span> <span style="color: #007800;">$MAILTO</span>
    <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #007800;">$TEMP_NEW</span> <span style="color: #007800;">$TEMP_OLD</span>
   <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #007800;">$TEMP_NEW</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exit</span></pre></td></tr></table></div>


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">aixuser@TSM /home/aixuser &gt; cat tsm_creds
USER=tsmuser
PASS=tsmpass
aixuser@TSM /home/aixuser &gt; ls -l
-r--------   1 aixuser     system           27 May 17 14:42 tsm_creds
-rwxr-xr-x   1 aixuser     system         1605 Sep 21 10:55 tsm_tape_issues</pre></div></div>

<p>Script breakdown<br />
Line(s)<br />
<b>03-04:</b>&nbsp;&nbsp;&nbsp;I grab the TSM credentials out of a file which only has o+r access rights so we don&#8217;t have the TSM credentials in the script itself (see above output).<br />
<b>17:</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SQL select statement to search for all volumes with access other than READWRITE and OFFSITE.<br />
<b>24:</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SQL select statement to search for all volumes with read/write errors.<br />
<b>31-35:</b>&nbsp;&nbsp;&nbsp;diff new output with previously saved output and determine if email should be sent.</p>
<p>It&#8217;s pretty straight forward, nothing fancy. Just change the variables to cater for your environment and off you go. The result will be an email with output similiar to the below if any issues are found.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">VOLUMES WITH STATUS ISSUES
&nbsp;
VOLUME_NAME            ACCESS
------------------     ------------------
TAPE09L4               UNAVAILABLE       
&nbsp;
&nbsp;
VOLUMES WITH READ/WRITE ISSUES
&nbsp;
VOLUME_NAME            STGPOOL_NAME           PCT_UTILIZED     STATUS                 WRITE_ERRORS     READ_ERRORS
------------------     ------------------     ------------     ------------------     ------------     -----------
TAPE09L4               PRI_TAPE_POOL                  13.7     FULL                              0               1</pre></div></div>

<p>Post any questions to the comments box below.</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://www.kristijan.org/2010/09/keeping-an-eye-on-tsm-volumes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

