Skip to content

Honor standby filtering only on request#43

Draft
c-kr wants to merge 1 commit intoConSol-Monitoring:mainfrom
c-kr:cluster-health-standby
Draft

Honor standby filtering only on request#43
c-kr wants to merge 1 commit intoConSol-Monitoring:mainfrom
c-kr:cluster-health-standby

Conversation

@c-kr
Copy link
Copy Markdown

@c-kr c-kr commented Apr 18, 2026

Cluster Health Standby Handling

Summary

This patch fixes standby host handling in cluster-health:

  • host_in_standby() now returns a boolean instead of always returning None
  • --nostandby is now actually honored

Before this fix, standby hosts were still included in the cluster member count even when --nostandby was specified.

Files

  • checkvsphere/vcmd/clusterhealth.py

Quick Verification

export PYTHONPATH="$PWD"
export VC_HOST='vcenter.example.com'
export VC_USER='monitor@vsphere.local'
export VC_PASS='secret'
export CLUSTER_NAME='cluster1'

Use a cluster that currently has at least one host in standby.

python -m checkvsphere.cli cluster-health -s "$VC_HOST" -u "$VC_USER" -p "$VC_PASS" -nossl \
  --cluster-name "$CLUSTER_NAME" \
  --cluster-threshold 1:1 \
  --nostandby

Expected before fix:

  • standby hosts are still counted as regular cluster members
  • output/member count does not change even though --nostandby was passed

Expected after fix:

  • standby hosts are excluded from cluster member counting
  • output reflects the reduced member count when standby hosts exist

Assisted-by: Codex gpt-5.4 high
Draft status for early feedback, as not fully tested yet (I don't have a cluster for testing). Feedback appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant