As part of the ESXi health check, we need to ensure the scratch location and syslog server has been configured correctly. Here is my script to check the settings:
$VMHost = Get-Content C:\powercli\Servers.txt
Foreach ($_ in $VMHost) {
$Scratch = Get-VMHostAdvancedConfiguration -VMHost $_ -Name ScratchConfig.ConfiguredScratchLocation
$SyslogServer = Get-VMHostAdvancedConfiguration -VMHost $_ -Name syslog.global.loghost
$SyslogDir = Get-VMHostAdvancedConfiguration -VMHost $_ -Name syslog.global.logDir
Write-Host $_ “|Scratch_Location:” $Scratch.Values ” |Syslog_Server:” $SyslogServer.Values ” |Syslog_Dir:” $SyslogDir.Values
}
The results look this:
vmhost-01.rcau.org.au |Scratch_Location: /vmfs/volumes/4f7a9ded-b8f5c9e2-fb7a-5cf3fcad2cab/.locker-vmhost-01 |Syslog_Server: udp://Syslog-01:514 |Syslog_Dir:
vmhost-02.rcau.org.au |Scratch_Location: /vmfs/volumes/4f7a9ded-b8f5c9e2-fb7a-5cf3fcad2cab/.locker-vmhost-02 |Syslog_Server: udp://Syslog-01:514 |Syslog_Dir:
vmhost-03.rcau.org.au |Scratch_Location: /vmfs/volumes/4f7a9ded-b8f5c9e2-fb7a-5cf3fcad2cab/.locker-vmhost-03 |Syslog_Server: udp://Syslog-01:514 |Syslog_Dir:
Excellent script! Thanks for sharing