歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Unix知識 >> 關於Unix >> HP-UX系統管理員常用的命令集

HP-UX系統管理員常用的命令集

日期:2017/3/6 15:46:22   编辑:關於Unix
下面是偶在網上找到的HP-UX系統管理員常用的命令集和參數,已經分了類,大家可以參考一下,後面的注釋不是E文,不過應該猜的懂。 Boot-ROM [ESC] # bricht Boot-Vorgang ab search [ISL] # listet alle mndert Inhalt des LIF AUTO Files hpux ls -l # liste
  下面是偶在網上找到的HP-UX系統管理員常用的命令集和參數,已經分了類,大家可以參考一下,後面的注釋不是E文,不過應該猜的懂。
  
  
  Boot-ROM
  [ESC] # bricht Boot-Vorgang ab
  search [ISL] # listet alle m&glichen Boot-Devices (mit ISL) auf
  path [pri|alt|<#>|] # bootet vom angegebenen Device
  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 # kopiert ISL- und HP-UX-Utilities in Boot-Area
  # lifls # listet Dateiname in Boot-Area
  # licp :AUTO - # listet Inhalt des Autofile aud stdout
  
  System Startup
  /sbin/rc.d/ # mit type: S|K, Bsp: /sbin/rc2.d/S730cron, symbolisch verlinkt mit:
  /sbin/init.d/ start|stop # controlled by:
  /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 :0.0
  sam
  
  User Aclearcase/" target="_blank" >ccounts
  sam
  useradd [-m] # (mit Erzeugung eines Home-Directories)
  usermod ... # &Auml;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 # Device File-spezifische Informationen
  insf [-e] # ggf. erst nach ioscan
  mksf
  mknod
  
  Logical Volume Manager
  pvcreate [-f] [-B] # -B ... reserviert Boot-Area auf Boot-Disk
  mkdir /dev/
  mknod /dev//group c 64 0x0<#>0000
  vgcreate [-e ] [-s ] /dev/
  lvcreate [-L ] [-n ]
  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 M]
  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/ # LVM-Strukturen auf neuer Disk anlegen
  vgextend /dev/dsk/ # Erweitern der vorhandenen VG um neue Disk
  lvextend -L /dev// /dev/dsk/
  umount ; extendfs -F /dev//; mount # Erweitern eines File Systems
  oder
  fsadm -F vxfs -b
  
  tar -c ; umount ; newfs -F -s M /dev//; mount ; tar -x # Reduzieren eines File Systems
  oder
  fsadm -F vxfs -de ; fsadm -F vxfs -b
  lvreduce -L /dev//
  umount ; lvremove [-f] /dev//; vi /etc/fstab # Entfernen eines LV
  pvmove /dev/dsk/ /dev/dsk/; vgreduce /dev/dsk/ # Reduzieren einer VG
  vgreduce /dev/dsk/; vgremove ; rm -ir /dev/ # Entfernen einer VG
  oder
  vgchange -a n ; vgexport
  
  Mirror
  lvextend -m <1|2> /dev//
  lvreduce -m <0|1> /dev//
  
  Datensicherung mit minimaler Downtime:
  lvsplit /dev//
  fsck -F hfs /dev//b
  mkdir
  mount -o ro /dev//b
  # jetzt sichern, anschliessend resync mit:
  umount
  lvmerge /dev//b /dev// # stale lv -> running lv
  
  Backup / Disaster Recovery
  fbackup -f -i -e [-v] -I
  fbackup -f -u g
  frecover -f -r [-x] [-N] -v
  frecover -f -g
  frecover -f -x [-i ] [-e ]
  frecover -f -I |-
  
  fsck -F [-o full,nolog] /dev//
  Recherche-Tipps: ll //lost+found; file; strings; cat -v; what; ident
  
  vgcfgbackup # save LVM structural information into /etc/lvmconf/.conf[.old]
  vgcfgrecover -n /dev/rdsk/ # recover LVM structural information
  
  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 [] [netmask ] [up|down] # Setzen einer IP-Adresse / LAN-I/F
  ifconfig lan<#1>:<#2> inet [] [netmask ] up # Setzen von multiplexten IP-Adressen / LAN I/F
  route add | delete default | net [netmask ] # Konfigurieren eines Routings
  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 ] # Überprüfen der Connectivity auf Layer 2
  arp [-a] [] # Informationen aus dem Address Resolution Cache
  ping [] [-n ] # Überprüfen der Connectivity auf Layer 3
  netstat -i[n] # Information über Konfiguration der lokalen LAN-I/F
  nslookup # Überprüfen der Adress-Aufl&sung
  nsquery hosts # Überprüfung der Adress-Aufl&sung (detailliert)
  /usr/contrib/bin/traceroute # Routing-Statistik zwischen lokalem und Remote-Host
  
  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 -n -z -b /etc/named.conf
  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 -> mget /etc/named.data/db.*
  ftp get /etc/named.data/conf.sec.save; quit; mv conf.sec.save ../named.conf
  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 # testing DNS
  
  HP-UX Network Services
  #inetd (telnet, ftp, remsh, rlogin, rcp, bootp, tftp)
  ftp -d # Debugging Mode
  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 | [-s [:]]
  swinstall [-s ] # starts graphical user interface (GUI) for interactive installation
  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[0-9]\{4\}
  # 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; more PH.text # nur bei Patch-Installation vom Web
  mkdir ; mount /dev/dsk/ # nur bei Patch-Installation von CD-ROM
  ls ; more /GOLDBASE.readme # nur bei Patch-Installation von CD-ROM
  swinstall -s /tmp/PH.depot [-x autoreboot=true] -x patch_match_target=true
  
  swremove PH # Patch-L&schung mit Rekonstruktion aus /var/adm/sw/save
  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 # lokales Installationsmedium
  > search lan install; > boot lan. install # remote Ignite-UX-Server via LAN
  
  set_parms initial # initiale Systemkonfiguration, wiederholbar
  
  dd if=/dev/rdsk/ of=/dev/rdsk/ bs=4096k # Duplizieren einer installierten Disk (Klonen)
  
  Performance-Tools
  # Tool-Typen: Real Time Monitoring, Data Collection Performance, Performance Administration, Network Monitoring
  
  # Real Time Monitoring Tools
  # Unix allgemein:
  sar [-ud] [count] # System Activity Reports, -u ... CPU utilization, -d ... Disk Report
  top [-s ] [-d ] [-n ] [-q] # CPU-belastende Prozesse, -q ... quick
  vmstat [-nS] [ [count]] # Virtual Memory Statistics, -n ... 80-Spalten-Ausgabe, -S ... mit Swapping-Infos
  iostat [ [count]] # I/O-Statistik
  time ; timex # Ausführungszeiten des Prozesses
  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 ] command # Prozess-Aufruf mit Nice-Wert
  renice [-n ] # Nice-Wert-Änderung eines laufenden Prozesses
  # HP-UX-spezifisch:
  rtprio [ | -] # Prozess-Aufruf mit Real Time Priorit&t oder Priorit&ts&nderung eines laufenden Prozesses
  serialize | | -p ] # serielle Prozess-Bearbeitung mit anderen "serialisierten" (Langlauf-)Prozessen
  # 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 ] [-n ] # sendet ICMP Echo Request-Pakete, -o ... IP-Route wird angezeigt
  # HP-UX-spezifisch:
  ndd [-get | -set] # Netzwerk-Parameter-Tuning
  nettune # Netzwerk-Parameter-Tuning
  # NetMetrics
  
  

Copyright © Linux教程網 All Rights Reserved