HP-UX Overview and Command Summary - page 9

HP-UX Overview and Command Summary - page 9

March 07, 2011

Changing the Server Name and the IP Address
  • Using set_parms  --> may not work correctly for multiple nics
    • set_parms hostname  ( a reboot is required for the change to take effect)
      • It will prompt you for the new hostname
      • It will prompt you to reboot (answer no if you are also changing the ip address)
    • set_parms ip_address   ( a reboot is required for the change to take effect)
      • It will prompt you for the new ip address
      • It will prompt you to reboot
  • Manually makiing the change:
    • vi /etc/hosts
    • vi /etc/rc.config.d/netconf   <-- ** Make sure that no extra files are in the /etc/rc.config.d directory - it gets sourced on bootup
    • reboot
  • Other files that may need to checked/changed
    • /etc/resolv.conf
    • /etc/nsswitch.conf

System Tuning
Extract Current System File
  • cd /stand/build
  • /usr/lbin/sysadm/system_prep -s /stand/build/system
    • file is called system
    • section called "Tunable Parameters"

kmtune - displays the tunable parameters
kmtune -l  <-- This displays a detailed report of the parameters (current, planned, default, minimum, etc)
sam allows you to tune the kernel
Manual Kernel Build (not using sam)  -->  /usr/sbin/mk_kernel -s /stand /build/system
STM
diaglogd

/var/opt/resmon/log

Procedure to use STM to determine memory configuration
  • Type stm at the command line
  • Type o to select ok
  • Press the down arrow in the displayed map and select memory by hitting the space bar
  • Press tab to go to menus and arrow over to Tools and hit enter
  • Select Information -> and hit enter
  • Select Information Log and hit enter
  • Information Tool Log for Memory will be displayed
  • To print either select Print or SaveAs (to save the log to file for later printing)

Page 10
Page 8


Find HP-UX Overview and Command Summary All pages 
Page 12    |||    Page 11    |||   Page 10   |||   Page 9   |||
Page 8      |||    Page 7      |||   Page 6     |||   Page 5   |||
Page 4      |||    Page 3      |||   Page 2     |||    Page 1  |||
HP-UX Overview and Command Summary - page 8

HP-UX Overview and Command Summary - page 8

March 07, 2011

System Information
Note:  See section on STM, detailed system information is available with this utility
           Also SAM -->Performance Monitors --> System Properties

OS Information

uname -a - display general information e.g. OS release, node name, machine ID number, etc 

print $(uname -i)16op|dc  hex system id
/opt/itor/bin/i4target -v     spu

file /stand/vmunix   <-- shows whether 64 bit or 32 bit kernel
getconf KERNEL_BITS  <--shows whether 64 bit or 32 bit kernel

Memory Information
dmesg|grep Phy  <-- List amount of physical ram in server
cat syslog|grep Phy <-- List amount of physical ram in server
echo phys_mem_pages/D|adb -k /stand/vmunix /dev/kmem   <-- Lists amount of  4K Memory pages in HPUX 11.x
echo "memory_installed_in_machine/D" | adb -k /stand/vmunix /dev/mem |tail -1 | awk '$2 > 0 { print $2 / 256 }'  <--  Lists memory in MB.
echo "physmem/D" | adb /stand/vmunix /dev/kmem  <-- Lists amount of 4K Memory pages in HPUX 10.x

model   <-- information about the model of the workstation/server

sam --> Performance Monitors --> System Properties  --> Memory Tab

CPU Information

ioscan -fnC processor   <-- shows information about each processor found

echo "itick_per_usec/D" | adb -k /stand/vmunix /dev/mem | tail -1  <-- Shows CPU Speed in MHZ

sam --> Performance Monitors --> System Properties  -->Processor Tab

echo itick_per_tick/D | adb /stand/vmunix /dev/kmem - gives processor speed 

grep model /usr/lib/sched.models - gives type of processor for 10.X systems 

grep model /opt/langtools/lib/sched.models - gives processor type for 11.X systems 



Page 9
Page 7



Find 
HP-UX Overview and Command Summary All pages 
Page 12    |||    Page 11    |||   Page 10   |||   Page 9   |||
Page 8      |||    Page 7      |||   Page 6     |||   Page 5   |||
Page 4      |||    Page 3      |||   Page 2     |||    Page 1  |||


HP-UX Overview and Command Summary - page 7

HP-UX Overview and Command Summary - page 7

March 07, 2011

Listing all Software

swlist -l product | more

Checking for Specific Software

swlist -l product | grep

Checking for Specific Patches

swlist -l product| grep PH | more

then search for a specific patch (ie PHNE_XXXXX)

Manually applying patches

Patches can be applied using swinstall, just as depots are installed
  • swlist -l patch -a patch_state PHKL_25475
