VMware Cloud Community
AlanR
Contributor
Contributor
Jump to solution

How do I configure the following syslog settings via PowerCLI

I am in the process of build ESXi 5.0, and use a lot of PowerCLI to configure the host.

I have used to setup a reote syslog server

Set-VMHostSysLogServer -SysLogServer $SySLog -VMHost "$hostname"

$esxcli= Get-EsxCli

$esxcli.system.syslog.reload()

to apply a new remote syslog server, but I also need to set the following.

but I also need to configure the following.

make the syslog's appear in the Dir equal to the servername. This seems to be a 'True/False' option.

syslog.global.logDirUnique

make a local copy of the syslogs also on a vmfs datastore.

Syslog.global.logDir

can the $esxcli.system. contruct be used to apply these configurations

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Afaik, you can use the Set-VMHostAdvancedConfiguration cmdlet to change those settings.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
5 Replies
LucD
Leadership
Leadership
Jump to solution

Afaik, you can use the Set-VMHostAdvancedConfiguration cmdlet to change those settings.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
AlanR
Contributor
Contributor
Jump to solution

doh, teach me to look to the simple methds first. Thanks

0 Kudos
Kopp
Contributor
Contributor
Jump to solution

Hi ,

following works good for my esxi 5.0 hosts:

Get-VMHost myhost1.local | Get-VMHostFirewallException | where-object {$_.Name -eq  "syslog"} | Set-VMHostFirewallException -Enabled:$true

Get-VMHost myhost1.local | Set-VMHostAdvancedConfiguration -Name Syslog.global.logDirUnique -Value $true

Get-VMHost myhost1.local | Set-VMHostSysLogServer -SysLogServer 10.x.x.x -SysLogServerPort 514

Regards,

Kopp

zomx
Contributor
Contributor
Jump to solution

This thread has been incredibly helpful. Here I was trying to muck around in the ash shell doing stuff with the firewall when PowerCLI already had these cmdlets!!!

0 Kudos
LucD
Leadership
Leadership
Jump to solution

PowerCLI is a gift from heaven for vSphere admins Heart


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos