Getting HBA / Fabric statistics on Solaris 10

You can use iostat (ignoring the disks, md (mirros) and nfs)

# iostat -xdmzC 1 10 | egrep -v "sd|md|nfs"

How to find HBA WWN Solaris 10

To get a WWN HBA on Solaris 10 you can use the fcinfo

# fcinfo hba-port | grep -i wwn

Identify ethN correspondent to physical interface – Red Hat Enterprise Linux

Many times is necessary identify who eth (eth0, eth1, eth2, … , ethN) correspond to physical interface.

For this you can use the ethtool

ethtool -p ethN

example:

ethtool -p eth0

One or more LEDs on the specific physical ethernet port are blinking now.

Using authorized keys on SSH without password – Red Hat Enterprise Linux (works with others Unix)

Remember this is a very intrusive configuration.
Look your security policies with atention.

1. Make de keys using ssh-keygen

On the “Enter passphrase” question leave black and enter.

# ssh-keygen -t dsa -f ~/.ssh/id_dsa
Generating public/private dsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/user1/.ssh/id_dsa.
Your public key has been saved in /home/user1/.ssh/id_dsa.pub.
The key fingerprint is:
87:52:b6:ec:c9:1f:f2:ce:be:d7:33:e9:1b:2b:33:dd user1@myserver1

2. Copy the public key for the server you want to have direct access.

# scp .ssh/id_dsa.pub user1@myserver2:~/.ssh/authorized_keys_temp

On myserver2 increse autorized_keys

# cat ~/.ssh/authorized_keys_temp >> ~/.ssh/authorized_keys

Remove temporary authorized_keys

# rm ~/.ssh/authorized_keys_temp

TIP: On RHEL 5 You can use ssh-copy-id

# ssh-copy-id -i ~user1/.ssh/id_dsa.pub user1@myserver2

Enabling rlogin, rexec and rcp (rsh-server) on Red Hat

On this example I´m using two servers named of myserver1 and myserve2 and the user is user1.

1. Install rsh-server

# yum install rsh-server -y
Loaded plugins: rhnplugin, security
Repository 'RHEL5LocalRepository' is missing name in configuration, using id
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package rsh-server.x86_64 0:0.17-40.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================
Package               Arch              Version                 Repository                       Size
=======================================================================================================
Installing:
rsh-server            x86_64            0.17-40.el5             RHEL5LocalRepository             40 k

Transaction Summary
=======================================================================================================
Install       1 Package(s)
Upgrade       0 Package(s)

Total download size: 40 k
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing     : rsh-server                                                                      1/1

Installed:
rsh-server.x86_64 0:0.17-40.el5

Complete!

2. Enable services

# chkconfig rsh on
# chkconfig rlogin on
# chkconfig rexec on
# chkconfig nscd on
# chkconfig xinetd on

3. Reestart xinetd and  nscd

# /etc/init.d/xinetd restart
Stopping xinetd:                                           [  OK  ]
Starting xinetd:                                           [  OK  ]

# /etc/init.d/nscd restart
Stopping nscd:                                             [  OK  ]
Starting nscd:                                             [  OK  ]

4. Edit /etc/securetty and add rsh, rlogin and rexec

# vi /etc/securetty

Put on end of file:

rsh
rlogin
rexec

5. Create file ~user1/.rhosts (user1 is my user example)

# vi ~user1/.rhosts

Put on end of file:

myserver2 user1

Change the permission of file

# chmod 600 ~user1/.rhost

6. Testing

On myserver2 with user1 create a file testing.file

# touch testing.file

Uses the rcp:

# rcp testing.file myserver1:tested.file

Look if file are created using the rexec

# rsh myserver1 ls -l ~user1

My First AppleScript – iTerm-CM

iTerm Connect Manager a.k.a iTerm-CM.

This is my first AppleScript. It’s not beautiful, but works fine.

With this AppleScript you can manager multiples conections using iTerm.
This AppleScript make automatic connections and commands using a file text on $HOME/iTerm-CM/Services. Please read Usage.

Usage:

Create on your home the dir iTerm-CM and put a file server (full path $HOME/iTerm-CM/servers)
The file need content that structure:
SERVERNAME:ADDRESS:USERNAME:PASSWORD:CMD1:CMD2:CMD3:CMD4
The script open a server list, select server and enjoy

For more informations, look here.

Identify QLogic WWN on Red Hat Enterprise Linux 5 and 4 (RHEL)

How to identify/get QLogic WWN on Red Hat Enterprise Linux 5 (RHEL5).

First identify your installed or recognized

# lspci | grep -i fibre
04:00.0 Fibre Channel: QLogic Corp. ISP2432-based 4Gb Fibre Channel to PCI Express HBA (rev 03)
04:00.1 Fibre Channel: QLogic Corp. ISP2432-based 4Gb Fibre Channel to PCI Express HBA (rev 03)
05:00.0 Fibre Channel: QLogic Corp. ISP2432-based 4Gb Fibre Channel to PCI Express HBA (rev 03)
05:00.1 Fibre Channel: QLogic Corp. ISP2432-based 4Gb Fibre Channel to PCI Express HBA (rev 03)

