How to Use the VMware ESXi Check Script (vmware-esxi-check)

vmware-esxi-check-v1.3.0.sh is the ITCheckAI check script for VMware ESXi hosts. It supports ESXi 6.5 / 6.7 / 7.0 / 8.0 and runs in the ESXi Shell or an SSH session. It collects system (including boot device / bootbank and scratch health, syslog config, SSL certificate expiry, and maintenance / lockdown / SSH / NTP security posture), hardware, storage (including hardware RAID controller and vendor-CLI collection plus vSAN health), network, VM inventory and snapshot summary, log tails and a short performance snapshot in read-only mode, writes a lightweight check.json manifest (schema itcheck.esxi.check/1) with 20-class streaming credential redaction, and packs everything into <hostname>.<serial>.check-<timestamp>.tgz; performance sampling takes about 10 seconds and a full run usually finishes within a few minutes.

Script Overview

The current version is 1.3.0, distributed as vmware-esxi-check-v1.3.0.sh (schema itcheck.esxi.check/1). It is a plain BusyBox ash / POSIX /bin/sh script that you can audit line by line before running. Its design points, as actually implemented in the script:

  • Read-only collection: it only calls query commands such as esxcli ... list / get, vim-cmd vmsvc/getallvms, esxtop -b and tail. It does not change host configuration or restart services; the only writes are the temporary directory and the final archive in the output directory.
  • Built-in tools only: no extra VIBs or utilities are required; ESXi BusyBox applets plus esxcli, vim-cmd, esxcfg-scsidevs and memstats are sufficient.
  • Per-command timeout and item status classification: a built-in pure-shell watchdog (default 30s for regular commands, 60s for performance) releases hung storage commands during APD / PDL events; every item records exact exit code, duration, original host timezone timestamps, and status (ok / empty / permission_denied / command_missing / timeout / failed / not_applicable / skipped) in check.json.
  • Datastore preferred for output: /tmp on ESXi is a small ramdisk, so by default the script writes to the first directory under /vmfs/volumes/ and only falls back to /tmp (recording a warning) when none exists.
  • Non-root tagging and 20-class credential redaction: non-root runs generate warning.txt and mark is_root=false in check.json; the script never reads /etc/shadow, /etc/passwd, /etc/vmware/snmp.xml, or private keys, and streams all logs and sensitive ESXi advanced setting String Value entries through a 20-class redactor.

Download: vmware-esxi-check-v1.3.0.sh (SHA-256: 6e84be92154c53856adc607db06fbd6f3e969ab10735a9c6d0f640c3f8db0cdf). Scripts for other operating systems are listed on the OS check tool page.

What It Collects

The script collects data in seven sections, each written to a subdirectory of the same name inside the archive, alongside root-level date.log, check.json, and (when non-root) warning.txt. Commands below match the script verbatim; items with | head -n N preserve the command's true exit code before truncating lines.

