Diagnosing and Troubleshooting vCenter
search cancel

Diagnosing and Troubleshooting vCenter

book

Article ID: 380904

calendar_today

Updated On:

Products

VMware vCenter Server VMware vCenter Server 7.0 VMware vCenter Server 8.0

Issue/Introduction

In scenarios requiring vCenter troubleshooting, obtaining basic details can often become a tedious task. This command streamlines the process by extracting crucial vCenter information with a single execution. 

Environment

VMware vCenter 7.0.x

VMware vCenter 8.0.x

Cause

When faced with vCenter issues, it is vital to quickly gather foundational information about the vCenter environment. Traditional methods of fetching this information can be time-consuming and cumbersome, leading to delays in diagnosing and resolving problems.

Resolution

To gather the vCenter details, execute the following command:

echo -e "\nINITIAL_CHECKS" && domain=$(cat /etc/vmware/install-defaults/vmdir.domain-name) && read -s -p "Enter the password for administrator@$domain: " sso_pass && hostname -f | awk '{print "\n\nHostname: " $1}' && /usr/lib/vmware-vmafd/bin/vmafd-cli get-pnid --server-name localhost | awk '{print "PNID: " $1}' && vpxd -vl | awk '{print "Version: " $0}' && VC_IP=$(ifconfig | grep -E "inet addr" | cut -d " " -f11-12 | awk -F ":" '{print $2}' | head -n1); echo -e "VCIP: $VC_IP" && echo "Domain: $domain" && date | awk '{print "Timestamp: " $0}' && uptime | awk '{print "Uptime: " $0}' && /usr/lib/vmware-vmafd/bin/vmafd-cli get-machine-id --server-name localhost | awk '{print "MachineID: " $1}' && printf " _ %.0s" {1..50}; echo && echo -e "\nServices: " && service-control --status --all && echo -e "\nDNS: " && cat /etc/resolv.conf | grep -E "nameserver" && echo -e "\nHost_File:" && cat /etc/hosts && echo -e "\nVMDIR:" && /usr/lib/vmware-vmafd/bin/dir-cli state get --password "$sso_pass" && echo -e "\nShowPartners:" && /usr/lib/vmware-vmdir/bin/vdcrepadmin -f showpartners -h localhost -u administrator -w "$sso_pass" && echo -e "\nShowPartnerStatus:" && /usr/lib/vmware-vmdir/bin/vdcrepadmin -f showpartnerstatus -h localhost -u administrator -w "$sso_pass" && echo -e "\nShowServers:" && /usr/lib/vmware-vmdir/bin/vdcrepadmin -f showservers -h localhost -u administrator -w "$sso_pass" && echo -e "\nPassword: " && chage -l root && echo -e "\nFilesystem: " && df -h && echo -e "\nCertificate: " && for i in $(/usr/lib/vmware-vmafd/bin/vecs-cli store list); do echo STORE $i; sudo /usr/lib/vmware-vmafd/bin/vecs-cli entry list --store $i --text | egrep "Alias|Not After"; done;

 

Execution snippet:

Additional Information

Please note that this command requires the SSO admin password only once