If you are configuring vSphere hosts for syslog collection you may be overwhelmed by the amount of data thrown at your collector. By default hostd and vpxa are configured for a logging level of “verbose.”
To view the configuration for all of your vSphere hosts, break out PowerCLI. I’m forever forgetting how to retrieve information from certain cmdlets and include the host name. Here it is for me to find again:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-VMHost | Sort-Object Name | ForEach-Object { | |
$h = New-Object PSObject -Property @{'Host' = $_.Name} | |
Get-AdvancedSetting -Entity $_ -Name 'Config.HostAgent.log.level','Vpx.Vpxa.config.log.level' | | |
ForEach-Object { | |
Add-Member -InputObject $h -Name $_.Name -Value $_.Value -MemberType NoteProperty | |
} | |
$h | |
} |
Setting hostd and vpxa logging levels on all hosts to “info” is pretty easy:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-VMHost | Get-AdvancedSetting -Name "Config.HostAgent.log.level","Vpx.Vpxa.config.log.level" | | |
Set-AdvancedSetting -Value "info" -Confirm:$false |