Automation

 View Only
  • 1.  How do I configure the following syslog settings via PowerCLI

    Posted Jan 10, 2012 11:32 AM

    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



  • 2.  RE: How do I configure the following syslog settings via PowerCLI
    Best Answer

    Posted Jan 10, 2012 11:53 AM

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



  • 3.  RE: How do I configure the following syslog settings via PowerCLI

    Posted Jan 10, 2012 12:09 PM

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



  • 4.  RE: How do I configure the following syslog settings via PowerCLI

    Posted Mar 26, 2012 01:23 PM

    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



  • 5.  RE: How do I configure the following syslog settings via PowerCLI

    Posted Mar 30, 2012 06:39 PM

    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!!!



  • 6.  RE: How do I configure the following syslog settings via PowerCLI

    Posted Mar 30, 2012 07:42 PM

    PowerCLI is a gift from heaven for vSphere admins :heart: