Configure Syslog for VMware ESXi via vMA

I had originally written a post on doing this via PowerCLI and decided to add a post about using the VMware Management Assistant instead.

I did this with both vMA 5.5 and vMA 6.0 to confirm my script-fu.

VMware ESXi supports syslog over both TCP and UDP (most common). Centralized logging is a huge win when debugging problems and there are many ways to do this. One commercial package is Sumo Logic and is something I recommend highly.

This script also has the benefit of changing the logging level from verbose to info which will cut the amount of logging being sent to your syslog server. You can always reset it later if you are doing deep debugging.


#Update the following 3 variables.
# protocol: udp - the most common for syslog
# syslog server: destination server for syslog
# syslog port: 514 - the normal port for syslog. ESXi firewall also allows port 1514


# set this to the server names you would like to update.


# Your vCenter system


# log into vCenter so we don't have to enter credentials all the time

vifptarget --set ${VCENTER}

# loop over ESXIHOSTNAMES and set the syslog destination

for i in ${ESXIHOSTNAMES}; do
  esxcfg-advcfg --vihost ${i} -set "${SYSLOGPROTO}://${SYSLOGSERVER}:{SYSLOGPORT}"

And that’s it.