HPUX::Tools

From HPUX.ch
Jump to: navigation, search

Contents

HP-UX Tools

Download

Current Version: 397 ( Wed, 03 Apr 2013 )
Registered users: 759


Download (Registration needed and possible here to get username and password)

or

# wget --user=**** --ask-password http://svn.hpux.ch/sw/hpuxtools/deploy/hpuxtools.depot

Check version of the depot file

# swlist -s $PWD/hpuxtools.depot
...
  hpuxtools	B.11.31.144       Tools to simpler manage HP-UX

Installation

# swinstall -s /var/tmp/hpuxtools.depot \*

Feedback

Feedback can be sent to dave (at) hpux.ch

Introduction

I'd like to show you how to work with the most valuable hpux tools. The goal for me is ,that you understand what the meaning of these tools is and what you can use them for.

First of all: For the most hpuxtools you need to have the bash installed. In my opinion bash is the most distributed, most used and best shell for UNIX systems. So why we sholdn't use it on HPUX too?

hpuxprepare

To install the bash and configure the environment you should issue

# /opt/hpuxtools/hpuxprepare

This command will install the bash and adjust the .profile file for root.

In this prepared state you can use every hpuxtool as expected.

dadm

The tool with it all begun is dadm: It fills the leak of a good listing of the disks you have attached to your server.

# dadm
disk1   0x600508b40006e63d0001200000660000  ONLINE   100G 0x0      vg00 :ROOT 
disk3   0x600508b40006e63d0001200000f00000  ONLINE    20G 0x0      vgtest  
disk8   0x600508b40006e63d0001200000780000  UNOPEN   100G 0x0        
disk9   0x600508b40006e63d00012000006c0000  UNOPEN   100G 0x0        
disk10  0x600508b40006e63d00012000007e0000  UNOPEN   100G 0x0        
disk11  0x600508b40006e63d0001200000720000  UNOPEN   100G 0x0

As you can see it displays the disk with its WWID, its state and size and if it is used by a volume group the name of the volume group. But there are a lot of parameters you can use to get more information about the disks:

USAGE: /opt/hpuxtools/dadm -d device
 -h: display hba details
 -p: show path information
 -D: show drd clone information
 -c: show information of cluster dsf
 -m: show cluster dsf mapping
 -e: show enclosure alias information
 -g: get_devid
 -a: shows the alias
 -x: cleanup stale devices
 -v: show version
 -?: show this help

With the -h you are able to get some hba details:

# dadm -h
HBA: /dev/fcd0: 4Gb: ONLINE
WWNN:  0x50060b0000c2860d
WWPN:  0x50060b0000c2860c

HBA: /dev/fcd1: 4Gb: ONLINE
WWNN:  0x50060b0000c2860f
WWPN:  0x50060b0000c2860e

As you can see: You get a list of all HBAs in your server with the information about speed, status and their WWNN and WWPN.

With the -p option you can get the path information. This is helpfull to see over how many pathes a disk is connected to a storage system and what is the state of the pathes

disk66  0x5000cca00b19120c                  ONLINE   136G 0x1000000c0000000 vg00 :ROOT 
 +- 1   ciss0.0x0.disk66             ACTIVE  

disk67  0x5000cca00b19d4e4                  UNOPEN   136G 0x1010000c0000000   
 +- 2   ciss0.0x0.disk67             UNOPEN  

disk68  0x600508b40006e63d0001200000660000  UNOPEN   100G 0x4001     
 +- 22  fcd0.tport1.disk68           UNOPEN  
 +- 4   fcd0.tport0.disk68           UNOPEN  
 +- 32  fcd1.tport2.disk68           UNOPEN  
 +- 55  fcd1.tport3.disk68           UNOPEN

If you are using the Cluster DSF feature you can get the related disk infromation by using the parameters -c and -m.

