Closed thushjandan closed 11 months ago
@thushjandan I will add some more functionality to the use of env variables, so it possible to define everything related to the fabric(s) as environment variables. https://github.com/opsdis/aci-exporter/releases/tag/v0.6.0
Problem description
Currently, it is only possible to define the connection credentials in the config.yaml file and not over environment variables. Unfortunately, the
UnmarshalKey
method from viper only reads the values from the configuration file althoughviper.AutomaticEnv
method is called at the beginning.Solution
Check if username or password are defined as environment variables. The environment variables are composed by the following pattern:
ACI_EXPORTER_FABRICS_{fabric name}_{USERNAME or PASSWORD}
. The fabric name used in the environment variables must be all upper case and-
symbol will be converted to_
Example
credentials for fabric cisco_sandbox and profile-fabric-01 can be configured as follows: