VMware Cloud Community
orian
Hot Shot
Hot Shot

NTP Info from VRO

Hello

how can i find the next ESXI info from VRO:

NTP Service Status

NTP Servers

Current time and date

thank you

Tags (2)
Reply
0 Kudos
1 Reply
iiliev
VMware Employee
VMware Employee

Hi,

var hostServiceSystem = host.configManager.serviceSystem;

hostServiceSystem.refreshServices();

for each (var svc in hostServiceSystem.serviceInfo.service) {

  if (svc.label == "NTP Daemon") {

    System.log("NTP Daemon service found");

    System.log("    is running: " + svc.running);

    break;

  }

}

var dts = host.configManager.dateTimeSystem;

var ntp = dts.dateTimeInfo.ntpConfig;

System.log("NTP servers: "  + ntp.server);

System.log("Current date/time: "  + dts.queryDateTime());