VDT "General Info" check crashed with a script level traceback in the getNtpServers function
Traceback (most recent call last): File "/root/vdt-2.2.6_10-21-2025/lib/vdt_formatter.py", line 339, in run_check check_output = self.run(check, self.username, self.password) File "/root/vdt-2.2.6_10-21-2025/lib/vdt_base.py", line 456, in run return self.safe_execute(item, username, password) File "/root/vdt-2.2.6_10-21-2025/lib/vdt_base.py", line 415, in safe_execute return self.execute_with_timeout(params, username, password) File "/root/vdt-2.2.6_10-21-2025/lib/vdt_base.py", line 260, in wrapper result = func(*args, **kwargs) File "/root/vdt-2.2.6_10-21-2025/lib/vdt_base.py", line 357, in execute_with_timeout return self.execute(*args, **kwargs) File "/root/vdt-2.2.6_10-21-2025/lib/vdt_base.py", line 387, in execute return main_script() File "/root/vdt-2.2.6_10-21-2025/vcenter/vc_scripts/vc_info.py", line 359, in main info = VcInfo() File "/root/vdt-2.2.6_10-21-2025/vcenter/vc_scripts/vc_info.py", line 315, in VcInfo info["ntpservers"] = getNtpServers() File "/root/vdt-2.2.6_10-21-2025/vcenter/vc_scripts/vc_info.py", line 162, in getNtpServers ntpservers.append(line.split()[1]) IndexError: list index out of range
VMware vCenter Server 7.x
Space issue in the NTP configuration file after server detail caused the script to enter a loop and exit with out of range error
To resolve the VDT script parsing error, we need to edit the /etc/ntp.conf file by removing extraneous content, such as empty lines or trailing whitespace.
Please follow these steps:
Backup the configuration file: cp /etc/ntp.conf /etc/ntp.conf_bak
Edit the file: Open the file using vi /etc/ntp.conf and remove any extra spaces or empty lines.
Verify: Ensure the final output matches the expected configuration format shown below.
root@ [ /etc ]# cat ntp.conf
tinker panic 0
restrict default kod nomodify notrap nopeer
restrict 127.0.0.1
restrict -6 ::1
driftfile /var/lib/ntp/drift/ntp.drift
server xx.xx.xx.xx