Przejdลบ do treล›ci

๐Ÿข AIX/HPUX Legacy Debugging Tools

AIX and HP-UX represent enterprise UNIX systems with decades of evolution, featuring specialized debugging tools tailored for mission-critical environments. These systems prioritize stability, scalability, and deep system introspection capabilities.


๐Ÿ” Core Debugging Utilities

AIX: truss / HP-UX: tusc โ€“ System Call Tracing

Platform-specific equivalents for tracing system calls and signals.

AIX:

1
2
3
4
5
6
7
8
# Trace system calls of a command
truss ls

# Trace specific process
truss -p 1234

# Count syscalls by type
truss -c ./my_program

HP-UX:

1
2
3
4
5
6
7
8
# Trace system calls (HP-UX)
tusc ls

# Trace with timing
tusc -T ./my_program

# Follow child processes
tusc -f daemon_program


AIX: procstack / HP-UX: pstack โ€“ Stack Tracing

Display stack traces of running processes.

AIX:

1
2
3
4
5
# Show stack trace
procstack 1234

# Detailed symbol information
procstack -v 1234

HP-UX:

1
2
3
4
5
# Display process stack
pstack 1234

# Multiple samples
pstack -n 5 1234


dbx โ€“ Debugger

Native debugger for both platforms supporting source-level debugging.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Load program into dbx
dbx ./program

# Run with arguments
(dbx) run arg1 arg2

# Set breakpoint
(dbx) stop at main

# Show backtrace
(dbx) where

๐Ÿ“Š Performance Analysis Tools

AIX: topas / HP-UX: top โ€“ System Monitoring

Enhanced system monitoring utilities.

AIX:

1
2
3
4
5
6
7
8
# Comprehensive system view
topas

# Network-focused view
topas -n

# Disk-focused view
topas -D

HP-UX:

1
2
3
4
5
# Standard top
top

# Batch mode
top -b -n 1


AIX: vmstat / HP-UX: vmstat โ€“ Memory Statistics

Virtual memory and system performance statistics.

1
2
3
4
5
6
7
8
# Basic vmstat
vmstat 2

# Detailed paging info
vmstat -s

# Disk statistics
vmstat -d

AIX: sar / HP-UX: sar โ€“ System Activity Reporter

Historical performance data collection and reporting.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# CPU utilization
sar -u

# Memory usage
sar -r

# I/O statistics
sar -b

# View historical data
sar -f /var/adm/sa/sa01

๐Ÿ—ƒ๏ธ Filesystem & Storage Diagnostics

AIX: lsof / HP-UX: fuser โ€“ File Usage Tracking

Identify processes using files or filesystems.

AIX:

1
2
3
4
5
6
7
8
# Show open files
lsof

# Filter by process
lsof -p 1234

# Network connections
lsof -i

HP-UX:

1
2
3
4
5
# Files used by process
fuser -v /path/to/file

# Kill processes using file
fuser -k /mounted/filesystem


AIX: iostat / HP-UX: iostat โ€“ I/O Statistics

Disk I/O performance monitoring.

1
2
3
4
5
6
7
8
# Extended device statistics
iostat -xt 5

# Logical volume stats (AIX)
iostat -l 5

# Device-specific stats (HP-UX)
iostat -d 5

AIX: lsvg/lslv / HP-UX: vgdisplay/lvdisplay โ€“ LVM Management

Logical Volume Manager diagnostics.

AIX:

1
2
3
4
5
6
7
8
# Volume group info
lsvg rootvg

# Logical volume details
lslv lv01

# Physical volume status
lspv

HP-UX:

1
2
3
4
5
6
7
8
# Volume group display
vgdisplay /dev/vg00

# Logical volume info
lvdisplay /dev/vg00/lvol1

# Physical volume status
pvdisplay


๐ŸŒ Network Troubleshooting

AIX: netstat / HP-UX: netstat โ€“ Network Statistics

Network connection and interface monitoring.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Active connections
netstat -an

