Is it possible to use multiple items in a single environment variable seperated by something for an input plugin (i.e. snmp)? I found this github link but it was very old and didn’t have mention if this was implemented or not? We have a script that goes through and test devices if they ping and what product they are but are trying to get that into something that can be used by telegraf for polling.
opened 08:52PM - 27 Dec 18 UTC
closed 09:35PM - 27 Dec 18 UTC
### Relevant telegraf.conf:
[[inputs.ping]]
urls = ["$FQDN_LIST"]
### Rel… evant environment variable:
FQDN_LIST="google.com"
### System info:
Docker 18.09, running on Windows 10
### Steps to reproduce:
1. Set the environment variable FQDN_LIST="google.com"
2. Set telegraf.conf ping plugin as noted above
3. Run telegraf
### Expected behavior:
The environment variable should expand in the IP list as urls = ["google.com"], as printenv FQDN_LIST reports "google.com" for the environment variable. Thus, telegraf should be pinging google.com.
### Actual behavior:
[inputs.ping]: Error in plugin: lookup "google.com": no such host
### Additional info:
I'm running into this through a Docker Compose exercise in which I'm trying to build a Docker App that starts up a TICK stack with next to no manual configuration on the part of the end user, assuming the end user is running a Windows environment. I've written a rudimentary GUI tool to write a .env file that is imported when the composition is brought up, which includes setting FQDN_LIST and using it in the ping module.
I've considered that perhaps environment variables can't be used with the plugins, but Telegraf is reporting what I believe to be a correctly expanded variable. As the variable is a string, if I remove the quotes (thinking here that maybe it's a double quotes issue?) telegraf exits at startup and using single quotes prevents the variable from expanding, so I'm at a loss here on what to do to get this to work correctly, sans rewriting my configuration tool to output an entire telegraf.conf instead of breaking the config down into smaller individual files.