# dadm -c
disk1   0x600508b40006e63d0001200000660000  UNOPEN   100G 0x4001     
disk2   0x600508b40006e63d00012000006c0000  UNOPEN   100G 0x4002     
disk3   0x600508b40006e63d0001200000720000  UNOPEN   100G 0x4003     
disk4   0x600508b40006e63d0001200000780000  UNOPEN   100G 0x4004     
disk5   0x600508b40006e63d00012000007e0000  UNOPEN   100G 0x4005     
disk6   0x600508b40006e63d0001200000840000  UNOPEN   150G 0x4006     
disk7   0x600508b40006e63d0001200000510000  UNOPEN     1G 0x4007     
disk8   0x600508b40006e63d0001200000ea0000  ONLINE    20G 0x4009   vgsybdata  
disk9   0x600508b40006e63d0001200000f00000  UNOPEN    20G 0x400a     
disk10  0x600508b40006e63d0001200000f60000  UNOPEN    20G 0x400b     
disk11  0x600508b40006e63d0001200000fc0000  UNOPEN    20G 0x400c     
disk12  0x600508b40006e63d0001200001020000  UNOPEN    20G 0x400d     
disk13  0x600508b40006e63d0001200001080000  UNOPEN    20G 0x400e     
disk14  0x600508b40006e63d00012000010e0000  UNOPEN    20G 0x400f     
disk15  0x600508b40006e63d0001200001140000  UNOPEN    20G 0x4010 

With the -c option you get a list of all cdsf disks.

    
# dadm -m
disk1   disk68  0x600508b40006e63d0001200000660000  UNOPEN   100G 0x4001     
disk2   disk69  0x600508b40006e63d00012000006c0000  UNOPEN   100G 0x4002     
disk3   disk70  0x600508b40006e63d0001200000720000  UNOPEN   100G 0x4003     
disk4   disk71  0x600508b40006e63d0001200000780000  UNOPEN   100G 0x4004     
disk5   disk72  0x600508b40006e63d00012000007e0000  UNOPEN   100G 0x4005     
disk6   disk73  0x600508b40006e63d0001200000840000  UNOPEN   150G 0x4006     
disk7   disk74  0x600508b40006e63d0001200000510000  UNOPEN     1G 0x4007     
disk8   disk76  0x600508b40006e63d0001200000ea0000  ONLINE    20G 0x4009   vgsybdata  
disk9   disk77  0x600508b40006e63d0001200000f00000  UNOPEN    20G 0x400a     
disk10  disk78  0x600508b40006e63d0001200000f60000  UNOPEN    20G 0x400b     
disk11  disk79  0x600508b40006e63d0001200000fc0000  UNOPEN    20G 0x400c     
disk12  disk80  0x600508b40006e63d0001200001020000  UNOPEN    20G 0x400d     
disk13  disk81  0x600508b40006e63d0001200001080000  UNOPEN    20G 0x400e     
disk14  disk82  0x600508b40006e63d00012000010e0000  UNOPEN    20G 0x400f     
disk15  disk83  0x600508b40006e63d0001200001140000  UNOPEN    20G 0x4010

With the -m option you get a list with all cdsf disks including the mapping to the "real" disks.

With the -e option you are able to get the enclosure alias information. With this option you can find out what enclosure presents the disk to your server:

# dadm -e
disk66                         0x5000cca00b19120c                  ONLINE   136G 0x1000000c0000000 vg00 :ROOT 
disk67                         0x5000cca00b19d4e4                  UNOPEN   136G 0x1010000c0000000   
disk68  EVA0x50001fe150110b50  0x600508b40006e63d0001200000660000  UNOPEN   100G 0x4001     
disk69  EVA0x50001fe150110b50  0x600508b40006e63d00012000006c0000  UNOPEN   100G 0x4002     
disk70  EVA0x50001fe150110b50  0x600508b40006e63d0001200000720000  UNOPEN   100G 0x4003     
disk71  EVA0x50001fe150110b50  0x600508b40006e63d0001200000780000  UNOPEN   100G 0x4004     
disk72  EVA0x50001fe150110b50  0x600508b40006e63d00012000007e0000  UNOPEN   100G 0x4005     
disk73  EVA0x50001fe150110b50  0x600508b40006e63d0001200000840000  UNOPEN   150G 0x4006

As you can see in this example: The disk disk66 and disk67 are local disks (no enclosure information). The disks disk68 to disk73 are presented all from the same EVA storage system with the WWID 50001fe150110b50.

A very nice feature I use in environments with a lot of disks is the ability to set a devid to a disk. With the hpuxtools command

# disksetdevid

you can set such a devid. This will write a identification string to the disk itself. That means if you are working in a clustered environment you are able to "mark" a disk and you will see this "mark" on every other server on witch the lun is presented to with the command

