VMware Cloud Community
stoebes0774
Contributor
Contributor

syslog location to esxi hostname

Anyone who know`s an easy way to setup remote syslog collector, so that the folders isn`t named with the ip address of the host, but with the FQDN or just hostname of the ESX server..???

Tags (1)
Reply
0 Kudos
11 Replies
memaad
Virtuoso
Virtuoso

Hi,

Welcome to Community.

Here is VMware blog for confuguring  syslog

http://blogs.vmware.com/vsphere/2011/07/setting-up-the-esxi-syslog-collector.html

KB http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=200332...

Regards

Mohammed

Mohammed | Mark it as helpful or correct if my suggestion is useful.
Reply
0 Kudos
stoebes0774
Contributor
Contributor

Hi Mohammed.

Thanks for the answer. I have already seen these articles.

But what i am searching for is a way to get the logs organised by hostname instead of ip address.

I have tried to use Syslog.global.logDirUnique, but as i see it, it has to be set in conjunction with Syslog.global.logDir.

But how is the syntax, when it is a remote windows server that is syslog collector..??

Ind if i just set Syslog.global.logDirUnique without the other options, it still places the logs in a folder named ip address of ESX server.

Reply
0 Kudos
VirtualPoSH
Contributor
Contributor

Hello all,

I am also facing this same issue.  I have successfully configured vCenter Syslog, and all hosts are successfully logging into Unique Directories on my vCenter Syslog server.  The issue I am facing is that the folder structure under the \Data directory is using the hosts IP address as the folder name vs. using the hostname of the ESXi host.  I have looked at the XML configuration file held at C:\ProgramData\VMware\VMware Syslog Collector\vmconfig-syslog.xml; but cannot find a way to change the logging folders to use hostname instead of IP address.

vCenter_Syslog_Directories_IPAddress.jpg

Any help that can be offered is appreciated!

-VirtualPoSH

Reply
0 Kudos
SleeW
Contributor
Contributor

I have exactly the same problem... and no solution!

Anyone?

Reply
0 Kudos
TheAbstract
Enthusiast
Enthusiast

You could present a share from a Windows box to your hosts as an NFS datastore, then change the syslog.global.logdir and the syslog.global.logdirunique settings. That'd get the syslogs off your hosts into folders with the hostnames.

I got 99 problems and a vSwitch ain't one.
Reply
0 Kudos
SleeW
Contributor
Contributor

Good solution, very clever! Smiley Happy

thx

Reply
0 Kudos
cfresqui
Enthusiast
Enthusiast

I managed to put a 'proper' syslog server in a Windows machine with cygwin. As soon as the server resolve the ESX address, the syslog saves the logs in a hostname folder, instead of ip address.. the doc is here: http://communities.vmware.com/docs/DOC-20337 - it's in portuguese but you can translate it very easy.

Cesar Fresqui VCAP-DCA Por favor, não esqueça de atribuir os pontos se a resposta foi útil ou resolveu o problema. Thank you/Obrigado
Reply
0 Kudos
Shockvolt
Contributor
Contributor

Update for anyone that comes across this... In vSphere client, go to Configuration tab, Advanced Settings, Syslog, and check the Syslog.global.logDirUnique checkbox.

pastedImage_1.png

Reply
0 Kudos
BrowardDave
Contributor
Contributor

Has anyone found a fix for this?  I am getting a mix of IP's and Host Names in my syslog collector directory.  I can't seem to find where the difference is between hosts.  I am using a Windows based vCenter 6 server with the default syslog collector directory.  All host are setup in the same way using host profiles, but some show up as IP and some show up as Host name.

Smiley Sad

Reply
0 Kudos
Jumpos
Contributor
Contributor

Hello.

If you have a Windows-based Syslog server and want that syslog directory being created with the host name instead of IP-address  you must do this:

1. Go to Advanced settings and clear Syslog.global.logHost option.

2. Then go to Configuration-->DNS and Routing-->Host Identification-->Domain and type you domain name here.

pastedImage_11.png

3. Then repeat actions from this kb: Configuring syslog on ESXi (2003322) | VMware KB

Reply
0 Kudos
virtualDD
Enthusiast
Enthusiast

I thought I'd give my two cents here as well. I have had a customer with the same problem and we just wrote a small script that created links to the ip address folders and the link itself is the hostname. kind of like the symbolic link you have on linux or esxi (/vmfs/volumes/).

If anyone is interested in this approach I'm sure I can find the script somewhere in our archive.

Reply
0 Kudos