On Red Hat Enterprise Linux 5 (5.x) is on /sys/class/fc_host/hostX/port_name

(X is your device 1,2,3,…N)

For get use:

cat /sys/class/fc_host/hostX/port_name

Sample with multiple HBA (Fibre) QLogic

# ls /sys/class/fc_host/
host3  host4  host5  host6
# cat /sys/class/fc_host/host[3-6]/port_name
0x2100001b32936e24
0x2101001b32b36e24
0x2100001b32932821
0x2101001b32b32821

On Red Hat Enterprise Linux 4 (AS/ES) is on /proc/scsi/qla2xxx/1 (1,2,3,..N)

Sample:

# egrep [node|port] /proc/scsi/qlx2xxx/0
scsi-qla0-adapter-node=200000e08b1c19f2;
scsi-qla0-adapter-port=210000e08b1c19f2;

NMON for Solaris? Yes, you can use SARMON

SARMON, NMON for Solaris

Searching about NMON I find the SARMON. This is a great solution for reports of capacity on Solaris.

If you know the NMON (website) for AIX e Linux and need for Solaris you can use the SARMON (website)

For reports you can use the original tool

The installation is very ease

1. Get the .zip file

2. Save on /var/tmp

3. Unzip the .zip

# unzip sarmon_v1.01.bin_sparc.zip

4. Make backup of original files

# cp /usr/bin/sar /usr/bin/sar.orig
# cp /usr/bin/timex /usr/bin/timex.orig
# cp /usr/lib/sa/sadc /usr/lib/sa/sadc.orig

5. Move the sarmon to /usr/local

# mv /var/tmp/sarmon_v1.01.bin_sparc /usr/local/sarmon

6. Copy files

# cp /usr/local/sarmon/sar /usr/bin/sar
# cp /usr/local/sarmon/timex /usr/bin/timex
# cp /usr/local/sarmon/sadc /usr/lib/sa/sadc

7. Edit the crontab and put the entry for collect

0 0 * * * /usr/local/sarmon/sa1 300 288 &

This start collect every day at 00:00

The files generated are in /var/adm/sa/ (day-by-day)

How to identify ssd devices on Solaris (MX000 Servers only)

How to identify ssd devices on Solaris (MX000 Servers only)

1. Open one SSH on XSCF

Last login: Tue Mar 23 12:22:37 2010 from XXX.YYY.ZZZ.KKKK
XSCF>

2. Open on SSH session on your Solaris Server

Last login: Tue Mar 23 11:35:06 2010 from XXX.YYY.ZZZ.KKKK
Sun Microsystems Inc.   SunOS 5.10      Generic January 2005
You have new mail.
[root@MYSERVER ]#

3. Verify your top disks I/O with iostat

Sample:

[root@MYSERVER ]#  iostat -xM | grep ssd
ssd0        0.0    0.0    0.0    0.0  0.0  0.0    0.0   0   0
ssd43       0.0    0.0    0.0    0.0  0.0  0.0    0.9   0   0
ssd50       0.0    0.0    0.0    0.0  0.0  0.0    0.2   0   0
ssd61       0.0    0.0    0.0    0.0  0.0  0.0    0.0   0   0
ssd62       0.0    0.0    0.0    0.0  0.0  0.0    0.0   0   0
ssd148      0.0    0.0    0.0    0.0  0.0  0.0    0.0   0   0
ssd159      0.3    0.6    0.0    0.0  0.0  0.0    2.0   0   0
ssd160      0.1    0.3    0.0    0.0  0.0  0.0    2.4   0   0
ssd201      0.0    0.0    0.0    0.0  0.0  0.0    0.0   0   0
ssd202      0.0    0.0    0.0    0.0  0.0  0.0    0.0   0   0
ssd203      0.0    0.0    0.0    0.0  0.0  0.0    0.0   0   0
ssd296      0.0    0.0    0.0    0.0  0.0  0.0    0.1   0   0
ssd333      0.0    0.0    0.0    0.0  0.0  0.0    0.1   0   0

4. Verify the SSD Devices on XSCF of respective domain of server.

Sample:

# showdevices -v -d 01
01  01-2      ssd201  /dev/dsk/c4t500009740809C55Cd42s2Device being used by VxVM
01  01-2      ssd202  /dev/dsk/c4t500009740809C55Cd41s2Device being used by VxVM

Veritas Volume Manager (VxVM) – Disk Group DG Rename

Veritas Volume Manager (VxVM) – DG (Disk Group) Rename

1. Umount all filesystems used

# umount /myfilesystem1
# umount /myfilesystem2

2. Stop all volumes of Disk Group (DG)

# vxdg -g DG_APPS stopall

3. Deport the Disk Group (DG)

# vxdg deport DG_APPS

4. Import Disk Group with new name

# vxdg -n DG_DB import DG_APPs