# dadm -g
# dadm -g
disk66  0x5000cca00b19120c                  ONLINE   136G 0x1000000c0000000 vg00 :ROOT 
disk67  0x5000cca00b19d4e4                  UNOPEN   136G 0x1010000c0000000   
disk68  0x600508b40006e63d0001200000660000  UNOPEN   100G 0x4001    ;devid:vm1_root 
disk69  0x600508b40006e63d00012000006c0000  UNOPEN   100G 0x4002    ;devid:vm2_root 
disk70  0x600508b40006e63d0001200000720000  UNOPEN   100G 0x4003    ;devid:vm3_root 
disk71  0x600508b40006e63d0001200000780000  UNOPEN   100G 0x4004    ;devid:vm4_root 
disk72  0x600508b40006e63d00012000007e0000  UNOPEN   100G 0x4005    ;devid:vm5_root 
disk73  0x600508b40006e63d0001200000840000  UNOPEN   150G 0x4006    ;devid:free 
disk74  0x600508b40006e63d0001200000510000  UNOPEN     1G 0x4007    ;devid:lockdisk

With the

# dadm -x

command you can even clean up staled devices. Staled devices are device files that exists on your system but there is no hardware attached to it. This means the device files are useless and you can delete them.

# dadm -x
Cleaning up stale devices...

orasetenv

Another nice command is the

# orasetenv

command. This allows you to set the environment to the oracle owner based on the SID of the oracle database. If you are in a X forwaded session the X forwarding settings are also copied to the new environment. And this is exactly the great advantage of this script.

If you open a ssh session to a oracle db host as root with X forwading enabled

# ssh -X -l root host

You are able to change the environment for each database that is mentiond in the /etc/oratab file.

# orasetenv -s SID -u

This command change the user to the oracle owner, sets the ORACLE_HOME and ORACLE_SID to their correct values and overtakes the X session into the new environment. It replaces the need of adjusting the .profile of the oracle owner and the command sequences like

# su - oracle
# export DISPLAY=<ip addr>:0.0

In addition it sets the environment variable OH to the ORACLE_HOME to easaly change to the ORACLE_HOME directory:

# cd $OH

depothelper

An additional advatage is that the depothelper script from hpux.connect.org.uk is included in the hpuxtools and adjusted to use passive ftp. With this nice script you are able to download and install opensource software for hpux in a packagemanagement manner: For example if you would like to install subversion and wget you can do it very simple by typing:

# depothelper subversion
===============================================================================
Package-version      Comment              Download        Install
===============================================================================
ia64-11.31           Package list         Using cache     OK                  
apr-0.9.19           Dependency (01/11)   OK              OK                  
apr_util-0.9.19      Dependency (02/11)   OK              OK                  
db-5.2.28            Dependency (03/11)   OK              OK                  
expat-2.0.1          Dependency (04/11)   OK              OK                  
gdbm-1.8.3           Dependency (05/11)   OK              OK                  
ncurses-5.9          Dependency (06/11)   OK              OK                  
neon-0.29.6          Dependency (07/11)   OK              OK                  
openssl-1.0.0d       Dependency (08/11)   OK              OK                  
readline-6.2.001     Dependency (09/11)   OK              OK                  
sqlite-3.7.7.1       Dependency (10/11)   OK              OK                  
zlib-1.2.5           Dependency (11/11)   OK              OK                  
subversion-1.6.17    Requested            OK              OK                  
===============================================================================

# depothelper wget      
===============================================================================
Package-version      Comment              Download        Install
===============================================================================
ia64-11.31           Package list         Using cache     OK                  
libidn-1.22          Dependency (01/02)   OK              OK                  
perl-5.10.1          Dependency (02/02)   OK              OK                  
wget-1.12            Requested            OK              OK                  
===============================================================================

The only needs are:

  • Your HPUX box must have access to the internet

I hope with this little intro you find my hpuxtools helpful. If you have questions or issues don't hesitate to ask me via email, chat, twitter, facebook... (see Contact).

HP-UX System Mangement

hpuxprepare