# Listening ports
netstat -an | grep LISTEN

# Interface statistics
netstat -i

# Routing table
netstat -rn

AIX: iptrace / HP-UX: nettl โ€“ Network Packet Capture

Platform-specific packet capture utilities.

AIX:

1
2
3
4
5
6
7
8
# Start packet trace
iptrace -d eth0 trace.out

# Stop tracing
stopsrc -s iptrace

# Convert to readable format
ipreport trace.out

HP-UX:

1
2
3
4
5
6
7
8
# Configure trace
nettl -tn ether -e ns_ls_ip -m uxmon0

# Start tracing
nettl -tb

# Stop and convert
nettl -tf all


๐Ÿง  Memory Debugging

AIX: svmon โ€“ Shared Memory Monitor

Advanced memory usage analysis.

1
2
3
4
5
6
7
8
# Global memory usage
svmon -G

# Per-process memory
svmon -P 1234

# Detailed segment info
svmon -S

HP-UX: glance โ€“ System Performance Monitorยน

Comprehensive real-time system monitoring tool.

1
2
3
4
5
6
7
8
# Start glance
glance

# Command-line mode
glance -j

# Historical data
glance -r /var/opt/perf/archive

ยน Requires GlancePlus package installation


๐Ÿ•ต๏ธโ€โ™‚๏ธ Logs and System Messages

AIX: errpt โ€“ Error Report Utility

AIX-specific error log analysis.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# Recent errors
errpt

# Detailed error info
errpt -a

# Errors from specific date
errpt -s 01011200

# Hardware errors only
errpt -N H

# Export to file
errpt -a > error_report.txt

HP-UX: dmesg / System Logs

Kernel messages and system logs.

1
2
3
4
5
6
7
8
# Kernel ring buffer
dmesg | tail

# System event log (HP-UX)
/opt/resmon/bin/resdata -R

# Application logs
tail /var/adm/syslog/syslog.log

๐Ÿงฐ Advanced Diagnostic Tools

AIX: snap โ€“ System Snapshot Utility

Creates comprehensive diagnostic snapshots for support.

1
2
3
4
5
6
7
8
# Generate system snapshot
snap -c

# Include application data
snap -c -a

# Custom snapshot
snap -g -o /tmp/custom_snap

HP-UX: SPI โ€“ System Performance Inspectorยฒ

Enterprise-level performance analysis framework.

Components: - MeasureWare Agent - Performance Agent - Global Workload Manager

1
2
3
4
5
# Start MeasureWare
/sbin/init.d/mwa start

# Performance data collection
parmgr -c config.file

ยฒ Commercial product requiring separate licensing


AIX: kdb โ€“ Kernel Debuggerยณ

Low-level kernel debugging interface.

1
2
3
4
5
6
7
8
# Boot into kdb
# (At boot prompt) kdb

# Common kdb commands:
# stat           - System status
# trace          - Stack trace
# mem <addr>     - Memory dump
# regs           - Register display

ยณ Requires boot-time activation and expert knowledge


๐Ÿงพ Summary Table

Tool Platform Purpose
truss/tusc Both System call tracing
procstack/pstack Both Stack trace analysis
dbx Both Source-level debugging
topas/top AIX/HP-UX System monitoring
lsof/fuser AIX/HP-UX File usage tracking
iptrace/nettl AIX/HP-UX Network packet capture
svmon/glance AIX/HP-UX Memory analysis
errpt AIX Error log analysis
snap AIX Diagnostic snapshot generation
SPI HP-UX Enterprise performance monitoring

๐Ÿง  Best Practices

โœ… Use platform-native tools for optimal compatibility โœ… Regularly archive sar and errpt data for trend analysis โœ… Leverage snap for comprehensive problem reporting โœ… Monitor LVM health with volume group commands โœ… Combine network and system monitoring for holistic views โœ… Maintain historical baselines for performance comparisons


๐Ÿงพ See Also