Tuesday, October 9, 2012

HP-UX commands


 Hello ,

 It was gr8 experience for me to use HP-UX box , not upto expert level , but at certain comfort !
 While working with HP-UX , I decided to create one small draft of common commands used
 
 Below are Common HP-UX commands with their appropriate output 


HP-UX :
=======

Complete command or filename --> type few characters and press ESC key 2 times

List multiple files starting with "T" -->  type "p" then "ESC" then "="

# cd p

1) pids/
2) probes/


Rexecute command numbers 562 :
==============================

561     cd ..
562     ls
563     hios

[root@fwa-integ02] [/opt/nimbus]
# r 562
ls
bin       niscache  pids      probes    robot     tmp
[root@fwa-integ02] [/opt/nimbus]



Execute Last Command --> ESC + k



To display current baud rate, start/stop bits, parity, flow control, and other information 
==========================================================================================

# stty -a
speed 38400 baud; line = 0;
rows = 24; columns = 80
min = 4; time = 0;
intr = ^C; quit = ^\; erase = ^H; kill = ^U
eof = ^D; eol = ^@; eol2 ; swtch
stop = ^S; start = ^Q; susp ; dsusp
werase ; lnext
-parenb -parodd cs8 -cstopb hupcl cread -clocal -loblk -crts
-ignbrk brkint -ignpar -parmrk -inpck istrip -inlcr -igncr icrnl -iuclc
ixon ixany ixoff -imaxbel -rtsxoff -ctsxon -ienqak
isig icanon -iexten -xcase echo echoe echok -echonl -noflsh
-echoctl -echoprt -echoke -flusho -pendin
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel -tostop tab3
[root@fwa-integ02] [/opt/nimbus/bin]



Software removal process logged into /var/adm/sw/swremove.log



Find and remove unused softwares :
==================================

freedisk 


swremove 


Verifying Installed software :
==============================

swremove 

log of the command is recorded in /var/adm/sw/swverify.log



What is Software Depot :
========================

Software depots are places where filesets, products, and bundles are stored. A software depot may a directory on your disk, a CD-ROM, or a tape (DDS, DAT) used for 

distributing software

By default, the software depot directory is /var/spool/sw

(Its like Repository in RHEL , we can add , remove list packages from it.)


HP-UX Patches
==============

Patch Sources
Patches can be obtained using your Web browser through WWW or FTP. The WWW site address is:

http://ITResourceCenter.hp.com

The FTP site address is:

ftp://us-ffs.external.hp.com/hp-ux_patches

You can also order a patch CD-ROM from Hewlett-Packard to obtain a collection of all patches.


CUSTOM PATCH MANAGER
--------------------

This tool is available on the Hewlett-Packard Web site. It can be used to take inventory of existing software installed on your system and suggest needed patches. To 

use the custom patch manager, your system needs to be connected to the Internet and you must have a Personalized System Support Agreement with Hewlett-Packard.


Command patches   : CO
Kernel patches    : KL
Network patches   : NE
Subsystem patches : SS

Some example patch names are:
-----------------------------

PHSS_16473

PHSS_14158

PHCO_15623

PHKL_16189

Usually you need to reboot the system after installing a kernel patch



Check HP-UX Version :
======================

# uname -a
HP-UX fwa-inte B.11.23 U ia64 2745059608 unlimited-user license
[root@fwa-integ02] [/var/spool]
# uname -r
B.11.23


List Installed Patches :
=========================

swlist -l patch


HP-UX Patch Installing :
========================

Obtaining Patches
HP-UX patches are distributed as shar files. When you download a patch from the Hewlett-Packard FTP or Web site, use the sh command to unshar it. For example, to 

download the patch, PHCO_15220


ftp> get PHCO_15220
200 PORT command successful.
150 Opening BINARY mode data connection for PHCO_15220 (46784 bytes).
226 Transfer complete.
46784 bytes received in 1.04 seconds (44.02 Kbytes/s)

Step 1:
-------

After downloading, use the following command to unshar the patch.

$ sh PHCO_15220
x - PHCO_15220.text
x - PHCO_15220.depot [compressed]
$

Step 2:
-------

To add the patch to the /var/spool/sw depot, use this command.

swcopy -s PHCO_15220.depot PHCO_15220 @ /var/spool/sw