Prepares the environment for the optimal use of the hpux tools after the initial installation:

  • Installs the bash
  • Sets the default shell to bash for root
  • Sets the default shell to bash in the /etc/skell for new users
  • Adds /opt/hpuxtools and /usr/local/bin to the PATH

tcptunnel

Tcptunnel is a simple TCP port forwarder. There is nothing special about it. This tool listens to a local TCP port and all the received data is sent to a remote host. It can be used to redirect TCP based protocols like SMTP, NNTP, IRC or HTTP.

tcptunnel -?
Usage: tcptunnel [options]

Options:
  -v
  -?   this help

  -p   port to redirect
  -r   target port
  -h   target host
  -b   bind IP address

  -s   stay alive
  -l   log to stdout

Special thanks to Clemens Fuchslocher.

tcpconftunnel

Tool to configure persistent tcptunnels (persistent across reboots).

# tcpconftunnel
TCPTUNNEL_START=1

PORT[0]=80
RHOST[0]=localhost
RPORT[0]=8080

PORT[1]=2222
RHOST[1]=localhost
RPORT[1]=22

tcpinfotunnel

Tool to get a list of the active tcptunnels.

# tcpinfotunnel
Active TCP Tunnels:
	port 2222  -> localhost:22              (PID:9492)
	port 80    -> localhost:8080            (PID:9490)

dfh

