VMware Cloud Community
daveclaussen
Enthusiast
Enthusiast
Jump to solution

esxcli system syslog reload

I have quite a few ESXi servers. I am just getting started with centralized logging using Splunk. I have done much research on this issue; if you make any change to syslog configuration values OR if there is ANY break in the communication between the host(s) and the syslog server, the syslog service needs to be reloaded on each ESXi host.

My question; is there a better/easier way for me to restart the syslog service on all of my ESXi hosts, then enabling SSH on each host, SSHing to each host and running the command esxcli system syslog reload?

There has to be a better way.

Thanks all!

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
vSchu
Enthusiast
Enthusiast
Jump to solution

Deploy the vMA. The vMA then connects to the vCenter server and can make these requests to the hosts. You can create a quick script to restart the syslog daemon.

You ssh into vMA but it usess a seperate protocol to talk to your vcenter and hosts. Here is the link to download and documentation.

http://www.vmware.com/support/developer/vima/

Donald Schubot | VCAP5-DCA, VCP4/5 | Blog: http://vschu.com/

View solution in original post

0 Kudos
4 Replies
vSchu
Enthusiast
Enthusiast
Jump to solution

Deploy the vMA. The vMA then connects to the vCenter server and can make these requests to the hosts. You can create a quick script to restart the syslog daemon.

You ssh into vMA but it usess a seperate protocol to talk to your vcenter and hosts. Here is the link to download and documentation.

http://www.vmware.com/support/developer/vima/

Donald Schubot | VCAP5-DCA, VCP4/5 | Blog: http://vschu.com/
0 Kudos
daveclaussen
Enthusiast
Enthusiast
Jump to solution

Thanks vSchu. I downloaded the vMA right after posting this discussion. Thanks for the link to the DOC - I hope it is pretty straight forward (I'm no coder).

0 Kudos
vSchu
Enthusiast
Enthusiast
Jump to solution

I am definately no coder. I need to get into scripting a little more. One thing to look into is vmfp (vm fast pass). This will allow quicker authentication in. So you use the normal esxcli commands but then specifiy the targets. If you wanted to write a loop or script that would do on all your hosts that would be ideal. I am no coder so worst case I put it in a text file on my computer and copy paste in and let it do each host by line.

Good luck!

Donald Schubot | VCAP5-DCA, VCP4/5 | Blog: http://vschu.com/
0 Kudos
markdjones82
Expert
Expert
Jump to solution

Dave,

  You are in luck, i just did this myself.

From the VMA you can populate a file like hosts.txt with all the hostnames and run it against that.  Save this in a file like syslogreload.sh and set chmod u+x or copy and paste the text below /bin/bash once you have hosts.txt populated

#! /bin/bash

for host in $(cat hosts.txt)

do

echo starting $host

esxcli -s $host -u root --password 'pass' system syslog reload

echo $host done

done

In powercli you can do the same like this if connected to Vcenter already and you are comfortable.  You can also change to Get-Datacenter and pipe that.

$cluster = Read-Host "Enter Cluster Name"

foreach ($server in (Get-Cluster $cluster | Get-VMHost | where {$_.ConnectionState -eq "Maintenance"})){
     $esxcli = Get-EsxCli -VMHost $server
     $esxcli = Get-EsxCli
     $esxcli.system.syslog.reload()
}
http://www.twitter.com/markdjones82 | http://nutzandbolts.wordpress.com
0 Kudos