CiscoDevNet / Hyperflex-Hypercheck

Perform pro-active self checks on your Hyperflex cluster to ensure stability and resiliency
MIT License
27 stars 18 forks source link

Add ESXi df check to verify presence of ESXi OS filesystems. #40

Open sttardy opened 3 years ago

sttardy commented 3 years ago

Currently HyperCheck checks that these vfat filesystems are present and warn if at 100%.

cmd = "df -h | grep vfat | grep 100%"

HyperCheck should also check for the presence of the filesystems. Sometimes these filesystems go "missing" which prevents ESXi from upgrading/installing causing Hyperflex upgrade to fail.

[root@hx-01a-esxi-3:~] df|grep vfat
vfat            261853184     181067776       80785408  69% /vmfs/volumes/f1cd25ec-3031e5fc-6a4c-ad2dd03544a2
vfat            299712512     205324288       94388224  69% /vmfs/volumes/5cf67eec-6a6ae07a-c25d-0025b5c0a103
vfat            261853184     181010432       80842752  69% /vmfs/volumes/1048eaec-53f1e4d3-baca-031557a4842e
[root@hx-01a-esxi-3:~] echo $?
0
[root@hx-01a-esxi-3:~] df|grep vfat2
[root@hx-01a-esxi-3:~] echo $?
1
[root@hx-01a-esxi-3:~]

In python, probably make sure len(cmd(df | grep vfat)) >= 3, otherwise warn about possible missing OS filesystem. Or verify the return code of cmd(df | grep vfat) = 0. Or maybe warn when return code of cmd(df | grep vfat) != 0.