Some Computer Hints

HP-UX System Management

System serial number can be found in the file /var/opt/ignite/local/manifest/manifest.seed or (on some systems) can be obtained as follows:

# echo 'selclass qualifier system;info;wait;infolog' | cstm | \
   grep "System Serial Number"

To find out the CPU speed of your system execute:

# echo itick_per_usec/D | adb -k /stand/vmunix /dev/kmem

You can use

# machinfo | grep speed

on Itanium systems.

To find out the number of CPUs on your system execute:

# echo runningprocs/D | adb -k /stand/vmunix /dev/mem

or use the top command.

To find the total amount of physical memory configured on your system, run one of the commands:

# echo 'selclass qualifier memory;info;wait;infolog' | cstm | \
   grep 'Total Configured'
# dmesg | grep Physical
# grep Physical /var/adm/syslog/syslog.log

To see the exact configuration of the memory chips in your system, try:

# echo 'selclass qualifier memory;info;wait;infolog' | cstm

To find out your operating system version use:

# uname -a

or something like this:

# swlist -l product | grep "Operating System"

The command

# model



will return the hardware model of yoursystem.

To find whether your operating system is 32-bit or 64-bit, try the commands

# getconf KERNEL_BITS


# file /stand/vmunix

To determine whether your hardware is 64-bit capable or not, run

# getconf HW_32_64_CAPABLE

(1 means 64-bit only, 2 means 32-bit only, and 3 means 32-bit and 64-bit) or run

# getconf HW_CPU_SUPP_BITS

Note that, even if your system is 64-bit capable, it may not be supported by HP for 64-bit operation.

To display current kernel configuration (drivers, tunable parameters, etc.) use the command

# /usr/lbin/sysadm/get_sysfile /stand/vmunix

The output should be the same as the contents of the file /stand/system.

To display and modify variables (like the primary and alternate boot path) in stable storage use the command:

# setboot

Startup configurations for network cards reside on the files /etc/rc.config.d/hp*conf. Use

# sam


# smh

to configure your network cards.


# lanscan

command will list the network cards on your system along with their name (like lan0).

To see the current speed of a network card use

# lanadmin -x 0

where 0 is the number coming after lan.

To change the speed execute

# lanadmin -X speed 0

where speed is one of 100HD, 100FD, 10HD or 10FD and 0 is the number coming after lan in your network card name.

To verify LAN connectivity with link-level loopback (i.e., below IP level) enter

# linkloop -i 0 remote_station_addr

where 0 is the number coming after lan in your network card name and remote_station_addr is the “MAC address” of the remote system’s network card (which can be found using the command

# lanscan

there). linkloop is similar to the ping command which is used at IP level.

To delete removed hardware (shown as NO_HW in ioscan output) execute

# rmsf -H HW_Path

where HW_Path is the path shown at ioscan output.

The following procedure can be used to change the order (i.e., instance number) of devices. Changing the instance number affects the device name (like the x in /dev/lanx, /dev/rmt/x... or /dev/dsk/cxt...). This way you can reorder the devices and make for example two systems “similar” (in other words, having the same device names).

• Create a temporary file on / containing current configuration:

# ioscan -kf | grep -e INTERFACE -e DEVICE | grep -v target | \
   awk '{printf "%s %s %s\n",$3,$1,$2}' >/infile

• Edit /infile and change instance numbers (last column) as you wish, but avoid duplication of them on two devices.

• Rename current ioconfig files and reboot system:

# mv /etc/ioconfig /etc/
# mv /stand/ioconfig /stand/
# shutdown -ry 0

• Interrupt boot process, and boot in single user mode. Due to the missing ioconfig files, the system will come to an ioinitrc prompt.

• Recreate new ioconfig files from scratch:

# /sbin/ioinit -c

and press Ctrl-D to continue boot process.

• Make sure the system is booted in single user mode:

# init s

• Apply the ioconfig change with your prepared infile:/p>

# ioinit -f /infile -r

• The system will reboot using information in /infile with the new instance numbers.

• If you want, you can remove old device files using for example:

# rmsf /dev/rmt/*

And then re-create new device files using

# insf -e

• Check device names with

# lssf

and instance numbers with

# ioscan

To get information on current states of all N_ports connected to a TACHYON Fibre Channel host bus adapter, try

# /opt/fcms/bin/fcmsutil /dev/td2 get remote all

To obtain a network trace on the current system use the following method:

Turn on trace with the following command:

# nettl -tn pduin pduout -s 1024 -e ns_ls_tcp -f /tmp/nettrace -tm 99999

Turn off trace using:

# nettl -tf -e ns_ls_tcp

Finally filter and convert the trace to readable format:

# netfmt -F -l -N -f /tmp/nettrace.TRC0 -c /tmp/filter.txt >/tmp/out.txt

Here the file filter.txt can contain lines like the following to select "remote login" (tcp port number 513) communication with remote system having IP only:

filter tcp_sport 513
filter tcp_dport 513
filter ip_saddr
filter ip_daddr

To find the process which uses the most CPU during the last scheduling interval enter:

# UNIX95=  /bin/ps -eo pcpu,pid,comm | sort -n | tail -1

For simple disk I/O performance monitoring use commands like:

# iostat 2 10 | grep 'c0t5d0' | grep -v '   0   '
# sar -d 2 10 | grep -e Aver -e 'c0t5d0'

To disable dtlogin (CDE) so nobody can login through X on the system, comment out the line DESKTOP=CDE in file /etc/rc.config.d/desktop and run the command:

# /sbin/init.d/dtlogin.rc stop

To disable services provided through inetd (e.g., telnet, ftp etc.) do modifications on files /etc/inetd.conf and/or /var/adm/inetd.sec.

To see if your system rebooted or paniced, type:

# tail /etc/shutdownlog