VMware Cloud Community
usmabison
VMware Employee
VMware Employee

Set up syslog for vcsa using powercli

Greetings Folks!

I cant seem to find any code for configuring the vcsa to send logs to a remote syslog server. Found plenty for sending esxi logs to an external syslog. Couldn't find it for VCSA. Am I missing something? It is configured through the VAMI (interactively). Looking for programmatic configuration ...

VCSA Version 7U2

0 Kudos
3 Replies
LucD
Leadership
Leadership

You need to use the REST API.
The parameter holding the syslog server(s) needs to be a List.

# Connect to CIS server (if not done yet)
#Connect-CisServer -Server vcsa.fqdn

$log = Get-CisService -name 'com.vmware.appliance.logging.forwarding'
$cfglist = [System.Collections.Generic.List[PSObject]]::new()
$spec = @{
    hostname="syslogserver.fqdn"
    port=514
    protocol="UDP"
}
$cfglist.add($spec)
$log.set($cfglist)

# To verify the setting
$log.get()


 


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

usmabison
VMware Employee
VMware Employee

Thx Luc! I will give it a go ...

Incidentally, do you know if this can be found in any of our documentation (like an SDK or something that I missed in my looking for this)?

For future reference ...

0 Kudos
LucD
Leadership
Leadership

In  vSphere Automation APIs (vmware.com)  under Appliance REST APIs


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