PowerCLI: Check ESXi Scratch Location and Syslog Server Settings


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:

 

How to change the scratch location?

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s