Mixed TLS settings support for inputs.gnmi plugin

I need to be able to support devices using different tls settings in the gnmi input plugin. I can make these work separately but since these settings are in the top part of the [inputs.gnmi] config I don’t know how to tell the plugin that I want one group of devices to use tls and another not to.

Here are the sanitized configs

TLS supporting devices
[[inputs.gnmi]]
addresses = [“tls_device:port_num”]
username = “”
password = “”
encoding = “proto”
tls_enable = true
insecure_skip_verify = true
redial = “10s”

None TLS devices
[[inputs.gnmi]]
addresses = [“none_tls_device:port_num”]
username = “”
password = “”
encoding = “proto”
redial = “10s”

If these are comined in one file one setting takes effect it seems to half the devices fail. If I load the configs as 2 files I get a warning that duplicate input names are not supported which makes sense.

How can I make this work? Thank you.

@adamh you should simply create two instances of the GNMI plugin like

[[inputs.gnmi]]
  addresses = [“tls_device:port_num”]
  username = “”
  password = “”
  encoding = “proto”
  tls_enable = true
  insecure_skip_verify = true
  redial = “10s”

  [[inputs.gnmi.subscription]]
    ...
  [[inputs.gnmi.subscription]]
    ...
...

for the TLS devices and

[[inputs.gnmi]]
  addresses = [“none_tls_device:port_num”]
  username = “”
  password = “”
  encoding = “proto”
  redial = “10s”
  [[inputs.gnmi.subscription]]
    ...
  [[inputs.gnmi.subscription]]
    ...
...

for the non-TLS group of devices.

that seems to work - thanks

1 Like