下面是偶在网上找到的HP-UX系统管理员常用的命令集和参数,已经分了类,大家可以参考一下,后面的注释不是E文,不过应该猜的懂。
Boot-ROM
[ESC] # bricht Boot-Vorgang ab
search [ISL] # listet alle m&glichen Boot-Devices (mit ISL) auf
path [pri|alt|<#>|
help
ISL
hpux /stand/vmunix # bootet normal mit Kernel /stand/vmunix (default)
hpux -is # bootet im Single-User-Modus
hpux -lq # bootet ohne LVM-Quorum
hpux -lm # bootet im LVM Maintenance Mode (falls Boot-Disk korrupt)
hpux show autofile # zeigt Inhalt des LIF AUTO Files
hpux set autofile "hpux -lq" # &ndert Inhalt des LIF AUTO Files
hpux ls -l # listet Inhalt von /stand
# mkboot
# lifls
# licp
System Startup
/sbin/rc
/sbin/init.d/
/etc/rc.config.d/
CDE-Login (Default im Run-Level 3)
/etc/dt/config/Xstartup (ggf. kopieren aus /usr/dt/config/Xstartup) # CDE-Login-Script
/etc/profile
~/.dtprofile # pers&nliches CDE-Login-Script
falls DTSOURCEFILE=true -> ~/.profile # pers&nliches Login-Script
falls ENV=~/.shrc; export ENV -> ~/.shrc # pers&nliches Shell-Startup-Script
mit:
HISTFILE=~/.sh_history
HISTSIZE=500
PS1="$(hostname):"'$PWD# '
Terminal-Login (via lokaler Konsole, telnet oder remsh)
/etc/profile
~/.profile # pers&nliches Login-Script
falls ENV=~/.shrc; export ENV -> ~/.shrc # pers&nliches Shell-Startup-Script
mit:
HISTFILE=~/.sh_history
HISTSIZE=500
PS1="$(hostname):"'$PWD# '
SAM
sam [-r] # (Restricted SAM Builder for administrating users)
Remote Administration
xhost +
telnet
export
sam
User Accounts
sam
useradd [-m]
usermod ... # Ändern eines User Accounts
userdel ...
Editor=vi; vipw # mit Write-Lock auf /etc/passwd
pwck # /etc/passwd
Trusted System
Verbesserte Passwort-Vorgaben und -Alterungen, Benutzer- und Terminal-Überwachung
sam -> Auditing and Security -> System Security Policies # Einrichten aber nur bei Bedarf!
sam -> Auditing and Security -> Audited Users -> Actions -> Unconvert ... # Aufheben
Configuring Peripherals
ioscan [-f] [-C disk|ext_bus|lan|tape] [-u] [-n] # I/O-System-Informationen
model # Hardware Modell-Informationen
lanscan # LAN Device-Konfiguration
Device Files
lsdev [-C class] # Device-Treiber-spezifische Informationen
lssf
insf [-e] # ggf. erst nach ioscan
mksf
mknod
Logical Volume Manager
pvcreate [-f] [-B]
mkdir /dev/
mknod /dev/
vgcreate [-e
lvcreate [-L
lvextend # zur gezielten Zuweisung von LV -> Disks
pvdisplay [-v]
vgdisplay [-v]
lvdisplay [-v] /dev/
Veritas Volume Manager
vxinstall
vmsa_server &
vmsa &
File Systeme
newfs -F hfs [-s
newfs -F vxfs [-s
mkdir
mount
mount [-v] [-p] # mit /etc/fstab-kompatibler Ausgabe
Swap
/etc/dmesg # Aufteilung des physischen Speichers (RAM)
swapon [-e]
swapon [-p
# dauerhaft in /etc/fstab eintragen
swapinfo -tm
LVM (Advanced)
bdf [-i] # Disk-Auslastungsübersicht
du -k # Bsp.: du -k / | sort -n > /tmp/du.sort
sam -> Routine Tasks -> ...
pvcreate [-f] /dev/rdsk/
vgextend
lvextend -L
umount
oder
fsadm -F vxfs -b
tar -c
oder
fsadm -F vxfs -de
lvreduce -L
umount
pvmove /dev/dsk/
vgreduce
oder
vgchange -a n
Mirror
lvextend -m <1|2> /dev/
lvreduce -m <0|1> /dev/
Datensicherung mit minimaler Downtime:
lvsplit /dev/
fsck -F hfs /dev/
mkdir
mount -o ro /dev/
# jetzt
umount
lvmerge /dev/
Backup / Disaster Recovery
fbackup -f
fbackup -f
frecover -f
frecover -f
frecover -f
frecover -f
fsck -F
Recherche-Tipps: ll /
vgcfgbackup
vgcfgrecover -n
make_recovery [-ACi] # create a system recovery tape (component of Ignite-UX)
check_recovery # check currency of most recent recovery tape
make_medialif
print_manifest # output complete system configuration
Networking-Konfiguration
/etc/rc.config.d/netconf # Network Configuration File
/sbin/init.d/net start # Aktivieren der Eintr&ge im Network Configuration File
ifconfig lan<#> inet [
ifconfig lan<#1>:<#2> inet [
route add | delete default | net
netstat -rn # Routing-Tabellen-Informationen
Networking-Troubleshooting
ioscan -funC lan # LAN-I/F-Status
lanscan # LAN-I/F-Informationen auf Layer 1-2
lanadmin # LAN-I/F-Administration auf Layer 2-4
linkloop [-i
arp [-a] [
ping
netstat -i[n] # Information über Konfiguration der lokalen LAN-I/F
nslookup
nsquery hosts
/usr/contrib/bin/traceroute
Domain Name Services (DNS)
# at least 2 name servers in every domain: with master server, slave server(, cache-only server), resolver (DNS) clients
# Master Server (also to be configured as DNS client):
vi /etc/hosts # enter full qualified hostnames, i.e. extend hostnames by domain name
mkdir /etc/named.data; cd /etc/named.data
hosts_to_named -d
ftp://ftp.rs.internic.net/domain/root.zone -> get [/etc/named.data/]db.cache # get root level name servers
vi /etc/rc.config/namesvrs -> NAMED=1
/sbin/init.d/named start
# Slave Server (also to be configured as DNS client):
mkdir /etc/named.data; cd /etc/named.data; chmod 755 .
ftp
ftp
vi /etc/rc.config/namesvrs -> NAMED=1
/sbin/init.d/named start
# Resolver (DNS) Clients
vi /etc/resolv.conf -> "search
vi /etc/nsswitch.conf -> "hosts: dns nis files" # configure search order
vi /etc/hosts # keep only "127.0.0.1 localhost\n
vi ~/.rhosts /etc/hosts.equiv /var/adm/inetd.sec # extend by full qualified hostname
nsquery hosts
HP-UX Network Services
#inetd (telnet, ftp, remsh, rlogin, rcp, bootp, tftp)
ftp -d
ftp> passive # Wechseln in den Passive Mode, d.h. auch die Data Port Connection wird vom Client initiiert
vi /etc/rc.config.d/netdaemons
/sbin/init.d/inetd start
vi /etc/inetd.conf
vi /etc/services
vi /var/adm/inetd.sec /etc/hosts.equiv ~/.rhosts # falls erforderlich
# Network File System (NFS)
# NFS-Server
vi /etc/rc.config.d/nfsconf
/sbin/init.d/nfs.server start
vi /etc/exports # zu exportierende FS spezifizieren
showmount -e; exportfs(; rpcinfo -p; nfsstat) # testing NFS
# NFS-Client
vi /etc/rc.config.d/nfsconf
/sbin/init.d/nfs.client start
mount
vi /etc/fstab
showmount -e svr; rpcinfo -p [svr] # testing NFS
# Network Time Protocol (NTP)
vi /etc/rc.netconfig.d/netdaemons
vi /etc/ntp.conf # nur NTP-Server: define pseudo-ip address(, peer ip address(es))(, broadcast ip address)
vi /etc/ntp.conf # nurNTP-Client: define server ip address(es)(, driftfile location)(, broadcastclient yes)
/sbin/init.d/xntpd start
ntpq -p # testing NTP
Kernel-Konfiguration
sam
cd /stand # ggf.
for file in vmunix dlkm system; do; cp ${file} ${file}.prev; cp ${file}_test (resp. dlkm.vmunix_test und system.sam) $file; done # ggf.
Software-Installation (SD-UX)
# Software depot -> Bundle -> Product -> Subproduct -> Filesets -> Files and Control scripts
swlist -l
swinstall [-s
swremove # starts graphical user interface (GUI) for interactive removal
/sbin/init.d/swagentd start # nur auf SD-UX servern
swreg; swcopy; swremove # Depot-Verwaltung auf SD-UX-Servern
swverify; swconfig; swmodify # Software-Verwaltung auf SD-UX-Clients
Patch-Installation (SD-UX)
# Namenskonventionen: PH
# mit: CO...allg. HP-UX-Kommandos, KL...Kernel Patches, NE...Netzwerk-spezifisches, SS...sonstiges
# http://europe-support.external.hp.com ... Zugriff auf HP IT Resource Center Patch Database
# http://software.hp.com -> Enhancement Releases ... Zugriff auf (required) Patch Bundles
# weitere Patch-Quellen: HP-IT Resource Center Custom Patch Manager (CPM), HP Support Plus CD-ROM, HP Response Center Patch Tapes
# Komplette Datensicherung
# Patch laden nach /tmp # nur bei Patch-Installation vom Web
cd /tmp; sh PH
mkdir
ls
swinstall -s /tmp/PH
swremove PH
swlist -l patch; swlist -l product 'PH*' # listen bereits installierter Patches
Betriebssystem-Installation mit Ignite-UX
# HP-UX 11.11 Operating Environments (s.a. http://docs.hp.com -> HP-UX11i Operating Environments (* 2!)):
# Base Operating System (BOS: Core Kernel, I/O Subsystems, Memory Mgmt Subsystem, LVM, etc.)
# Technical Computing Operating Environment (TCOE: BOS + 3D Graphics Libs, MLIB Math Lib, etc.)
# Internet Operating Environment (IOE: BOS + Apache Webserver, CIFS File Server, Ignite/UX, SW Distributor/UX, Perl, etc.)
# Enterprise Operating Environment (EOE: IOE + MirrorDisk/UX, Online JFS, GlancePlus, PRM Performance Tools, etc.)
# Mission Critical Operating Environment (MCOE: EOE + MC/ServiceGuard, HP-UX Workload Mgr, Enterprise Cluster Mgmt Toolkit, etc.)
# Planung:
# HW-Pfad der Boot Disk? HW-Pfad der CD-ROM? IP-Adresse und Hostname? LVM? JFS? Disk Space/FS? Swap Space? Zu installierende SW?
# Booten von Installationsmedium:
> search ipl; > boot p
> search lan install; > boot lan.
set_parms initial # initiale Systemkonfiguration, wiederholbar
dd if=/dev/rdsk/
Performance-Tools
# Tool-Typen: Real Time Monitoring, Data Collection Performance, Performance Administration, Network Monitoring
# Real Time Monitoring Tools
# Unix allgemein:
sar [-ud]
top [-s
vmstat [-nS] [
iostat [
time
uptime [-lsuw] [user] # aktuelle System-Infos, -l ... long listing, -s ... short listing, -u ... keine User-Infos, -w ... nur Benutzer-Infos
# HP-UX-spezifisch:
glance [-j
gpm
# Data Collection Performance Tools
# Unix allgemein:
# acct-Tools-Suite: acctdisk, acctdusg, accton, acctwtmp, closewtmp, utmp2wtmp # System Accounting
sar
# HP-UX-spezifisch:
MeasureWare # optionales Produkt
PerfView # optionales Produkt
# Performance Administration Tools
# Unix allgemein:
ipcs [-mqs] # Interprocess Communication Statistics, -m ... Shared Memory Segmente, -q ... Message Queues, -s ... Semaphoren
ipcrm [...] # L&schen von Interprocess Communication Facilities
nice [-n
renice [-n
# HP-UX-spezifisch:
rtprio
serialize |
# Process Ressource Manager (PRM) # Feste Resourcen-Zuteilung für hochperformante Prozesse
# Network Monitoring Tools
# Unix allgemein:
netstat [-inr] [...] # allgemeine Netzwerkstatistik
nfsstat [...] # Network File System (NFS) Statistik
ping [-ov] [-i
# HP-UX-spezifisch:
ndd [-get | -set] # Netzwerk-Parameter-Tuning
nettune # Netzwerk-Parameter-Tuning
# NetMetrics
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/