CategoryContentMain commands / files
System (system)ESXi version and build, host name, uptime, boot device / bootbank and scratch health (flags SD/USB boot media and ramdisk scratch risk), time and NTP, persistent/remote syslog config, host SSL certificate expiry (public cert metadata only, never private key), maintenance/lockdown mode and SSH/ESXiShell/NTP posture, loaded modules, hostd / vpxa service status, advanced settings changed from default (sensitive values redacted)vmware -vl, esxcli system version get, esxcli system hostname get, esxcli system stats uptime get, esxcli system boot device get, vmkfstools -P /bootbank, stat -f /bootbank /altbootbank, esxcli system time get, esxcli system ntp get, esxcli system syslog config get, openssl x509 -noout -subject -issuer -dates -in /etc/vmware/ssl/rui.crt, vim-cmd hostsvc/hostsummary (key fields summary), chkconfig --list ntpd / SSH / ESXiShell, esxcli system module list, chkconfig --list, /etc/init.d/hostd status, /etc/init.d/vpxa status, esxcli system settings advanced list -d
Hardware (hardware)Platform model and serial number, CPU, total memory, PCI devices, boot devices, IPMI event log (SEL) and sensors (SDR)esxcli hardware platform get, esxcli hardware cpu global get, esxcli hardware cpu list, esxcli hardware memory get, esxcli hardware pci list, esxcli hardware bootdevice list, esxcli hardware ipmi sel list, esxcli hardware ipmi sdr list
Storage (storage)Storage adapters, LUN / disk devices and I/O statistics, multipathing and NMP policy, VMFS extents and file systems, space usage, hardware RAID controller and management tool detection (StorCLI / PercCLI / MegaCLI / ARCCONF / SSACLI / SAS3IRCU / SAS2IRCU) plus automatic vendor-CLI collection, vSAN cluster and health checks (marked not_applicable when disabled)esxcli storage core adapter list, esxcli storage core device list, esxcli storage core device stats get, esxcli storage core path list, esxcli storage nmp device list, esxcli storage vmfs extent list, esxcli storage filesystem list, df -h, esxcfg-scsidevs -l, raid-detect.log, raid-<tool>-*.log, esxcli vsan cluster get, esxcli vsan health cluster list
Network (network)Physical NICs, VMkernel interfaces and IPv4 addresses, standard / distributed switches, routes, DNS, firewall status, detailed properties of each physical NICesxcli network nic list, esxcli network ip interface list, esxcli network ip interface ipv4 get, esxcli network vswitch standard list, esxcli network vswitch dvs vmware list, esxcli network ip route ipv4 list, esxcli network ip dns server list, esxcli network firewall get, esxcli network nic get -n <vmnic>
Virtual machines (vms)Registered VM inventory, running VM processes, summary of VMs with snapshots (bounded at 200 VMs / 90s total budget by default)vim-cmd vmsvc/getallvms, esxcli vm process list, vim-cmd vmsvc/snapshot.get <vmid>
Logs (logs)The last lines of each log file (stream-redacted)/var/log/vmkernel.log (500 lines), /var/log/vmkwarning.log (200), /var/log/hostd.log (300), /var/log/vobd.log (200), /var/log/syslog.log (200)
Performance (performance)esxtop batch snapshot (2 samples, 5 seconds apart; skippable with --skip-perf), memory compression statistics, process informationesxtop -b -n 2 -d 5, memstats -r comp-stats, ps -Tcjstv

Before You Run

  • Privileges: running as root is recommended; ordinary accounts can still run and produce a bundle with warning.txt, while restricted esxcli / vim-cmd / log items are marked permission_denied.
  • Enable the ESXi Shell or SSH: start TSM-SSH (SSH) or TSM (ESXi Shell) from the DCUI (Troubleshooting Options) or from Host Client under Manage → Services. If the host is in Lockdown Mode, adjust it temporarily according to your change process. Restore the original service state after the check.
  • Free space in the output directory: it is best to pass a datastore with free space explicitly (for example /vmfs/volumes/datastore1). The default is the first directory under /vmfs/volumes/ in name order, which may be a UUID directory rather than the datastore you expect; the /tmp fallback is a ramdisk with very limited space.
  • Timing: the load is light, but avoid backup windows, mass vMotion and change windows anyway.