Step 3:
-------

swinstall -s /var/spool/sw



Important HP-UX commands :
===========================

swinstall  Install software  
swremove  Remove installed software; also remove software from a depot  
swlist  List installed software or software in a depot  
swcopy  Copy software components to a software depot  
swpackage  Package software in a depot  
swreg  Make a software depot visible to other systems on the network  
swverify  Verify integrity of installed software  
swagentd  SD-UX daemon  
swagent  SD-UX agent  
swacl  Control access to software  
swconfig  Configure installed software  


Default Kernel Configuration 


Find Server Model HP-UX :
==========================

# model
ia64 hp server BL860c



File system Utilization Monitoring :
=====================================

# bdf
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/lvol3    1081344  296176  779104   28% /
/dev/vg00/lvol1    1835008  196192 1626112   11% /stand
/dev/vg00/lvol8    8912896 4506360 4372760   51% /var
/dev/vg00/lvol7    8454144 3328056 5086088   40% /usr
/dev/vg16/lvol01   312999936 289737520 21808526   93% /u16
/dev/vg15/u15      314179584 283827012 28455571   91% /u15
/dev/vg14/u14      314179584 288006701 24537156   92% /u14
/dev/vg13/u13      156893184 136963119 18684583   88% /u13
/dev/vg12/u12      156893184 132970698 22427429   86% /u12
/dev/vg11/u11      156893184 142032054 13932411   91% /u11
/dev/vg10/u10      156893184 133122858 22284868   86% /u10
/dev/vg09/u09      156893184 110786172 43225383   72% /u09
/dev/vg08/u08      156893184 81202860 70959740   53% /u08
/dev/vg07/u07      156893184 133755749 21691380   86% /u07
/dev/vg06/u06      156893184 129073047 26081532   83% /u06
/dev/vg05/u05      156893184 114496003 39747382   74% /u05
/dev/vg04/u04      156893184 136765202 18870135   88% /u04
/dev/vg03/u03      104595456 79934663 23119538   78% /u03
/dev/vg02/u02      104595456 89832217 13840545   87% /u02
/dev/vg01/u01      52297728 32247437 18808615   63% /u01
/dev/vg00/lvol4    2097152  140024 1942056    7% /tmp
/dev/vg00/lvol6    11239424 5844128 5353184   52% /opt
/dev/vg00/lvol5    2097152   18488 2065672    1% /home
/dev/vg00/lvol10    131072    1153  121806    1% /appl
[root@fwa-integ02] [/dev]




The timex command is used to report process and system activity. This command can be used to calculate the time used by a command or set of commands. For example, to 

check user and system time used during the execution of the ll /etc command, use the following command.

timex ll /etc

Display Swap Info :
===================

# swapinfo
             Kb      Kb      Kb   PCT  START/      Kb
TYPE      AVAIL    USED    FREE  USED   LIMIT RESERVE  PRI  NAME
dev     8388608       0 8386560    0%       0       -    1  /dev/vg00/lvol2
dev     41943040       0 41932800    0%       0       -    1  /dev/vg00/lvol9
reserve       - 12152220 -12152220
memory  33523432 5185588 28337844   15%



Command to check MAC Address :
===============================

# lanscan
Hardware Station        Crd Hdw   Net-Interface  NM  MAC       HP-DLPI DLPI
Path     Address        In# State NamePPA        ID  Type      Support Mjr#
0/2/2/0  0x002655F377E4 2   UP    lan2 snap2     1   ETHER     Yes     119
0/1/1/0  0x002655F377FE 0   UP    lan0 snap0     2   ETHER     Yes     119
0/1/1/1  0x002655F377FF 1   UP    lan1 snap1     3   ETHER     Yes     119
0/2/2/1  0x002655F377E5 3   UP    lan3 snap3     4   ETHER     Yes     119

Netstat with In/out packets :
============================

#  netstat -in
Name      Mtu  Network         Address         Ipkts   Ierrs Opkts   Oerrs Coll
lan0      1500 10.0.24.0       10.0.24.19     328560185 0     587394030 0     0
lo0       4136 127.0.0.0       127.0.0.1       2602919 0     2602921 0     0


Hope this article will be helpful for you guys.

Best Regards,
Girish

No comments:

Post a Comment