blog'o thnet

To content | To menu | To search

HP-UX

Entries feed

Monday 16 August 2010

Looking For WWN On HP-UX System

Just as a complement to more older entries about SAN storage and how to get specific SAN information, here is the way I generally use when looking for World Wide Node Name, and World Wide Port Name (WWNN, and WWPN respectively) on a HP-UX system.

First, get the driver and instance name of all the HBA installed on the system:

# ioscan -knfC fc
Class     I  H/W Path        Driver   S/W State   H/W Type     Description
===========================================================================
fc        0  0/0/6/0/0/4/0   fcd      CLAIMED     INTERFACE    HP A9784-60002 PCI/PCI-X Fibre Channel FC/GigE Combo Adapter (FC Port 1)
                            /dev/fcd0
fc        1  0/0/10/0/0/4/0  fcd      CLAIMED     INTERFACE    HP A9784-60002 PCI/PCI-X Fibre Channel FC/GigE Combo Adapter (FC Port 1)
                            /dev/fcd1
fc        2  0/0/12/0/0/4/0  fcd      CLAIMED     INTERFACE    HP A9784-60002 PCI/PCI-X Fibre Channel FC/GigE Combo Adapter (FC Port 1)
                            /dev/fcd2
fc        3  0/0/14/0/0/4/0  fcd      CLAIMED     INTERFACE    HP A9784-60002 PCI/PCI-X Fibre Channel FC/GigE Combo Adapter (FC Port 1)
                            /dev/fcd3

Then, get the disk or tape hardware paths to be crossed with the FC information above:

# ioscan -knfC tape
Class     I  H/W Path        Driver   S/W State   H/W Type     Description
===========================================================================
tape      0  0/0/10/0/0/4/0.11.16.255.0.0.1  stape    NO_HW       DEVICE       HP      Ultrium 3-SCSI
                            /dev/rmt/0m             /dev/rmt/0mn            /dev/rmt/c40t0d1BEST    /dev/rmt/c40t0d1BESTn
                            /dev/rmt/0mb            /dev/rmt/0mnb           /dev/rmt/c40t0d1BESTb   /dev/rmt/c40t0d1BESTnb
tape      1  0/0/10/0/0/4/0.11.16.255.0.0.2  stape    NO_HW       DEVICE       HP      Ultrium 3-SCSI
                            /dev/rmt/1m             /dev/rmt/1mn            /dev/rmt/c40t0d2BEST    /dev/rmt/c40t0d2BESTn
                            /dev/rmt/1mb            /dev/rmt/1mnb           /dev/rmt/c40t0d2BESTb   /dev/rmt/c40t0d2BESTnb

Last, you just have to use the fcmsutil on the proper FC device:

