Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Bootup/Shutdown
Configuration Menu
Information Menu
Service Menu
GSP Mode
shutdown -r 0
enter: <b><o>
shutdown -r 0
bo
mount -a
init 3
Startup/Shutdown Scripts
/sbin/init.d
/sbin/rc1.d
/sbin/rc2.d scripts with k are kill scripts and scripts with s are start scritps.
/sbin/rc3.d
/sbin/rc4.d
CIFS (Samba)
/opt/etc/samba/smb.conf
Device Management
HP-UX is a hardware path based operating system. When it boots up it does a hardware detection. It
then compares the hardware that it detects with the hardware that is listed in /etc/ioconfig. If new
hardware is detected, it is assigned the next available configuration information in the proper hardware
path.
insf -C disk -e <-- This command will re-install all of the device files for the class "disk"
ioscan <-- searches for all devices and displays their hardware path
ioscan -fnC disk <-- searches for all devices of class (C) disk
Disk Devices
scsictl -a /dev/rdsk/c?t?d? <-- display control parameter information about the disk device
scsictl -a -m queue_depth=4 -m queue_depth /dev/rdsk/c?t?d? <-- sets the queue depth
CD-ROM Devices
pfs_umount -c OR
nohup /usr/sbin/pfsd
Create LUN
ls -l /dev/fc*
fcmsutil /dev/<device>
fcmsutil /dev/fcms2 stat --> fcmsutil that shows status of fibre channel adapter
Logs
Login Environment
/etc/profile.env
export TMPDIR=/tmpsort
export TEMPDIR=/tmpsort
Changing prompt:
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
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
set_parms ip_address
Then supply ip address and subnet mask when prompted. This process will require a reboot.
cd rc.config.d
vi netconf
ntpq -p --> lists ntp peers and their time sync status
ntpq -p <server fqdn or ip address> --> 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
PrintingCommand Description
lpadmin
lpsched -v
pr -o10 -l64 -F -h <HEADER> <file> | 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:
SAM --> Printers & Plotters --> LP Spooler --> Save/Restore Spooler Configuration
SAM --> Printers & Plotters --> LP Spooler --> Save/Restor Spooler Configuration
Performance Monitoring
top
sar -q
sar -u
sar -d
vmstat
vminfo
Process Management
Command Description
ps -ef | grep PROD list all processes, but only show those processes that have "PROD" in them
/sbin/init.d/<script> [start|stop] If the script exists, this will stop and start the associated
processes.
/var/adm/inetd.sec --> This file contains security information on who may request a particular process
Remote Access
remsh <host>
rlogin <host>
.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
swinstall -x <option> -x <option> -s <path to depot> --> This will still lauch the gui, but the parameters
will be preselected. This is use to allow selection of additional parameters that may not be selectable
from the gui itself (such as the logging levels below)
-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
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
done
System Information
Note: See section on STM, detailed system information is available with this utility
OS Information
uname -a - display general information e.g. OS release, node name, machine ID number, etc
/opt/itor/bin/i4target -v spu
Memory Information
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
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
Using set_parms --> may not work correctly for multiple nics
It will prompt you to reboot (answer no if you are also changing the ip address)
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
/etc/resolv.conf
/etc/nsswitch.conf
System Tuning
cd /stand/build
/usr/lbin/sysadm/system_prep -s /stand/build/system
Manual Kernel Build (not using sam) --> /usr/sbin/mk_kernel -s /stand /build/system
STM
diaglogd
/var/opt/resmon/log
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
To print either select Print or SaveAs (to save the log to file for later printing)
>view
>done
>"lcstm>info
#cat info
print_manifest (located in /var/opt/ignite/local/manifest/manifestinfo ??)
cstm
cstm>Map
cstm>SelAll
cstm>Information
cstm>Infolog
cstm>exit
cstm
cstm>info;wait
cstm>il
cstm>create /tmp/disk.stm
cstm>done
cstm>quit
cstm>ok
cstm -f /tmp/disk.stm
Terminal Environment
termio
/usr/share/lib/terminfo
$DISPLAY=192.168.70.80:0.0
$TERM = xterm
stty
stty -all
Terminal Ports
Port 1
Datacommunications
25 Pin - use this to connect to the N class server with a 25 pin to 9 pin cable
Parallel
25 Pin
Port 3
Datacommunications
9 Pin - use this port to connect to the A class server with a 9 pin to 25 pin cable
modes
config keys
datacomm config
parity: none/8
xon/xoff
terminal config
Term ID - vt100
ansi config
em100
backspace/del
Users Administration
Creating Users
Creating Groups
groupadd Groupname
find <path> -name <name> -print Finds a file in the OS at the starting path on down
grep
pr -o10 -l64 -F -h <HEADER> <file> | lp prints using margins of 10, page length of 64, header on each
page
sar
set_parms Change host name (/etc/set_parms)
tail -f <file> Looks at end of file and keeps it open to watch changes
Interupt the boot process during the 10 second interval (display will indicate this on the screen)
bo pri
cd /sbin
Oracle Procedures:
I have a need to remove some semaphores and a memory segment from a sun box to clean up a failed
Oracle instance. The server has several Oracle Instances and allocated memory segments and I need to
identify the proper one to 'ipcrm -m' on.....Does anyone know how I get more detail as to the owner of
the segments?
Thanks,
Thomas
Unfortunately I was using that syntax to begin with and only gets me limited data, however by ipcs -pmb
and ipcs -sa I was able to identify all oracle semaphore id's and memory segment id's. Then by
connecting to the surviving instances, doing a dump of that instance memory and semaphore maps, I
was able to determine which id's not to remove from memory, thus enabling me to clean up the failing
instance memory.
Thanks,
Thomas