swcopy -s /tmp/*.depot -\*@/var/spool/sw

Cleaning up after applying patches:

cleanup
cleanup -c n  <--  commits patches that have been superseded n number of times.  Useful to free up disk space in /var/adm/sw/save.
cleanup -p  <-- previews the actual cleanup tasks but does not actually perform the cleanup

check_patches
show_patches

Creating a single patch depot out of multiple individual depots:

From the directory that has all of the individual depots run this command line script:
for i in PH*.depot
do
        swcopy -x enforce_dependencies=false -s ${PWD}/$i \* @ /tmp/patch_depot         <-- /tmp/patch_depot is the destination directory
done

Page 8
Page 6



Find 
HP-UX Overview and Command Summary All pages 
Page 12    |||    Page 11    |||   Page 10   |||   Page 9   |||
Page 8      |||    Page 7      |||   Page 6     |||   Page 5   |||
Page 4      |||    Page 3      |||   Page 2     |||    Page 1  |||


HP-UX Overview and Command Summary - page 6

HP-UX Overview and Command Summary - page 6

March 07, 2011

Remote Access
rcp remote_machine:

remsh

rlogin

.rhosts file needs to be configured or else you will be prompted for username and password (located in home directory)

last -R  - gives address information of last remote login, useful for troubleshooting
Software Installation and Management
To install patches and software use:

swinstall  -->  This will lauch the gui or 
swinstall -x

For example some popular options are:
  • -x mount_all_filesystems=false
  • -x logdetail=true
  • -x loglevel=2
Note:  
  • To install a depot you must specify the complete path to the depot and the depot name.
  • To install patches you must specify the complete path to the directory that has the patch files.

Location of  logfiles:
/var/adm/sw/swagent.log
/var/adm/sw/swinstall.log



Page 7
Page 5


Find HP-UX Overview and Command Summary All pages 
Page 12    |||    Page 11    |||   Page 10   |||   Page 9   |||
Page 8      |||    Page 7      |||   Page 6     |||   Page 5   |||
Page 4      |||    Page 3      |||   Page 2     |||    Page 1  |||


HP-UX Overview and Command Summary - page 5

HP-UX Overview and Command Summary - page 5

March 07, 2011


Printing

Command
Description
cancel
deletes print jobs from queue
hppi
jet admin
ls -d -o file
prints a file
lpadmin
lpsched -v
lpstat
lists jobs in queue. -s  -t
pr .profile | lp -n3
prints
pr -o10 -l64 -F -h

| lp
prints using margins of 10, page length of 64, header on each page

/etc/lp

/usr/lib/lp
/var/adm/lp
/var/spool/lp

/etc/lp/interface - interface scripts

/var/sam/lp/lpinfo

Migrating the printer configuration from one server to another server using SAM:

On the source server:
  • SAM  --> Printers & Plotters --> LP Spooler --> Save/Restore Spooler Configuration
  • Actions --> Save Spooler Configuration
    • This saves the information in the directory /var/sam/lp
  • Save this directory using tar:  "tar -cvf /tmp/lp.tar /var/sam/lp"
  • Copy this tar file to the destination server
On the destination server:
  • Extract this file:  "tar -xvf lp.tar"
  • SAM --> Printers & Plotters --> LP Spooler --> Save/Restor Spooler Configuration
  • Actions --> Restore Spooler Configuration

Performance Monitoring
top
     j  moves forward pages in the display
     k moves backwared pages in the display
glance (if installed)

sar -q 
sar -u 
sar -d 

vmstat

vminfo
Process Management

Command
Description
inetd -c
Causes inet to reload /etc/inetd.conf
inetd -l
starts logging in /var/adm/syslog/syslog.log
ps -ef | grep PROD
list all processes, but only show those processes that have "PROD" in them
/sbin/init.d/


Find HP-UX Overview and Command Summary All pages 
Page 12    |||    Page 11   |||   Page 10   |||   Page 9   |||
Page 8      |||    Page 7      |||   Page 6     |||   Page 5   |||
Page 4      |||    Page 3     |||   Page 2      |||    Page 1  |||
HP-UX Overview and Command Summary - page 4

HP-UX Overview and Command Summary - page 4

March 07, 2011

Login Environment
/etc/profile - main profile for all users

/etc/profile.env

export TMPDIR=/tmpsort
export TEMPDIR=/tmpsort

source a profile:    ". ./profile"

Changing prompt:

export PS1=$(hostname):'$PWD # '

This gives a prompt that has the hostname followed by the current directory, ending in the # (useful for root logins).
Networking
netstat -a   <--ports
netstat -i  <--interfaces
netstat -r  <--routing table
netstat -rv  <--routing table and subnet mask

lanscan - provides hardware information about the nics in the server
lanadmin - menu driven interface to administer lan nics
lanadmin -x 0  bypass menu and show lan driver specific options for nic with id 0
lanadmin -X 100FD 0  - bypass menu and set nic at id 0 to 100 MBS, Full Duplex

ioscan -fnkC lan   - shows ioscan information for device type "lan"

lanscan -i|awk '{print $1}'|xargs -i ifconfig {}   -> does an ifconfig on all defined interfaces on that server

Changing the IP Address and Subnet mask:
  • set_parms ip_address
  • Then supply ip address and subnet mask when prompted.  This process will require a reboot.
Changing the Default Gateway



Command
Description
cancel
deletes print jobs from queue
hppi
jet admin
ls -d -o file
prints a file
lpadmin
lpsched -v
lpstat
lists jobs in queue. -s  -t
pr .profile | lp -n3
prints
pr -o10 -l64 -F -h



| lp
prints using margins of 10, page length of 64, header on each page
  • cd rc.config.d
  • vi netconf
Network Time Protocol (NTP)
ntpq -p   --> lists ntp peers and their time sync status
ntpq -p   --> lists time sync status with that server (slightly different detail than ntpq -p)

/etc/ntp.conf  --> configuration file
Changes to the configuration require ntp daemon (xntpd) be stopped and restarted (restart is not recognized):
  • /sbin/init.d/xntpd stop
  • /sbin/init.d/xntpd start
Page 3



Find HP-UX Overview and Command Summary All pages 
Page 12    |||    Page 11   |||   Page 10   |||   Page 9   |||
Page 8      |||    Page 7      |||   Page 6     |||   Page 5   |||
Page 4      |||    Page 3     |||   Page 2      |||    Page 1  |||