Use FQDN hostname
Hi,
Currently telegraf's default behaviour is to use 'os.Hostname()' where no hostname tag is specified. I need this value to be an fqdn name as my servers are grouped by dns zones.
Is that possible to add a "use_fqdn = true or false" option in order to keep compatibility with the current behaviour but enabling to use fqdn names for users needing it ?
Thanks.
Unfortunately Go doesn't appear to natively support getting the FQDN name, so I'm not sure it's possible to support this feature.
Could you use an environment variable as a tag to workaround this?
Hooo... really ???
Its a bit annoying, how can I provide an environment variable to the configuration file ? I found nothing on the documentation to provide variables... In my case it would be something like "var = $(hostname -f)"
I'm suprised that the Go language is not able to provide that :-(
Nope, they need to be env variables, it doesn't call out to shell: https://github.com/influxdata/telegraf/blob/master/etc/telegraf.conf#L12
Ok, i solved it by adding an FQDN variable export on the Systemd script and by overriding the 'hostname' tag with the variable. It's not an elegant solution, but it work... Thanks for your answers.
OK :+1:
photobox-dgo --- do we have same thing for windows?