How to Use the HP-UX Check Script (hpux-check)

hpux-check is the ITCheckAI check script for HP-UX, supporting HP-UX 11i v2 (B.11.23) and 11i v3 (B.11.31) on both PA-RISC and Itanium (Integrity) servers and partitioned environments. Running in strictly read-only mode (all ioscan calls carry -k), it collects system properties (including crashconf -v dump settings and ntpq -p NTP state), the hardware I/O and Fibre Channel device trees, 11i v3 agile storage/multipathing (scsimgr), read-only Fibre Channel HBA status and statistics (fcmsutil), LVM volume groups and mirror states, network interfaces, Serviceguard high-availability cluster status, system logs and a performance snapshot, embeds a lightweight check.json manifest (schema itcheck.hpux.check/1) with 20-class streaming credential redaction, and produces a .tar.gz archive under /var/tmp (automatically falling back to .tar.Z when gzip is unavailable). A full run typically takes 1.5 to 3 minutes, of which sequential performance sampling accounts for roughly 55 to 60 seconds (skippable via --skip-perf).

Script Overview

  • File and version: hpux-check-v1.2.0.sh, version 1.2.0, schema itcheck.hpux.check/1, written for the native HP-UX POSIX shell (#!/usr/bin/sh). Download it from HP-UX check script download; scripts for other operating systems are listed on the OS check scripts tool page.
  • Strictly read-only hardware tree: runs status-query commands and reads public configuration and log files only; all hardware scans use ioscan -fnk / ioscan -fnkC to read the kernel I/O tree cache without reprobing hardware buses or rebinding drivers, scsimgr runs only get_attr / lun_map, and fcmsutil runs only status and stat queries on whitelisted FC HBA devices (never reset or write subcommands).
  • Per-command timeouts, local bdf, and exact status tracking: uses a portable POSIX watchdog (default 30s for regular commands, 90s for performance) and prefers bdf -l to skip hung NFS mounts; each file begins with ### <command line> and records exit code, duration, original host timezone timestamps, and status in check.json.
  • Non-root tagging and 20-class credential redaction: non-root runs generate warning.txt and mark restricted checks as permission_denied; never reads /etc/passwd, /etc/shadow, /tcb/files/auth/, SNMP configs, or private keys; process listings use comm basenames only (no raw args), crontab -l emits schedule plus executable basename only ([args omitted]), and all outputs (including performance/top.raw) pass through a 20-class streaming redactor.
  • Cross-release and compressor compatibility: bridges 11i v2 and 11i v3 differences (kctune and kmtune, agile /dev/rdisk/disk* and legacy /dev/rdsk/c*t*d0) with whitelist checks on parsed PV, LAN, and PPA names; compresses with gzip (.tar.gz) or falls back to compress (.tar.Z).

What It Collects

The script gathers data in seven sections, each mapped to a subdirectory in the archive, along with root-level date.log, check.json, and (when non-root) warning.txt:

CategoryContentMain commands / files
System (system)OS release and architecture, CPU/memory/firmware details, machine model, uptime and last boot time, SD-UX bundles and recent patches, kernel tunables, redacted cron summary, primary/alternate boot paths, crash dump configuration, NTP peer status, nPar / vPars partition statusuname -a, machinfo, model, getconf MACHINE_MODEL, uptime; who -b, swlist -l bundle, swlist -l patch | tail -n 200, kctune | head -n 200; kmtune | head -n 200, crontab -l (schedule & basename only), setboot, crashconf -v, ntpq -p, parstatus; vparstatus
Hardware (hardware)Full I/O device tree, disk device tree, Fibre Channel HBA tree, physical memory summary, CPU specs and processor devices, OnlineDiag (STM) FRU and CPU diagnostic log, PCI online addition/replacement (OLRAD) slot statusioscan -fnk, ioscan -fnkC disk, ioscan -fnkC fc, machinfo, dmesg, ioscan -fnkC processor, cstm_fru, cstm (first 200 lines), olrad -q
Storage (storage)LVM volume groups, logical volumes and physical volumes, per-PV details, root boot/swap/dump LV mirror mappings, local file system usage, active mount options, fstab, swap summary, raw disk vendor and size, HP-UX 11i v3 agile storage/multipathing (marked command_missing on 11i v2), read-only Fibre Channel HBA status and statisticsvgdisplay -v, pvdisplay, lvlnboot -v, bdf -l (fallback bdf), mount -p, cat /etc/fstab, swapinfo -tam, diskinfo (iterating /dev/rdisk/disk* and /dev/rdsk/c*t*d0, first 300 lines), scsimgr get_attr | head -n 200; scsimgr lun_map | head -n 300, fcmsutil <dev>, fcmsutil <dev> stat (/dev/fcd* / /dev/td* only)
Network (network)NIC hardware paths and MAC/PPA list, persistent network and route configuration, interface IP addresses and flags, packet and error counters, routing table, listening ports and active sockets, DNS and name-service switch settings, link speed and duplex mode per NIClanscan, cat /etc/rc.config.d/netconf (comments and blank lines stripped), ifconfig, netstat -in, netstat -rn, netstat -an | head -n 300, cat /etc/resolv.conf, grep hosts /etc/nsswitch.conf, lanadmin -x
Cluster (cluster)HP Serviceguard cluster, node and package runtime and switching states (if installed)cmviewcl -v
Logs (logs)Tail of the active syslog and rotated old syslog, kernel ring buffer messages, tail of boot rc log, tail of historical shutdown/reboot log (stream-redacted)tail -n 500 /var/adm/syslog/syslog.log, tail -n 200 /var/adm/syslog/OLDsyslog.log, dmesg, tail -n 100 /etc/rc.log, tail -n 50 /etc/shutdownlog
Performance snapshot (performance)Virtual memory and run-queue sampling, disk I/O sampling, CPU and I/O wait sampling, redacted single-frame top capture, top 10 processes by CPU and virtual memory size (comm basenames only, args omitted)vmstat 3 10, iostat 3 5, sar 3 5, top -d 1 -f .../top.raw (redacted, plus first 40 lines), UNIX95= ps -eo pcpu,pid,user,comm | sort -rn | head -n 11, UNIX95= ps -eo vsz,pid,user,comm | sort -rn | head -n 11

Specifically, storage/pvdisplay.log extracts whitelist-validated PV Name paths from vgdisplay -v and queries each PV in turn, while network/ifconfig.log and network/lanadmin.log iterate over the interface names (such as lan0) and numeric PPA identifiers discovered by lanscan.

Before You Run It

  • Root privileges: running as root is recommended. Starting with 1.1.0, the script inspects id -u: non-root accounts can still produce an archive, with warning.txt written and is_root=false recorded in check.json, while privileged items such as lvlnboot -v, cstm, diskinfo, lanadmin -x and /etc/shutdownlog are classified as permission_denied.
  • Command PATH: the script automatically appends /usr/sbin:/sbin:/usr/contrib/bin to PATH so administration utilities such as ioscan, vgdisplay, lanscan and cmviewcl are found reliably even over minimal non-interactive SSH sessions.
  • Disk space in output directory: defaults to /var/tmp (overridable via CLI or ITCHECK_OUT_DIR). Check free space beforehand with bdf /var/tmp so packaging never runs out of space on /var.
  • Execution window: hardware device-tree checks strictly use ioscan -fnk to read the kernel I/O tree without probing hardware buses or unbinding/rebinding drivers, and overall sampling overhead is minor; avoid major maintenance windows or pass --skip-perf for configuration-only runs.

Step-by-Step Usage

  1. Download the script to your workstation (or download it from the tool page), inspect all commands, and verify version and schema:
curl -o hpux-check-v1.2.0.sh https://<your-itcheckai-site>/tools/os-check/download/hpux/
sh hpux-check-v1.2.0.sh --version
  1. Upload the script to /var/tmp/ on the target HP-UX server using scp or sftp (relay through a bastion host in isolated networks):
scp hpux-check-v1.2.0.sh root@192.168.1.10:/var/tmp/
  1. Log in as root and run the script with sh. Progress lines are printed for each section, ending with the full archive path:
ssh root@192.168.1.10
sh /var/tmp/hpux-check-v1.2.0.sh
# Final line when gzip is installed:
# Check data saved to /var/tmp/host01.EXAMPLE01.check-20261130_100000.tar.gz
# Final line when falling back to compress:
# Check data saved to /var/tmp/host01.EXAMPLE01.check-20261130_100000.tar.Z
  1. Copy the check archive back to your workstation (using .tar.* matches both .tar.gz and .tar.Z):
mkdir -p results
scp "root@192.168.1.10:/var/tmp/host01.*.check-*.tar.*" ./results/
  1. Verify that the archive opens cleanly on your workstation (GNU tar -tzf on Linux and macOS handles both .tar.gz and .tar.Z), then delete the script and archive from the target host:
tar -tzf results/host01.EXAMPLE01.check-20261130_100000.tar.gz | head
ssh root@192.168.1.10 'rm -f /var/tmp/hpux-check-v1.2.0.sh /var/tmp/host01.*.check-*.tar.*'

Parameters

ParameterRequiredDescription
[output-dir] / --out-dir DIROptionalOutput directory; defaults to /var/tmp (honors ITCHECK_OUT_DIR).
--cmd-timeout SECOptionalPer-command timeout in seconds; defaults to 30 (honors ITCHECK_CMD_TIMEOUT).
--perf-timeout SECOptionalPerformance sampling command timeout in seconds; defaults to 90 (honors ITCHECK_PERF_TIMEOUT).
--max-item-bytes NOptionalMaximum bytes retained per collected item; defaults to 1048576 (1 MiB).
--skip-perfOptionalSkips live vmstat / iostat / sar / top sampling (honors ITCHECK_SKIP_PERF=1).
--version / -h, --helpOptionalPrints script version and schema or usage help, then exits with code 0.

Output

The archive path follows <output-dir>/<hostname>.<serial>.check-<YYYYMMDD_HHMMSS>.tar.gz (or .tar.Z when gzip is absent). The hostname comes from hostname (falling back to unknown). The serial number is read from getconf MACHINE_SERIAL first, falling back to the machine serial line of machinfo with spaces and slashes removed, or NotAvailable if still empty. Timestamps preserve the local host timezone. Once tar -cf and compression succeed, the staging directory is removed, leaving only the compressed archive (created under umask 077).

Archive layout:

host01.EXAMPLE01.check-20261130_100000/
├── date.log                  # original collection start timestamp
├── check.json           # lightweight metadata manifest (schema itcheck.hpux.check/1)
├── warning.txt               # created only on non-root runs
├── system/      uname.log  machinfo.log  model.log  uptime.log  swlist.log
│                swlist-patch.log  kernel-tunables.log  crontab.log  setboot.log
│                crashconf.log  ntp.log  parstatus.log
├── hardware/    ioscan.log  ioscan-disk.log  ioscan-fc.log  memory.log  cpu.log
│                fru.log  olrad.log
├── storage/     vgdisplay.log  pvdisplay.log  lvlnboot.log  bdf.log  mount.log
│                fstab.log  swapinfo.log  diskinfo.log  scsimgr.log  fcmsutil.log
├── network/     lanscan.log  netconf.log  ifconfig.log  netstat-in.log  netstat-rn.log
│                netstat-an.log  resolv.log  lanadmin.log
├── cluster/     cmviewcl.log
├── logs/        syslog.log  oldsyslog.log  dmesg.log  rc.log  shutdownlog.log
└── performance/ vmstat.log  iostat.log  sar.log  top.log  top.raw  top10cpu.log
                 top10mem.log
  • File format: every .log file begins with ### <command line> followed by redacted stdout and stderr and explicit status notices on missing commands, permission denials, timeouts, or failures. performance/top.raw is also redacted before being archived.
  • Terminal output: prints progress lines for each section and Compressing check data ..., ending with Check data saved to /var/tmp/….tar.gz (or .tar.Z).
  • Exit code: returns 0 after verifying the compressed archive is non-empty, removing the staging directory and printing the archive path; returns 2 on invalid CLI options; if creating or entering the working directory or running tar / gzip / compress fails, any partial archive is removed, the collected files are preserved, no saved message is printed, and the script exits with 1.

Reviewing the Results

After extracting the archive, inspect the high-priority files in this order:

  1. Manifest first: inspect collection.is_root and collection.counts in check.json for any timeout, permission_denied, or command_missing entries.
  2. Hardware device tree, agile multipathing, and Fibre Channel HBAs: inspect the S/W State column in hardware/ioscan.log, hardware/ioscan-disk.log and hardware/ioscan-fc.log (healthy devices report CLAIMED; investigate NO_HW or unexpected UNCLAIMED entries). On 11i v3, review LUN path states and load-balancing policies in storage/scsimgr.log, check FC HBA link topology, speed, and Link Failure counters in storage/fcmsutil.log, and cross-check CPU/memory health, dump targets, and NTP sync in hardware/fru.log, system/machinfo.log, system/crashconf.log and system/ntp.log.
  3. LVM volume groups, mirror sync and root disk redundancy: check storage/vgdisplay.log and storage/pvdisplay.log for any PV Status marked unavailable, missing Alternate Link paths or non-zero Stale PE counts (unsynchronized mirror extents). Verify in storage/lvlnboot.log that root volume group (typically vg00) Boot, Root, Swap and Dump volumes are mirrored across two boot disks and match the primary/alternate boot paths and Autoboot : ON setting in system/setboot.log.
  4. File system and swap utilization: check mounted file system usage in storage/bdf.log (especially /, /stand, /var, /tmp, /opt, /usr and application volumes); a common industry rule of thumb is to monitor above 80% and act above 90% (suggested thresholds; adjust to workload). Review device swap and the total line in storage/swapinfo.log.
  5. System logs and startup/shutdown history: inspect logs/syslog.log, logs/oldsyslog.log and logs/dmesg.log for LVM I/O errors, SCSI / Fibre Channel (fcd / fclp) link flaps, EMS (Event Monitoring Service) hardware alerts and kernel table exhaustion (nproc, maxfiles); check logs/rc.log for startup items marked FAIL; correlate unplanned reboots across logs/shutdownlog.log and system/uptime.log.
  6. Serviceguard cluster state (if deployed): in cluster/cmviewcl.log, verify that the overall cluster STATUS is up, all nodes and packages are up / running, and package AUTO_RUN (automatic failover switching) is enabled where expected—leaving AUTO_RUN disabled after maintenance is a frequent hidden risk.
  7. NIC link settings and error counters: review link states, negotiated speeds and full-duplex settings across physical NICs and APA aggregates in network/lanscan.log, network/lanadmin.log and network/ifconfig.log, and check Ierrs, Oerrs and Coll in network/netstat-in.log. Note that network/ifconfig.log queries primary interface names from lanscan (such as lan0) and does not show Serviceguard relocatable package IPs bound to logical alias interfaces like lan0:1; verify floating IPs in cluster/cmviewcl.log and network/netstat-in.log.
  8. Performance and resource bottlenecks: check run queue r, blocked processes b, page-outs po (sustained non-zero po on HP-UX typically points to genuine memory pressure) and CPU idle percentage in performance/vmstat.log; review %wio in performance/sar.log, device service times in performance/iostat.log, and top consumers in performance/top.log (or full top.raw), top10cpu.log and top10mem.log.

This review is performed manually: the website currently has no automatic parser for this OS check archive and does not generate automated check reports from it.

Batch Check

For multiple HP-UX servers, an SSH loop from an admin host works cleanly without extra dependencies. Put one IP or hostname per line in hosts.txt (SSH key authentication is recommended):

mkdir -p results
for h in $(cat hosts.txt); do
  scp hpux-check-v1.2.0.sh root@$h:/var/tmp/ && \
  ssh root@$h "sh /var/tmp/hpux-check-v1.2.0.sh" && \
  scp "root@$h:/var/tmp/*.check-*.tar.*" results/ && \
  ssh root@$h "rm -f /var/tmp/hpux-check-v1.2.0.sh /var/tmp/*.check-*.tar.*"
done

If you use Ansible, the script module can push and execute the shell script even on HP-UX hosts without Python installed. Because standard Ansible modules such as fetch and file require Python on the managed node (often absent on legacy HP-UX servers), combine ansible -m script with an scp retrieval loop:

ansible all -i hosts.txt -m script -a "hpux-check-v1.2.0.sh"
for h in $(cat hosts.txt); do
  scp "root@$h:/var/tmp/*.check-*.tar.*" results/ && \
  ssh root@$h "rm -f /var/tmp/*.check-*.tar.*"
done

Keep in mind that /var/tmp/*.check-*.tar.* also matches older archives left in /var/tmp; narrow the wildcard by hostname or date prefix if you only want the latest run.

Precautions

  • Security and compliance: the archive contains hardware serial numbers, partition topology, LVM and storage layouts, network and routing configurations, Serviceguard cluster definitions and system logs. Store and transfer it according to your company's security policies and do not share it in uncontrolled environments.
  • Files read and credential redaction boundary: the script never reads /etc/passwd, /etc/shadow, Trusted System authentication files under /tcb/files/auth/, SNMP configs, or SSH private keys. Configuration files read directly are limited to /etc/fstab, /etc/rc.config.d/netconf, /etc/resolv.conf, and /etc/nsswitch.conf (the hosts line only). Process listings use comm basenames only (no raw args), crontab -l emits schedule and executable basename only, and all outputs (including top.raw) pass through a 20-class streaming redactor.
  • Actual performance sampling duration: vmstat 3 10 (~30s), iostat 3 5 (~15s) and sar 3 5 (~15s) run sequentially for roughly 55 to 60 seconds in total; pass --skip-perf when live sampling is not needed.
  • Legacy disk device naming scope: storage/diskinfo.log loops over /dev/rdisk/disk* and /dev/rdsk/c*t*d0. On 11i v3, agile paths /dev/rdisk/disk* cover all LUNs; on 11i v2 hosts that only have legacy device special files, LUNs not ending in d0 (such as c2t0d1) are not matched by c*t*d0 in diskinfo.log, so rely on hardware/ioscan-disk.log and storage/vgdisplay.log for the complete disk list.
  • Per-command timeouts and NFS protection: every check is bounded by the POSIX watchdog (30s default / 90s performance), and bdf prefers bdf -l to skip remote mounts so dead SAN paths or hung NFS shares cannot block the entire run.
  • Difference from HPE vendor diagnostic bundles: this script targets lightweight routine health checks with truncated log tails. For Machine Check Aborts (MCA), kernel crash dumps under /var/adm/crash or official HPE support cases, collect full diagnostics using HPE tools such as nickel, STM / OnlineDiag or crash dump utilities as requested by HPE support.

Note: on HP-UX systems without gzip, the script automatically falls back to compress and produces a .tar.Z archive. Remove both the script and the archive from /var/tmp once retrieval is verified so /var space is not consumed over time.

47 views Updated 2026-11-19

More in this groupOS Check Scripts

View all 6 in this group

Can't find an answer?

Upload a log for AI diagnosis, or ask the AI assistant directly in the console.