cstm is installed with the OnlineDiagnostics / Support Tools Bundle on HP-UX 9000 systems:
# echo "sc product system;info;wait;il" | cstm | grep -i "system serial"
System Serial Number...: USM39302ME
or
# echo "sel path system\ninfolog\nexit"|cstm|grep "System Serial"
System Serial Number...: USM39302ME
To put the serial number into a variable use:
# SERIAL_NUMBER=$(echo "sc product system;info;wait;il" | cstm | grep -i "system serial" | awk -F: '{print $2}') # echo $SERIAL_NUMBER USM39302ME
For HP-UX 11i the following command also works:
# getconf MACHINE_SERIAL
us21628497
And for HP-UX 11i v2 on Itanium�-based systems, yse the machinfo command:
# machinfo | grep "machine serial"
machine serial number = us21628497