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 -bandtail. 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-scsidevsandmemstatsare 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) incheck.json. - Datastore preferred for output:
/tmpon 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.txtand markis_root=falseincheck.json; the script never reads/etc/shadow,/etc/passwd,/etc/vmware/snmp.xml, or private keys, and streams all logs and sensitive ESXi advanced settingString Valueentries 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.
| Category | Content | Main 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 NIC | esxcli 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 information | esxtop -b -n 2 -d 5, memstats -r comp-stats, ps -Tcjstv |
Before You Run
- Privileges: running as
rootis recommended; ordinary accounts can still run and produce a bundle withwarning.txt, while restrictedesxcli/vim-cmd/ log items are markedpermission_denied. - Enable the ESXi Shell or SSH: start
TSM-SSH(SSH) orTSM(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/tmpfallback 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
- 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/- Upload it with scp to a datastore directory on the ESXi host (to avoid filling the
/tmpramdisk):
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/- 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- Copy the archive back to your workstation:
mkdir -p results
scp root@192.168.1.10:/vmfs/volumes/datastore1/host01.*.check-*.tgz ./results/- 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
| Parameter | Required | Description |
|---|---|---|
[output-dir] / --out-dir DIR | Optional | Directory 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 SEC | Optional | Per-command timeout in seconds; defaults to 30 (honors ITCHECK_CMD_TIMEOUT). |
--perf-timeout SEC | Optional | Performance command timeout in seconds; defaults to 60 (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 esxtop sampling and marks the item skipped (honors ITCHECK_SKIP_PERF=1). |
--version / -h, --help | Optional | Prints 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 thehostnamecommand, orunknownif it fails.<serial>is theSerial Numberfromesxcli hardware platform getwith spaces and slashes removed, orNotAvailableif it cannot be read.- Data is first written to a temporary directory of the same name under
umask 077along withcheck.json; aftertar -czfsucceeds and produces a non-empty file, the staging directory is deleted and only the.tgzremains.
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.logThe 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_rootandcollection.counts(timeout,permission_denied,command_missing,failed,redacted) incheck.jsonto verify coverage. - Version and hardware: check in
system/version.logthat the build is on the vendor compatibility list; inhardware/ipmi-sel.loglook for memory ECC, power supply, fan and temperature events, and inipmi-sdr.loglook for sensors in an abnormal state. - Storage paths: paths in the
deadstate instorage/paths.log, and LUNs with fewer working paths than expected instorage/nmp.log, mean reduced multipath redundancy; indevices.loglook for devices whose status is noton. - Space usage: datastore usage in
storage/vmfs.loganddf.logis recommended to stay below 80%, since snapshots and swap files can fill a datastore quickly. - Network: in
network/nics.loglook for NICs whoseLink StatusisDownor whose speed or duplex is not what you expect. - Time sync, boot media and certificates: check
system/boot-health.logforboot_is_usb=true(SD/USB boot media deprecation risk on ESXi 7/8) andscratch_on_ramdisk=true(missing persistent scratch); checknotAfterinsystem/ssl-cert.logbefore certificate expiry disconnects vCenter; verify persistent/remote logging insystem/syslog-config.log, and verify maintenance/lockdown mode, SSH/Shell and NTP state insystem/security-mode.logandsystem/time.log. - VM snapshots and vSAN: aging snapshots in
vms/snapshots.logincrease storage latency and can exhaust datastore capacity; when vSAN is enabled, inspectstorage/vsan.logfor cluster membership or health warnings. - Logs:
logs/vmkwarning.logandlogs/vobd.logconcentrate most warnings; common keywords includeAPD,PDL,lost access,path redundancyandLost 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"
doneIf 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.xmlor certificate private keys. The only files it reads are public certificate metadata from/etc/vmware/ssl/rui.crtviaopenssl x509 -nooutand the tails of the five logs under/var/log/, and every collected item passes through a 20-class streaming redactor (including sensitiveString Valueentries in ESXi advanced settings). - Sampling duration:
esxtop -b -n 2 -d 5takes 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-supportis 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. Usevm-supportwhen 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.