Step by Step

  1. Save the script from the download link above in a browser, or fetch it with curl on your admin workstation (replace <site> with this site's domain):
curl -o vmware-esxi-check-v1.3.0.sh https://<site>/tools/os-check/download/vmware-esxi/
  1. Upload it with scp to a datastore directory on the ESXi host (to avoid filling the /tmp ramdisk):
scp vmware-esxi-check-v1.3.0.sh root@192.168.1.10:/vmfs/volumes/datastore1/
# With OpenSSH 9+ clients, if the connection is closed, add -O to use the legacy scp protocol
scp -O vmware-esxi-check-v1.3.0.sh root@192.168.1.10:/vmfs/volumes/datastore1/
  1. Log in over SSH and run it with sh; the optional argument is the output directory (use an absolute path):
ssh root@192.168.1.10
sh /vmfs/volumes/datastore1/vmware-esxi-check-v1.3.0.sh /vmfs/volumes/datastore1
# Example of the last terminal line:
# Check data saved to /vmfs/volumes/datastore1/host01.SN123.check-20261130_100000.tgz
  1. Copy the archive back to your workstation:
mkdir -p results
scp root@192.168.1.10:/vmfs/volumes/datastore1/host01.*.check-*.tgz ./results/
  1. After confirming the copy, delete the script and the archive from the host:
ssh root@192.168.1.10 'rm -f /vmfs/volumes/datastore1/vmware-esxi-check-v1.3.0.sh /vmfs/volumes/datastore1/host01.*.check-*.tgz'

Parameters

ParameterRequiredDescription
[output-dir] / --out-dir DIROptionalDirectory for the archive (also honors ITCHECK_OUT_DIR); created if missing and normalized to an absolute path automatically. When omitted, the first directory under /vmfs/volumes/*/ is used, or /tmp if there is no datastore.
--cmd-timeout SECOptionalPer-command timeout in seconds; defaults to 30 (honors ITCHECK_CMD_TIMEOUT).
--perf-timeout SECOptionalPerformance command timeout in seconds; defaults to 60 (honors ITCHECK_PERF_TIMEOUT).
--max-item-bytes NOptionalMaximum bytes retained per collected item; defaults to 1048576 (1 MiB).
--skip-perfOptionalSkips live esxtop sampling and marks the item skipped (honors ITCHECK_SKIP_PERF=1).
--version / -h, --helpOptionalPrints script version and schema or usage help, then exits with code 0.

Output

The output file is <output-dir>/<hostname>.<serial>.check-<YYYYMMDD_HHMMSS>.tgz:

  • <hostname> comes from the hostname command, or unknown if it fails.
  • <serial> is the Serial Number from esxcli hardware platform get with spaces and slashes removed, or NotAvailable if it cannot be read.
  • Data is first written to a temporary directory of the same name under umask 077 along with check.json; after tar -czf succeeds and produces a non-empty file, the staging directory is deleted and only the .tgz remains.

The archive layout is shown below. Each .log file starts with ### <command>:

host01.SN123.check-20261130_100000/
├── date.log
├── check.json   # lightweight metadata manifest (schema itcheck.esxi.check/1)
├── warning.txt       # created only on non-root runs
├── system/       version.log  hostname.log  uptime.log  boot.log  boot-health.log
│                 time.log  syslog-config.log  ssl-cert.log  security-mode.log
│                 modules.log  services.log  advanced-changed.log
├── hardware/     platform.log  cpu.log  memory.log  pci.log  bootdevice.log
│                 ipmi-sel.log  ipmi-sdr.log
├── storage/      adapters.log  devices.log  device-stats.log  paths.log  nmp.log
│                 vmfs.log  df.log  scsidevs.log  raid-detect.log  raid-<tool>-*.log
│                 vsan.log
├── network/      nics.log  ip.log  vswitch.log  route.log  dns.log  firewall.log
│                 nic.<vmnic-name>.log (one per physical NIC)
├── vms/          vm-list.log  vm-process.log  snapshots.log
├── logs/         vmkernel.log  vmkwarning.log  hostd.log  vobd.log  syslog.log
└── performance/  esxtop.log  memstats.log  psinfo.log

The terminal shows progress lines such as Collecting system information ... and Collecting hardware information ..., and finally Check data saved to ... with the full archive path.

Exit codes: returns 0 once the .tgz archive is created and non-empty (after removing the staging directory and printing the archive path); returns 2 for invalid arguments; returns 1 while removing any partial archive, preserving the collected files and omitting the saved message if directory setup or tar -czf fails.

Reviewing the Results

  • Manifest first: inspect collection.is_root and collection.counts (timeout, permission_denied, command_missing, failed, redacted) in check.json to verify coverage.
  • Version and hardware: check in system/version.log that the build is on the vendor compatibility list; in hardware/ipmi-sel.log look for memory ECC, power supply, fan and temperature events, and in ipmi-sdr.log look for sensors in an abnormal state.
  • Storage paths: paths in the dead state in storage/paths.log, and LUNs with fewer working paths than expected in storage/nmp.log, mean reduced multipath redundancy; in devices.log look for devices whose status is not on.
  • Space usage: datastore usage in storage/vmfs.log and df.log is recommended to stay below 80%, since snapshots and swap files can fill a datastore quickly.
  • Network: in network/nics.log look for NICs whose Link Status is Down or whose speed or duplex is not what you expect.
  • Time sync, boot media and certificates: check system/boot-health.log for boot_is_usb=true (SD/USB boot media deprecation risk on ESXi 7/8) and scratch_on_ramdisk=true (missing persistent scratch); check notAfter in system/ssl-cert.log before certificate expiry disconnects vCenter; verify persistent/remote logging in system/syslog-config.log, and verify maintenance/lockdown mode, SSH/Shell and NTP state in system/security-mode.log and system/time.log.
  • VM snapshots and vSAN: aging snapshots in vms/snapshots.log increase storage latency and can exhaust datastore capacity; when vSAN is enabled, inspect storage/vsan.log for cluster membership or health warnings.
  • Logs: logs/vmkwarning.log and logs/vobd.log concentrate most warnings; common keywords include APD, PDL, lost access, path redundancy and Lost connectivity.

The site does not currently parse this archive automatically; review the results manually using the points above.

Batch Check

For many ESXi hosts, run an SSH loop from your workstation. Set up SSH key login first and use a common datastore name as the output directory:

# hosts.txt: one ESXi management IP per line
mkdir -p results
DS=/vmfs/volumes/datastore1
for h in $(cat hosts.txt); do
  scp vmware-esxi-check-v1.3.0.sh root@$h:$DS/ && \
  ssh root@$h "sh $DS/vmware-esxi-check-v1.3.0.sh $DS" && \
  scp root@$h:$DS/*.check-*.tgz results/ && \
  ssh root@$h "rm -f $DS/vmware-esxi-check-v1.3.0.sh $DS/*.check-*.tgz"
done

If you already use Ansible, the script module can push and run the script (it does not require Python on the remote host); fetch the archives with the scp loop above:

ansible all -i hosts.txt -u root -m script -a "vmware-esxi-check-v1.3.0.sh /vmfs/volumes/datastore1"

Notes

Note: The archive contains host configuration, network parameters (IP, routes, DNS, vSwitches), the VM inventory and system logs. Store and transfer it according to your company's security policy and do not send it to uncontrolled environments.

  • Credential redaction boundary: the script never reads /etc/shadow, /etc/passwd, /etc/vmware/snmp.xml or certificate private keys. The only files it reads are public certificate metadata from /etc/vmware/ssl/rui.crt via openssl x509 -noout and the tails of the five logs under /var/log/, and every collected item passes through a 20-class streaming redactor (including sensitive String Value entries in ESXi advanced settings).
  • Sampling duration: esxtop -b -n 2 -d 5 takes just two samples five seconds apart and keeps the first 20 lines, which is a quick look at the current state. For long-term trends use vCenter performance charts or a separate esxtop batch capture.
  • Difference from vm-support: vm-support is the official VMware support bundle; it is complete and large, and suited to vendor support cases. This script only collects the key information for routine check, is small, and is plain text you can review. Use vm-support when opening a case with VMware / Broadcom.
  • Timeout and signal cleanup: during storage issues such as APD / PDL, individual commands time out cleanly and are marked timeout; scratch working directories are cleaned automatically on exit or interruption.
  • Restore services: if you enabled SSH or the ESXi Shell just for the check, disable it afterwards according to your security baseline.
50 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.