# fcmsutil /dev/fcd1

                           Vendor ID is = 0x001077
                           Device ID is = 0x002312
            PCI Sub-system Vendor ID is = 0x00103c
                   PCI Sub-system ID is = 0x0012c7
                               PCI Mode = PCI-X 133 MHz
                       ISP Code version = 3.3.166
                       ISP Chip version = 3
                               Topology = PTTOPT_FABRIC
                             Link Speed = 2Gb
                     Local N_Port_id is = 0x0b0e00
                  Previous N_Port_id is = None
            N_Port Node World Wide Name = 0x50060b00005de769
            N_Port Port World Wide Name = 0x50060b00005de768
            Switch Port World Wide Name = 0x200e00051e5c1c17
            Switch Node World Wide Name = 0x100000051e5c1c17
                           Driver state = ONLINE
                       Hardware Path is = 0/0/10/0/0/4/0
                     Maximum Frame Size = 2048
         Driver-Firmware Dump Available = NO
         Driver-Firmware Dump Timestamp = N/A
                         Driver Version = @(#) libfcd.a HP Fibre Channel ISP 23xx & 24xx Driver B.11.11.10 /ux/kern/kisu/FCD/src/common/wsio/fcd_init.c:Sep 14 2006,17:45:41

That's it.

Wednesday 5 March 2008

Create And Remove A Remote Printer Queue (CLI)

You can easily create and remove a remote printer queue using the BSD type spooler. You just have to fill the configuration file /tmp/lp.list properly, i.e. provide the local printer name, the remote LPD server, and the remote printer queue:

# cat << EOF > /tmp/lp.list
locname1 lpdserv1 remname1
locname2 lpdserv2 remname2
EOF

Then, just run the appropriate script depending of the desired behavior. Follow, an example when removing the two queues:

# cat << EOF > /tmp/lp.remove
#!/usr/bin/env sh

for lplocal in `awk '{print $1}' /tmp/lp.list`; do
  /usr/sbin/lpshut
  /usr/bin/cancel ${lplocal} -e 2> /dev/null
  /usr/sbin/lpadmin -x${lplocal}
  /usr/sbin/lpsched -v
  sleep 1
done

exit 0
EOF
# sh /tmp/lp.remove
scheduler stopped
scheduler is running
scheduler stopped
scheduler is running
# lpstat -olocname1
no system default destination
lpstat: "locname1" not a request id or a destination

And now, the creation:

# cat << EOF > /tmp/lp.create
#!/usr/bin/env sh

while read lp; do
  eval set -- `IFS=" "; printf '"%s" ' ${lp}`
  lplocal="$1"
  lpserver="$2"
  lpremote="$3"

  /usr/sbin/lpshut
  /usr/sbin/lpadmin -p${lplocal} -orm${lpserver} -orp${lpremote} \
   -mrmodel -v/dev/null -orc -ob3 -ocmrcmodel -osmrsmodel
  /usr/sbin/accept ${lplocal}
  /usr/bin/enable ${lplocal}
  /usr/sbin/lpsched -v
  sleep 1
done < /tmp/lp.list

exit 0
EOF
# sh /tmp/lp.create
scheduler stopped
destination "locname1" now accepting requests
printer "locname1" now enabled
scheduler is running
scheduler stopped
destination "locname2" now accepting requests
printer "locname2" now enabled
scheduler is running
# lpstat -olocname1
no system default destination
printer queue for locname1
                         Windows LPD Server
                   Printer \\lpdserv1
emname1
Owner       Status         Jobname          Job-Id    Size   Pages  Priority
----------------------------------------------------------------------------
hostname: locname1: ready and waiting
no entries

That's it!

Saturday 2 July 2005

Install and Configure the TSM Client on HP-UX Platform

  1. beastie is the hostname of the local system
  2. rafal is the hostname of the repository system hosting the necessary packages in the depot
  3. moliere is the hostname of the TSM backup server

Be sure to obtain the sam(1m) display:

# DISPLAY=beastie:0
# export DISPLAY

Check if the os level and product version agreed on the same specifications, and that there is sufficient disk space to install the TSM client components:

# uname -a
# model
# bdf /opt
# vgdisplay vg00
# swlist | grep OnLineJFS

Launch the System Administration Manager (see the sam(1) manual page for more information) and follow these steps:

# sam&
/*
 * Software Management
 *  Install Software to Local Host
 *   Source Depot Type: Network Directory/CDROM
 *   Source Host Name... rafal
 *   Source Depot Path... /var/spool/sw/1100
 *    select "TIVsm   5.2.2   Tivoli Storage Manager Client"
 */

Configure the new tool:

# cd /opt/tivoli/tsm/client/ba/bin
# cp dsm.sys.smp dsm.sys
# cp dsm.opt.smp dsm.opt
# nslookup moliere   /* Check that the backup server is available. */
# vi dsm.opt
# vi dsm.sys         /* Modify the `nodename' accordingly. */
# vi inclexcl.excl   /* Adapt the content following the recommendation from
                        the storage/backup team. */
# dsmc q ses         /* Tune the TSM Server Connection Information following
                        the recommendation from the storage/backup team. */

Launch the TSM scheduler at run-level #3:

# cat << EOF > /sbin/init.d/tsmsched
#!/bin/sh 

killproc() {            # kill the named process(es)
        pid=`/usr/bin/ps -ef|
             /usr/bin/grep '[d]smc sched' |
             awk '{ print $2 }'`
        if [ "$pid" != "" ];
        then
                kill $pid
                sleep 5
                kill -0 $pid
                [ $? -ne 0 ] && kill -9 $pid
        fi
}

startproc() {
        if [ -f /usr/bin/dsmc ]; then
                (/usr/bin/nohup /usr/bin/dsmc sched &) >/dev/null 2>&1
                echo  "dsmc
" 
        fi
}

case $1 in
'start_msg')
        echo  "starting TSM scheduler:" 
        ;;
'start')
        startproc
        ;;
'stop_msg')
        echo  "stopping TSM scheduler:" 
        ;;
'stop')
        killproc
        ;;
'restart')
        echo  "restarting TSM scheduler:" 
        killproc
        startproc
        ;;
*)
        echo "usage: `basename $0` {start|stop}"
        ;;
esac
EOF
# chmod 744 /sbin/init.d/tsmsched
# ln -s /sbin/init.d/tsmsched /sbin/rc3.d/S300tsmsched
# /sbin/rc3.d/S300tsmsched start