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, schemaitcheck.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 -fnkCto read the kernel I/O tree cache without reprobing hardware buses or rebinding drivers,scsimgrruns onlyget_attr/lun_map, andfcmsutilruns only status andstatqueries 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 prefersbdf -lto skip hung NFS mounts; each file begins with### <command line>and records exit code, duration, original host timezone timestamps, and status incheck.json. - Non-root tagging and 20-class credential redaction: non-root runs generate
warning.txtand mark restricted checks aspermission_denied; never reads/etc/passwd,/etc/shadow,/tcb/files/auth/, SNMP configs, or private keys; process listings usecommbasenames only (no raw args),crontab -lemits schedule plus executable basename only ([args omitted]), and all outputs (includingperformance/top.raw) pass through a 20-class streaming redactor. - Cross-release and compressor compatibility: bridges 11i v2 and 11i v3 differences (
kctuneandkmtune, agile/dev/rdisk/disk*and legacy/dev/rdsk/c*t*d0) with whitelist checks on parsed PV, LAN, and PPA names; compresses withgzip(.tar.gz) or falls back tocompress(.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:
| Category | Content | Main 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 status | uname -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 status | ioscan -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 statistics | vgdisplay -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 NIC | lanscan, 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
rootis recommended. Starting with 1.1.0, the script inspectsid -u: non-root accounts can still produce an archive, withwarning.txtwritten andis_root=falserecorded incheck.json, while privileged items such aslvlnboot -v,cstm,diskinfo,lanadmin -xand/etc/shutdownlogare classified aspermission_denied. - Command PATH: the script automatically appends
/usr/sbin:/sbin:/usr/contrib/bintoPATHso administration utilities such asioscan,vgdisplay,lanscanandcmviewclare found reliably even over minimal non-interactive SSH sessions. - Disk space in output directory: defaults to
/var/tmp(overridable via CLI orITCHECK_OUT_DIR). Check free space beforehand withbdf /var/tmpso packaging never runs out of space on/var. - Execution window: hardware device-tree checks strictly use
ioscan -fnkto 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-perffor configuration-only runs.
Step-by-Step Usage
- 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- Upload the script to
/var/tmp/on the target HP-UX server usingscporsftp(relay through a bastion host in isolated networks):
scp hpux-check-v1.2.0.sh root@192.168.1.10:/var/tmp/- Log in as
rootand run the script withsh. 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- Copy the check archive back to your workstation (using
.tar.*matches both.tar.gzand.tar.Z):
mkdir -p results
scp "root@192.168.1.10:/var/tmp/host01.*.check-*.tar.*" ./results/- Verify that the archive opens cleanly on your workstation (GNU
tar -tzfon Linux and macOS handles both.tar.gzand.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
| Parameter | Required | Description |
|---|---|---|
[output-dir] / --out-dir DIR | Optional | Output directory; defaults to /var/tmp (honors ITCHECK_OUT_DIR). |
--cmd-timeout SEC | Optional | Per-command timeout in seconds; defaults to 30 (honors ITCHECK_CMD_TIMEOUT). |
--perf-timeout SEC | Optional | Performance sampling command timeout in seconds; defaults to 90 (honors ITCHECK_PERF_TIMEOUT). |
--max-item-bytes N | Optional | Maximum bytes retained per collected item; defaults to 1048576 (1 MiB). |
--skip-perf | Optional | Skips live vmstat / iostat / sar / top sampling (honors ITCHECK_SKIP_PERF=1). |
--version / -h, --help | Optional | Prints 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
.logfile begins with### <command line>followed by redacted stdout and stderr and explicit status notices on missing commands, permission denials, timeouts, or failures.performance/top.rawis also redacted before being archived. - Terminal output: prints progress lines for each section and
Compressing check data ..., ending withCheck data saved to /var/tmp/….tar.gz(or.tar.Z). - Exit code: returns
0after verifying the compressed archive is non-empty, removing the staging directory and printing the archive path; returns2on invalid CLI options; if creating or entering the working directory or runningtar/gzip/compressfails, any partial archive is removed, the collected files are preserved, no saved message is printed, and the script exits with1.
Reviewing the Results
After extracting the archive, inspect the high-priority files in this order:
- Manifest first: inspect
collection.is_rootandcollection.countsincheck.jsonfor anytimeout,permission_denied, orcommand_missingentries. - Hardware device tree, agile multipathing, and Fibre Channel HBAs: inspect the
S/W Statecolumn inhardware/ioscan.log,hardware/ioscan-disk.logandhardware/ioscan-fc.log(healthy devices reportCLAIMED; investigateNO_HWor unexpectedUNCLAIMEDentries). On 11i v3, review LUN path states and load-balancing policies instorage/scsimgr.log, check FC HBA link topology, speed, andLink Failurecounters instorage/fcmsutil.log, and cross-check CPU/memory health, dump targets, and NTP sync inhardware/fru.log,system/machinfo.log,system/crashconf.logandsystem/ntp.log. - LVM volume groups, mirror sync and root disk redundancy: check
storage/vgdisplay.logandstorage/pvdisplay.logfor anyPV Statusmarkedunavailable, missingAlternate Linkpaths or non-zeroStale PEcounts (unsynchronized mirror extents). Verify instorage/lvlnboot.logthat root volume group (typicallyvg00)Boot,Root,SwapandDumpvolumes are mirrored across two boot disks and match the primary/alternate boot paths andAutoboot : ONsetting insystem/setboot.log. - File system and swap utilization: check mounted file system usage in
storage/bdf.log(especially/,/stand,/var,/tmp,/opt,/usrand 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 thetotalline instorage/swapinfo.log. - System logs and startup/shutdown history: inspect
logs/syslog.log,logs/oldsyslog.logandlogs/dmesg.logfor LVM I/O errors, SCSI / Fibre Channel (fcd/fclp) link flaps, EMS (Event Monitoring Service) hardware alerts and kernel table exhaustion (nproc,maxfiles); checklogs/rc.logfor startup items markedFAIL; correlate unplanned reboots acrosslogs/shutdownlog.logandsystem/uptime.log. - Serviceguard cluster state (if deployed): in
cluster/cmviewcl.log, verify that the overall clusterSTATUSisup, all nodes and packages areup/running, and packageAUTO_RUN(automatic failover switching) isenabledwhere expected—leavingAUTO_RUNdisabled after maintenance is a frequent hidden risk. - 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.logandnetwork/ifconfig.log, and checkIerrs,OerrsandCollinnetwork/netstat-in.log. Note thatnetwork/ifconfig.logqueries primary interface names fromlanscan(such aslan0) and does not show Serviceguard relocatable package IPs bound to logical alias interfaces likelan0:1; verify floating IPs incluster/cmviewcl.logandnetwork/netstat-in.log. - Performance and resource bottlenecks: check run queue
r, blocked processesb, page-outspo(sustained non-zeropoon HP-UX typically points to genuine memory pressure) and CPU idle percentage inperformance/vmstat.log; review%wioinperformance/sar.log, device service times inperformance/iostat.log, and top consumers inperformance/top.log(or fulltop.raw),top10cpu.logandtop10mem.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.*"
doneIf 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.*"
doneKeep 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(thehostsline only). Process listings usecommbasenames only (no raw args),crontab -lemits schedule and executable basename only, and all outputs (includingtop.raw) pass through a 20-class streaming redactor. - Actual performance sampling duration:
vmstat 3 10(~30s),iostat 3 5(~15s) andsar 3 5(~15s) run sequentially for roughly 55 to 60 seconds in total; pass--skip-perfwhen live sampling is not needed. - Legacy disk device naming scope:
storage/diskinfo.logloops 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 ind0(such asc2t0d1) are not matched byc*t*d0indiskinfo.log, so rely onhardware/ioscan-disk.logandstorage/vgdisplay.logfor the complete disk list. - Per-command timeouts and NFS protection: every check is bounded by the POSIX watchdog (30s default / 90s performance), and
bdfprefersbdf -lto 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/crashor official HPE support cases, collect full diagnostics using HPE tools such asnickel, STM / OnlineDiag or crash dump utilities as requested by HPE support.
Note: on HP-UX systems without
gzip, the script automatically falls back tocompressand produces a.tar.Zarchive. Remove both the script and the archive from/var/tmponce retrieval is verified so/varspace is not consumed over time.