Calculates human readable amounts of the outputs df -Pk or bdf (with the -b parameter.

# dfh -b
Filesystem                          Total       Used       Free  Cap Mountpoint          
/dev/vg00/lvol_root                 4.00G    405.89M      3.37G  11% /                   
/dev/vg00/lvol_stand                2.00G    185.11M      1.70G  10% /stand              
/dev/vg00/lvol_var                 10.00G      1.20G      8.25G  13% /var                
/dev/vg00/lvol_var_adm_crash        2.50G     17.20M      2.32G   1% /var/adm/crash      
/dev/vg00/lvol_usr                  8.42G      2.67G      5.38G  33% /usr                
/dev/vg00/lvol_tmp                  4.00G    748.28M      3.06G  19% /tmp                
/dev/vg00/lvol_opt                 25.00G     18.47G      6.11G  75% /opt                
/dev/vg00/lvol_home                 6.00G     18.49M      5.60G   0% /home               
/dev/vgoracle/lvoracle             19.99G      9.90G      9.46G  51% /oracle

llh

Calculates human readable amounts of the output ls -l (ll).

# llh
total 93626
-rwxr-xr-x   1 root       sys            971 Dec 21 16:26 apaconf
-rwxr-xr-x   1 root       sys            631 Dec 21 16:26 asmshowprocs
-rw-r--r-x   1 root       sys         31.46M Dec 21 16:26 bash.depot
-rwxr-xr-x   1 root       sys            895 Dec 21 16:26 cgrep
-rwxr-xr-x   1 root       sys          3.38K Dec 21 16:26 cmv

hpuxaddswap

Adds additional swap space

# hpuxaddswap 
 -l: vg to use
 -L: lvname to use
 -s: size in MB
 -v: show version

apaconf

Configures Auto Port Aggregation interfaces (script based).

# apaconf
Name/          Interface Station          Sub-   Interface      Related
ClassInstance  State     Address        system   Type           Interface
============== ========= ============== ======== ============== =========
lan0           UP        0x0017A4772430 iexgbe   10GBASE-KR     
lan1           UP        0x0017A4772432 iexgbe   10GBASE-KR     
lan2           UP        0x0017A4772418 iexgbe   10GBASE-KR     
lan3           UP        0x0017A477241A iexgbe   10GBASE-KR     
lan900         DOWN      0x000000000000 hp_apa   hp_apa         
lan901         DOWN      0x000000000000 hp_apa   hp_apa         
lan902         DOWN      0x000000000000 hp_apa   hp_apa         
lan903         DOWN      0x000000000000 hp_apa   hp_apa         
lan904         DOWN      0x000000000000 hp_apa   hp_apa         

Class     I  H/W Path       Driver S/W State   H/W Type     Description
========================================================================
lan       0  0/0/0/3/0/0/0  iexgbe   CLAIMED     INTERFACE    HP  PCIe 2-p 10GbE Built-in
lan       1  0/0/0/3/0/0/1  iexgbe   CLAIMED     INTERFACE    HP  PCIe 2-p 10GbE Built-in
lan       2  0/0/0/4/0/0/0  iexgbe   CLAIMED     INTERFACE    HP  PCIe 2-p 10GbE Built-in
lan       3  0/0/0/4/0/0/1  iexgbe   CLAIMED     INTERFACE    HP  PCIe 2-p 10GbE Built-in

Give the instance number of the apa if:
...

vlanconf

Configures VLAN interfaces (script based).

# vlanconf 

Name/          Interface Station          Sub-   Interface      Related
ClassInstance  State     Address        system   Type           Interface
============== ========= ============== ======== ============== =========
lan0           UP        0x0017A4772430 iexgbe   10GBASE-KR     
lan1           UP        0x0017A4772432 iexgbe   10GBASE-KR     
lan2           UP        0x0017A4772418 iexgbe   10GBASE-KR     
lan3           UP        0x0017A477241A iexgbe   10GBASE-KR     
lan900         DOWN      0x000000000000 hp_apa   hp_apa         
lan901         DOWN      0x000000000000 hp_apa   hp_apa         
lan902         DOWN      0x000000000000 hp_apa   hp_apa         
lan903         DOWN      0x000000000000 hp_apa   hp_apa         
lan904         DOWN      0x000000000000 hp_apa   hp_apa         

Class     I  H/W Path       Driver S/W State   H/W Type     Description
========================================================================
lan       0  0/0/0/3/0/0/0  iexgbe   CLAIMED     INTERFACE    HP  PCIe 2-p 10GbE Built-in
lan       1  0/0/0/3/0/0/1  iexgbe   CLAIMED     INTERFACE    HP  PCIe 2-p 10GbE Built-in
lan       2  0/0/0/4/0/0/0  iexgbe   CLAIMED     INTERFACE    HP  PCIe 2-p 10GbE Built-in
lan       3  0/0/0/4/0/0/1  iexgbe   CLAIMED     INTERFACE    HP  PCIe 2-p 10GbE Built-in

No VLAN interfaces are created on this system.

Give the vlanid:

sincronizar

Synchronize directories (using tar or rsync)

# sincronizar 
USAGE: /root/dev/hpuxtools/sincronizar -s local_dir -t target_dir
 -d: add the --delete flag to rsync
 -i: initial copy with tar
 -v: show version
 -h: show this help

createkctune

Creates a kctune script from the current kernel configuration.

# createkctune 
kctune NSTREVENT=50
kctune NSTRPUSH=16
kctune NSTRSCHED=0
kctune STRCTLSZ=1024
kctune STRMSGSZ=0
kctune acctresume=4
kctune acctsuspend=2
kctune aio_iosize_max=0
kctune aio_listio_max=256
kctune aio_max_ops=2048
kctune aio_monitor_run_sec=30
kctune aio_physmem_pct=10
kctune aio_prio_delta_max=20
kctune aio_proc_max=0
...

lpatch

Lists the current installed patches

# lpatch 
  PHCO_36032
  PHCO_36038
  PHCO_36075
  PHCO_36132
  PHCO_36254
  PHCO_36309
  PHCO_36447
  PHCO_36480
...

cgrep

List only the usefull lines (no comments) of a config file.

# cgrep /etc/cmcluster/cmclconf.ascii 
CLUSTER_NAME		mycluster
HOSTNAME_ADDRESS_FAMILY		IPV4
QS_HOST			quorum.hpux.ch
QS_POLLING_INTERVAL	300000000
NODE_NAME		node1
  NETWORK_INTERFACE	lan0
    STATIONARY_IP	172.16.19.127
...

fmail

Sends a file to a given e-mail address.

# fmail 
USAGE: fmail filename email

watch

A scripted watch implementation (known command in Linux world). Clears the screen and refreshed the given command every second.

# watch <command>

HP-UX Disk Administration

dadm

A disk administration utility.

# dadm
disk66  0x5000cca00b19d69c                  UNOPEN   136G 0x1000000c0000000   
disk67  0x5000cca00b18517c                  UNOPEN   136G 0x1010000c0000000   
disk68  0x600508b40006e63d0001200000660000  UNOPEN   100G 0x1        
disk69  0x600508b40006e63d00012000006c0000  UNOPEN   100G 0x2        
disk70  0x600508b40006e63d0001200000720000  UNOPEN   100G 0x3        
disk71  0x600508b40006e63d0001200000780000  UNOPEN   100G 0x4        
disk72  0x600508b40006e63d00012000007e0000  ONLINE   100G 0x5        
disk73  0x600508b40006e63d0001200000840000  ONLINE   100G 0x6        
disk74  0x600508b40006e63d0001200000510000  UNOPEN     1G 0x7        
disk75  0x600508b40006e63d0001200000a90000  ONLINE   200G 0x8      vg00 :ROOT 
disk76  0x600508b40006e63d0001200000ea0000  ONLINE    20G 0x9        
disk77  0x600508b40006e63d0001200000f00000  ONLINE    20G 0xa        
disk78  0x600508b40006e63d0001200000f60000  ONLINE    20G 0xb        
disk79  0x600508b40006e63d0001200000fc0000  ONLINE    20G 0xc        
disk80  0x600508b40006e63d0001200001020000  ONLINE    20G 0xd        
disk81  0x600508b40006e63d0001200001080000  UNOPEN    20G 0xe        
disk82  0x600508b40006e63d00012000010e0000  UNOPEN    20G 0xf        
disk83  0x600508b40006e63d0001200001140000  UNOPEN    20G 0x10

# dadm -?
USAGE: /root/dev/hpuxtools/dadm -d device
 -h: display hba details
 -p: show path information
 -D: show drd clone information
 -c: show information of cluster dsf
 -m: show cluster dsf mapping
 -e: show enclosure alias information
 -g: get_devid
 -a: shows the alias
 -x: cleanup stale devices
 -v: show version
 -?: show this help

Changelog

2011-04-20 Displays alias_path for lunpath

showlvmid

Shows the lvm id of a given disk.

# showlvmid /dev/rdisk/disk66_p2

/dev/rdisk/disk66_p2 PVID = 68548e1b4d218656
/dev/rdisk/disk66_p2 VGID = 68548e1b4d218657
PV Creation Date: Mon Jan  3 09:18:30 2011
VG Creation Date: Mon Jan  3 09:18:31 2011

CPUID:  	1750371867
PV:     	0000000
PVCUPID:	1750371867
VGCUPID:	1750371867

Changelog

2011-04-15 Added support for LVM Version 2.x

showlvmids

Shows the lvm ids of installed disks.

# showlvmids
### VERSION 1.x ###
 === VGs from /etc/lvmtab === 
VG              VGID
vg00            68548e1b4d491f3b
 === PVs from /dev/disk/* === 
Disk 		 PVID 			 VGID
disk66_p2: 	 68548e1b4d491f3b 	 68548e1b4d491f3b
disk67_p2: 	 68548e1b4ceb7ff5 	 68548e1b4ceb7ff6
disk68_p2: 	 c33d1d124d49674f 	 c33d1d124d49674f
disk69_p2: 	 1c13f06e4d4969e8 	 1c13f06e4d4969e8
disk70_p2: 	 65b6f3d04da70018 	 65b6f3d04da70019
disk71_p2: 	 31b39d864d9d7160 	 31b39d864d9d7160
disk72: 	 68548e1b4d2ec937 	 68548e1b4d2eca63
disk75: 	 68548e1b4da81db3 	 00
disk76: 	 c33d1d124d4a6adb 	 c33d1d124d4a6b17
disk77: 	 c33d1d124d4a6add 	 c33d1d124d4a6b17
disk78: 	 c33d1d124d4a6adf 	 c33d1d124d4a6b17
disk79: 	 c33d1d124d4a6adc 	 c33d1d124d4a6b17
disk80: 	 c33d1d124d4a6ade 	 c33d1d124d4a6b17
disk81: 	 c33d1d124d4a6ae2 	 c33d1d124d4a6b17
disk82: 	 c33d1d124d4a6ae0 	 c33d1d124d4a6b17
disk83: 	 c33d1d124d4a6ae1 	 c33d1d124d4a6b17


### VERSION 2.x ### 
 === VGs from /etc/lvmtab_p === 
VG              VGID
vgdave          A0000000000000003
 === PVs from /dev/disk/* === 
Disk            PVID 	 	 	 VGID
disk73:         A0000000000000006 	 A0000000000000003
disk74:         A0000000000000007 	 A0000000000000003

Changelog

2011-04-15 Added support for LVM Version 2.x

disksetdevid

Sets a global usable device id to a disk.

# disksetdevid 
USAGE: disksetdevid disk devid
Be carfull with setting devids. If you work with older storage systems (like EVA 4100) it could leed to controller reboots and other unexpected problems!

You can than see the devid by using the command:

# dadm -g

Get differences of two systems

patchdiff

  • hpuxtools has to be installed on each host

Diffs the installed patches of two systems.

# patchdiff 
USAGE: patchdiff other_host

kctdiff

Diffs the kernel parameters of two systems.

  • hpuxtools has to be installed on each host
# kctdiff 
USAGE: kctdiff other_host

HP Service Guard Cluster

cmv

A shortcut for cmviewcl including terminal colors for the output.

# cmv

"watch" the cmviewcl

# cmv -w

Changelog

2011-09-09 the status is shown in colors

synccl

Synchronizes a requiered set of files that must be the same on each SG cluster node.

# synccl 
Distribute pkg1 package directory...
Distribute pkg2 package directory...
Distribute *.ascii file...
Distribute pkglist file...
Distribute cmclnodelist file...
Distribute /etc/hosts file...
Distribute /etc/nsswitch.conf file...
Distribute /etc/services file...

Changelog

2011-04-27 Copy is now done with scp

vgex

Creates a map file of a vg and imports it on the other host.

# vgex
USAGE: vgex vg_name other_host_name [-i]
  -i: creates the /dev/vg../group on the other node

Changelog

2011-04-27 First version

vgsgmutlicreate

Creates a cluster wide shared volumegroup (version >=2.1) and configures the associated multi node cluster package.

# vgsgmutlicreate
USAGE: vgsgmutlicreate 
 -l: vgname (vgora)
 -d: disklist of cdsf disks ('disk2 disk3 disk4')
 -m: mountpoint (/oracle)
 -L: lvname (lvora)
 [-o]: vg_opts ('-V 2.2 -S 20g -s 32')
 [-O]: lv_opts ('-l 639')
 [-f]: force pvcreate
 [-n]: mount the new lvol on this server

Example:

# vgsgmutlicreate -l vgoraarch -d disk13 -m /oraarch -L lvoraarch

Changelog

2011-04-27 First version

Virtual Connect helper

vcnetmap

Displays the mapping information of the local lan interfaces to the virtual connect configured networks. Flex-10 is supported!

  • The Virtual Connect configuration has to be read, only if it has changed (it is cached localy)
# vcnetmap
lan0   0x0017A4772430 0/0/0/3/0/0/0  1 vNet1                1Gb OK    
lan1   0x0017A4772432 0/0/0/3/0/0/1  2 vNet2                1Gb OK    
lan2   0x0017A4772418 0/0/0/4/0/0/0  3 vNet3                1Gb OK    
lan3   0x0017A477241A 0/0/0/4/0/0/1  4 vNet4                1Gb OK

# vcnetmap -h
USAGE: /root/dev/hpuxtools/vcnetmap
 -r: refresh cached information
 -i vc_ip
 -u vc_user
 -a: show all
 -p: show port mapping
 -m: show mapped interface
 -l: show vlans
 -s column: sort output
 -n: show cach content w/o local mapping
 -t file: tar the cache to the given file
 -c: show cache
 -v: show version
 -h: show this help

Oracle helper

orasetenv

Changes the user to oracle owner and applies the the environment given by its SID.

  • X forwading will also be taken over to the new environment and lot more
# orasetenv -h
USAGE: /opt/hpuxtools/orasetenv
 -s sid|asm: set environment to sid
 -S string that could be greped in the ORACLE_HOME path
 -u: switch to oracle owner
 -U username: switch to user
 -h hostname: sets the ORACLE_HOSTNAME
 -c commandfile: execute a command file and exit
 -p adjust the profile of the oracle owner
 -k check the actual config

Current Environment is:
ORACLE_HOSTNAME=
ORACLE_SID=
ORACLE_HOME=
ORACLE_OWNER=

Available ORACLE_SIDs are:
ORCL  /oracle/product/11.2.0/dbhome_1
*     /oracle/agent11g

Sybase helper

sybprepare

  • prepares the system for installing sybase ASE
# sybprepare

sybsetenv

Changes the user to sybase user and applies the the environment.

  • X forwading will also be taken over to the new environment and lot more
sybsetenv --help
USAGE: sybsetenv
 -u username: switch to sybase user (defautl: sybase)
 -d DSQUERY: set DSQUERY to the given value
Current Environment is:
SYBASE=/opt/sybase

sybconfstartup

  • installs the startupscript /sbin/init.d/sybase
  • installs the sybase config file /etc/rc.config.d/sybase
  • opens the config file in the vi editor
# sybconfstartup
  • use -p to encrypt the password
  • use -n to overwrite the current version of the startupscript

Ported from tablespace.net

pong

pong is a utility that goes one step beyond ping by allowing you to check to see if a port is listening on an address. It issues a connect() call to that address / port pair and provides additional diagnostic information about the process.

Here is the help output from the command:

pong - A port-level ping utility.
       Version: 0.6.3
       Usage: pong -h | [ [ [-v][-v] | [-q] ] <address> <port> ] 
        -q   Be quiet.
        -v   Be verbose (stack v's for effect).
        -h   Show help screen.

TestPipe

Description:

TestPipe is a pair of bandwidth measuring binaries that are client (ssend) and server (srecv). They pipe data across a connection without reading or writing it to disk. Because the systems are not reading/writing to disk they are only bound by CPU and network bandwidth, and therefore represent a more accurate measurement of network performance.

TestPipe was designed and intended for measuring high bandwidth (TCP/IP) interconnects where filling bandwidth with a file as a source or destination tends to interfere with the measurement when the disk transfer speed is less than the interconnect.

Here is the help output from the commands:

$ ssend -h
ssend - A network stream writer used with srecv.
  Version: 0.11.0

  Usage: ssend [options] <address>

  Options:
   -d <size>  Set the packet send size to <size> bytes.
   -p <port>  Set the port number to <port>.
   -s <size>  Send a total of <size> Meg of data.
   -t <time>  Send data for <time> seconds.
$ srecv -h
srecv - A network stream reader used with ssend.
  Version: 0.11.0

  Usage: srecv [options] <address>

  Options:
   -p <port>  Set the port number to <port>.

webhead

Description:

webhead requests only the header from a web server using the HEAD (request) method. Instead of returning the content of a page, it returns only the meta-content from that page. (An example of this is given below).

The value of this utility is:

  • The ability to retrieve only the head response from a web server (useful for scripting/checking responses from the server without pulling the entire page).
  • Sample socket code for RFC2616.
  • Scripted HEAD requests for monitoring purposes can be easily removed from site statistics so that the site stats will not be skewed by monitoring tools.

Here is a sample run against this web site:

$ ./webhead www.tablespace.net/webhead/index.html
HTTP/1.1 200 OK
Date: Mon, 22 May 2006 15:17:38 GMT
Server: Apache/2.0.46 (Red Hat)
Last-Modified: Sun, 18 Dec 2005 01:45:33 GMT
ETag: "126c0d8-66b-97108940"
Accept-Ranges: bytes
Content-Length: 1643
Connection: close
Content-Type: text/html


Templates

CreateOraDb.sql

  • a template sql script to create an Oracle database

CreateOraDbCatalog.sql

  • a template sql script to create an Oracle database catalog

CreateOraEmRepository.sql

  • a template sql script to create an Oracle em repository

CreateOraTablspace.sql

  • a template sql script to create an Oracle tablespace

SetLocalListener.sql

  • a template sql script to set the Oracle listener

configSybForGC.sql

  • TODO

init.ora

  • a sample init.ora file

monitor.sh

  • a sample monitoing script to monitor a HPUX box

my_hpvmsg_move

  • TODO

oraget.sh

  • TODO

sybase.config.d

  • a template for a sybase config file

sybase.rc

  • a template for a sybase startupscript

sybmaint.conf

  • a template config file for Sybase maintenance tasks

sybmaint.sh

  • a template for a Sybase maintenance shell script

sybremotebck.conf

  • a template for a Sybase Remote Backup config file

sybremotebck.sh

  • a template for a Sybase Remote Backup shell script

useful.sql

  • a collection of usefull sql commands for Oracle
Views
Personal tools