Telegraf: inputs.jti_openconfig_telemetry not working

Hello,

I have problems to use telegraf to collect statistics from juniper switches. Using jtimon, all works fine. What I’m doing wrong?

2021-10-13T14:08:49Z I! Starting Telegraf 1.20.2
2021-10-13T14:08:49Z D! [agent] Initializing plugins
2021-10-13T14:08:49Z D! [agent] Starting service inputs
2021-10-13T14:08:49Z D! [inputs.jti_openconfig_telemetry] Opened a new gRPC session to myswitch on port 50051
2021-10-13T14:08:49Z D! [agent] Stopping service inputs
2021-10-13T14:08:49Z E! [inputs.jti_openconfig_telemetry] Error in plugin: could not subscribe to myswitch: rpc error: code = Canceled desc = grpc: the client connection is closing
2021-10-13T14:08:49Z E! [inputs.jti_openconfig_telemetry] Error in plugin: could not subscribe to myswitch: rpc error: code = Canceled desc = grpc: the client connection is closing
2021-10-13T14:08:49Z E! [inputs.jti_openconfig_telemetry] Error in plugin: could not subscribe to myswitch: rpc error: code = Canceled desc = grpc: the client connection is closing
2021-10-13T14:08:49Z E! [inputs.jti_openconfig_telemetry] Error in plugin: could not subscribe to myswitch: rpc error: code = Canceled desc = grpc: the client connection is closing
2021-10-13T14:08:49Z E! [inputs.jti_openconfig_telemetry] Error in plugin: could not subscribe to myswitch: rpc error: code = Canceled desc = grpc: the client connection is closing
2021-10-13T14:08:49Z D! [agent] Input channel closed
2021-10-13T14:08:49Z D! [agent] Processor channel closed
2021-10-13T14:08:49Z D! [agent] Processor channel closed
2021-10-13T14:08:49Z D! [agent] Stopped Successfully
2021-10-13T14:08:49Z E! [telegraf] Error running agent: input plugins recorded 5 errors

config in the myswitch:
set system services extension-service request-response grpc clear-text port 50051
set system services extension-service request-response grpc skip-authentication
set system services extension-service notification allow-clients address 0.0.0.0/0

config for telegraf:

[[inputs.jti_openconfig_telemetry]]
servers = [“myswitch:50051”]

sample_frequency = “60000ms”
username = “”
password = “”
client_id = “mytest”

sensors = [“interfaces /junos/system/linecard/interface/”,
“ifaceDesc /interfaces/interface/state/description/”,
“lsps /junos/services/label-switched-path/usage/”,
“cpu /junos/system/linecard/cpu/memory/”,
“npu /junos/system/linecard/npu/memory/”,
]

str_as_tags = true

Errors received within the same second, so no timeout is happening. As said before, jtimon works fine (GitHub - nileshsimaria/jtimon: Junos Telemetry Interface client)

What’s wrong?

regards,
Hugo

hmm, this might be a race condition with a session close. Does each sensor support the same sample frequency? Could you also add the following lines to the agent. Hopefully, we can gather more context:

 ## Log at debug level.
  debug = true
  ## Log only error level messages.
  quiet = false

This might have to be logged as a bug. I will also check with the plugin contributor.

Tried that, but no difference in the output. Btw: see only a few debug statements in the source code.

I have cleaned up the telegraf config to only one sensor with the same sample_frequency as jtimon but no luck.
Also tried other options: setting enable_tls to true or false as well as insecure_skip_verify to true or false but in all situations no difference in the output…

Hi @hvdort ,
I will log a ticket for you on github and send you the link to follow.