Posts filed under 'Tutorials'

NetApp’s “lun_top” utility

Add comment January 16th, 2008

Have you ever wanted to run linux like top command and see most active luns on your NetApp filers?

Even if this twisted idea never crossed your mind, this is one of the usefull tools to keep your eye on when managing NetApp filer(s).

The Lun Top tool is a client-based utility that scans a filer via rsh/ssh and ranks the LUNs by usage. It enables the user to identify LUNs with the most activity on a given filer. There are two versions available: a Perl script for UNIX and an executable file for Windows.

Usage

Usage is as follows:

lun_top [-s shell] [-k] [-i interval] [-F | -I] [-c count] [-A] filer
-s shell
By default, the script uses rsh, but if you need another binary (remsh, ssh, etc.), use this flag to specify.
-k
Ranks by Kbytes per interval rather than the default ops/interval
-i interval
Sets the interval between updates and calculations in seconds. Default is 10 seconds (like sysstat).
-F
This flag will only show FCP luns, not iSCSI (default is to show all LUNs).
-I
This flag will only show iSCSI luns (default is to show all LUNs).
-c count
This will stop the loop after iterations. Default is to loop forever, until CTRL-C breaks it.
-A
Show the initiator adapters (WWPN or IQN) rather than the igroup. Default is to show the igroup.
filer
Name (or IP) of the filer to monitor. Must have rsh or ssh access from the host running the script.
Installation
  1. For a UNIX client with Perl, simply run the lun_top script. Make sure that the LunTop.pm file is in the same directory as the lun_top script.
  2. For a Windows client which does not have Perl installed, simply run the lun_top.exe file included in the package. Other files in the package are not needed.
Example

Here is an example of output:

Lun:                  Ops:    Igroup:
=================================================================================
lun.4              8478074    ESX
lun.5              3805463    ESX
lun.1              3222303    ESX
lun.2              1889689    ESX
lun.6              1740423    ESX
lun.3              1561762    ESX
lun.0               778500    ESX
iscsi_vir             8081    iscsi-vir
test.lun               608    viaRPC.iqn.1991-05.com.microsoft:ex1.rtp.netapp.lab
lun.7                   46    ESX

From this output, it is clear that LUNs that belong to the igroup ESX are the busiest in terms of ops. The server(s) that own these luns can be determined by looking at the igroup in the filer.

Download:

http://www.serverchief.com/netapp/lun_top.zip

Example:

perl lun_top -s ssh -k -i 1 -F -c 1 -A nyfiler1.serverchief.com

Hope you find it useful!!!

What is my IP Address - query tool

Add comment December 28th, 2007

I written a tiny web app to resolve the external ip. It is similar to what is my IP address site, however, there is no advertisement and other useless information. Can be used during troubleshooting and in various scripts to identify external internet ip address.

When do i use it?
When you need to find out your external ip address quickly.
When you write monitoring scripts/utilities and need to confirm hosts external ip.
When network settings have been changed and external ip is unknown.
When internet load balancing is used.. etc…

Usage:

Using web browser visit: http://ip.serverchief.com

Using unix shell & curl command: curl ip.serverchief.com

Using perl with basic LWP: perl -MLWP::Simple -e “getprint ‘http://ip.serverchief.com’”

————————–
Hope you find it usefull.

Virtualizing Live Linux Server to ESX 3.x Host

1 comment September 5th, 2007

There are many ways to virtualize a linux O.S. This video tutorial will show you how to do a live pull of running Linux O.S. to ESX host.
NOTE: Ideally, you should power off your linux server and boot up with Knoppix. However, since this is a single purpose MySQL server, we don’t need the data to be consistent. We can rsync the difference later.
This tutorial requires common knowledge of unix/linux commands and O.S.
Let us begin..

In this example, I needed to virtualize a linux mysql server to VmWare ESX platform. Here is a roadmap we will follow…

1) Use disk dump (dd) to get the data of the drives, fastest method…

2) Create partition data vmdk file

3) Convert you images to VMFS3 format

4) Create a VM with similar configuration and point the drives

5) Boot with Knoppix and rebuild initrd for scsi support (if needed)
6) Use kudzu to detect and reconfigure new hardware

7) Rsync changed data

8) Change IP and test…

Details coming soon….