This script is used to check ports from the sddc manager such as nsx-t manager, nsx-t edges, vcenter, esxi host and sddc manager connectivity. Usually you would use this when you first deploy vcf or your planning an upgrade just to make sure everything is open. You can modify the script to suite your need. The VMware ports website can be found from ports.vmware.com
- PRE-WORK
- ssh on nsx t and edge
- vcenter bash shell on all vcenters chsh -s /bin/bash root
- ssh finger prints on sddc manager “made a connection previously”
- run from sddc manager script
- create a file with an .sh extension and include the below content update ips and passwords at start of script
- to run bash ./check.sh from sddc manager cli
#!/bin/bash
## AMEND LIST OF IPS BASED ON ENVIRONMENT ##
## VMware Appliances
NSXT_MANAGERS=(IP IP IP)
NSXT_EDGES=(IP IP IP)
ESXI_HOSTS=(IP IP IP IP)
VCENTERS=(IP IP IP)
SDDC_MANAGER=IP
## DNS and NTP Servers
DNS_SERVERS=(IP IP IP)
NTP_SERVERS=(IP IP IP)
## VMware Passwords
NSXT_PASSWORD='PASSWORDHERE'
ESXI_PASSWORD='PASSWORDHERE'
VCENTER_PASSWORD='PASSWORDHERE'
###################### PART 1 ##########################
echo "------------------------------------------"
echo "NSX-T Manager to NSX-T Manager - Port 8080"
echo "------------------------------------------"
for i in ${!NSXT_MANAGERS[@]}
do
for j in ${!NSXT_MANAGERS[@]}
do
echo -e "\nFROM ${NSXT_MANAGERS[$i]} TO ${NSXT_MANAGERS[$j]}"
sshpass -p $NSXT_PASSWORD ssh root@${NSXT_MANAGERS[$i]} "curl -v -s -t 'DUMMY=1' --connect-timeout 2 telnet://${NSXT_MANAGERS[$j]}:8080"
done
done
echo "------------------------------------------"
echo "NSX-T Edge to NSX-T Manager - Port 8080"
echo "------------------------------------------"
for i in ${!NSXT_EDGES[@]}
do
for j in ${!NSXT_MANAGERS[@]}
do
echo -e "\nFROM ${NSXT_EDGES[$i]} TO ${NSXT_MANAGERS[$j]}"
sshpass -p $NSXT_PASSWORD ssh root@${NSXT_EDGES[$i]} "curl -v -s -t 'DUMMY=1' --connect-timeout 2 telnet://${NSXT_MANAGERS[$j]}:8080"
done
done
echo "------------------------------------------"
echo "vCenter to NSX-T Manager - Port 8080"
echo "------------------------------------------"
for i in ${!VCENTERS[@]}
do
for j in ${!NSXT_MANAGERS[@]}
do
echo -e "\nFROM ${VCENTERS[$i]} TO ${NSXT_MANAGERS[$j]}"
sshpass -p $VCENTER_PASSWORD ssh -o PubkeyAuthentication=no root@${VCENTERS[$i]} "curl -v -s -t 'DUMMY=1' --connect-timeout 2 telnet://${NSXT_MANAGERS[$j]}:8080"
done
done
echo "------------------------------------------"
echo "ESXi to NSX-T Manager - Port 8080 & 443"
echo "------------------------------------------"
for i in ${!ESXI_HOSTS[@]}
do
for j in ${!NSXT_MANAGERS[@]}
do
echo -e "\nFROM ${ESXI_HOSTS[$i]} TO ${NSXT_MANAGERS[$j]}"
sshpass -p $ESXI_PASSWORD ssh root@${ESXI_HOSTS[$i]} "nc -zv ${NSXT_MANAGERS[$j]} 8080 -w 3; nc -zv ${NSXT_MANAGERS[$j]} 443 -w 3"
done
done
echo "------------------------------------------"
echo "vCenter to ESXi Hosts - Port 80 & 443"
echo "------------------------------------------"
for i in ${!VCENTERS[@]}
do
for j in ${!ESXI_HOSTS[@]}
do
echo -e "\nFROM ${VCENTERS[$i]} TO ${ESXI_HOSTS[$j]}"
sshpass -p $VCENTER_PASSWORD ssh -o PubkeyAuthentication=no root@${VCENTERS[$i]} "curl -v -s -t 'DUMMY=1' --connect-timeout 2 telnet://${ESXI_HOSTS[$j]}:80; curl -v -s -t 'DUMMY=1' --connect-timeout 2 telnet://${ESXI_HOSTS[$j]}:443;"
done
done
###################### PART 2 ##########################
echo "-------------------------------------------------"
echo "SDDC Manager to NSX-T Edges - TCP Port 22 & 443"
echo "-------------------------------------------------"
for j in ${!NSXT_EDGES[@]}
do
echo -e "\nFROM SDDC Manager TO ${NSXT_EDGES[$j]}"
curl -v -s -t 'DUMMY=1' --connect-timeout 2 telnet://${NSXT_EDGES[$j]}:22
curl -v -s -t 'DUMMY=1' --connect-timeout 2 telnet://${NSXT_EDGES[$j]}:443
done
echo "----------------------------------------------------"
echo "SDDC Manager to NSX-T Managers - TCP Port 22 & 443"
echo "----------------------------------------------------"
for j in ${!NSXT_MANAGERS[@]}
do
echo -e "\nFROM SDDC Manager TO ${NSXT_MANAGERS[$j]}"
curl -v -s -t 'DUMMY=1' --connect-timeout 2 telnet://${NSXT_MANAGERS[$j]}:22
curl -v -s -t 'DUMMY=1' --connect-timeout 2 telnet://${NSXT_MANAGERS[$j]}:443
done
echo "---------------------------------------------------------"
echo "SDDC Manager to vCenters - TCP Port 22, 443, 5480 & 7444"
echo "---------------------------------------------------------"
for j in ${!VCENTERS[@]}
do
echo -e "\nFROM SDDC Manager TO ${NSXT_MANAGERS[$j]}"
curl -v -s -t 'DUMMY=1' --connect-timeout 2 telnet://${VCENTERS[$j]}:22
curl -v -s -t 'DUMMY=1' --connect-timeout 2 telnet://${VCENTERS[$j]}:443
curl -v -s -t 'DUMMY=1' --connect-timeout 2 telnet://${VCENTERS[$j]}:5480
curl -v -s -t 'DUMMY=1' --connect-timeout 2 telnet://${VCENTERS[$j]}:7444
done
echo "----------------------------------------------------"
echo "SDDC Manager to ESXi Hosts - TCP Port 22 & 443"
echo "----------------------------------------------------"
for j in ${!ESXI_HOSTS[@]}
do
echo -e "\nFROM SDDC Manager TO ${ESXI_HOSTS[$j]}"
curl -v -s -t 'DUMMY=1' --connect-timeout 2 telnet://${ESXI_HOSTS[$j]}:22
curl -v -s -t 'DUMMY=1' --connect-timeout 2 telnet://${ESXI_HOSTS[$j]}:443
done
echo "-------------------------------------------------------------------------"
echo "ESXi to SDCC Manager - TCP/UDP Port - 4045, 32766, 32767, 2049, 111, 123"
echo "-------------------------------------------------------------------------"
for i in ${!ESXI_HOSTS[@]}
do
echo -e "\nFROM ${ESXI_HOSTS[$i]} TO SDDC Manager"
sshpass -p $ESXI_PASSWORD ssh root@${ESXI_HOSTS[$i]} "nc -zv $SDDC_MANAGER 4045 -w 3; nc -zuv $SDDC_MANAGER 4045 -w 3; nc -zv $SDDC_MANAGER 32766 -w 3; nc -zuv $SDDC_MANAGER 32766 -w 3; nc -zv $SDDC_MANAGER 32767 -w 3; nc -zuv $SDDC_MANAGER 32767 -w 3; nc -zv $SDDC_MANAGER 2049 -w 3; nc -zuv $SDDC_MANAGER 2049 -w 3; nc -zv $SDDC_MANAGER 111 -w 3; nc -zuv $SDDC_MANAGER 111 -w 3; nc -zv $SDDC_MANAGER 123 -w 3; nc -zuv $SDDC_MANAGER 123 -w 3;"
done
echo "----------------------------------------------------"
echo "SDCC Manager TO DNS SERVERS - TCP/UDP Port 53"
echo "----------------------------------------------------"
for j in ${!DNS_SERVERS[@]}
do
echo -e "\nFROM SDDC Manager TO ${DNS_SERVERS[$j]}"
curl -v -s -t 'DUMMY=1' --connect-timeout 2 telnet://${DNS_SERVERS[$j]}:53
echo "UDP TEST OUTPUT:"
(echo > /dev/udp/${DNS_SERVERS[$j]}/53) >/dev/null 2>&1 && echo "It's up" || echo "It's down"
done
echo "----------------------------------------------------"
echo "SDCC Manager TO NTP SERVERS - TCP/UDP Port 123"
echo "----------------------------------------------------"
for j in ${!NTP_SERVERS[@]}
do
echo -e "\nFROM SDDC Manager TO ${NTP_SERVERS[$j]}"
curl -v -s -t 'DUMMY=1' --connect-timeout 2 telnet://${NTP_SERVERS[$j]}:123
echo "UDP TEST OUTPUT:"
(echo > /dev/udp/${NTP_SERVERS[$j]}/123) >/dev/null 2>&1 && echo "It's up" || echo "It's down"
done
echo "----------------------------------------------------"
echo "SDCC Manager ping test to all VMware Components"
echo "----------------------------------------------------"
ALL_COMPONENTS=(${NSXT_MANAGERS[@]} ${NSXT_EDGES[@]} ${ESXI_HOSTS[@]} ${VCENTERS[@]})
for component in ${ALL_COMPONENTS[@]}
do
ping $component -c 3
done
Special thanks to Thanesh Pannirselvam for the hard work done on this script.