Telegraf - 16.3 inputs.gnmi

Hello All,

Newbie to telegraf and telemetry here.

I have 2 issues.
1) Telegraf is not actively running .
systemctl status telegraf is giving me the following error message,

● telegraf.service - The plugin-driven server agent for reporting metrics into InfluxDB

  • Loaded: loaded (/usr/lib/systemd/system/telegraf.service; enabled; vendor preset: disabled)*
  • Active: failed (Result: start-limit) since Fri 2020-12-04 00:41:16 CST; 39min ago*
  • Docs: https://github.com/influxdata/telegraf*
    
  • Process: 1730 ExecStart=/usr/bin/telegraf -config /etc/telegraf/telegraf.conf -config-directory /etc/telegraf/telegraf.d $TELEGRAF_OPTS (code=exited, status=1/FAILURE)*
  • Main PID: 1730 (code=exited, status=1/FAILURE)*

Dec 04 00:41:16 sanarra-centos7-wf1 systemd[1]: telegraf.service: main process exited, code=exited, status=1/FAILURE
Dec 04 00:41:16 sanarra-centos7-wf1 systemd[1]: Unit telegraf.service entered failed state.
Dec 04 00:41:16 sanarra-centos7-wf1 systemd[1]: telegraf.service failed.
Dec 04 00:41:16 sanarra-centos7-wf1 systemd[1]: telegraf.service holdoff time over, scheduling restart.
Dec 04 00:41:16 sanarra-centos7-wf1 systemd[1]: Stopped The plugin-driven server agent for reporting metrics into InfluxDB.
Dec 04 00:41:16 sanarra-centos7-wf1 systemd[1]: start request repeated too quickly for telegraf.service
Dec 04 00:41:16 sanarra-centos7-wf1 systemd[1]: Failed to start The plugin-driven server agent for reporting metrics into InfluxDB.
Dec 04 00:41:16 sanarra-centos7-wf1 systemd[1]: Unit telegraf.service entered failed state.
Dec 04 00:41:16 sanarra-centos7-wf1 systemd[1]: telegraf.service failed.

2) when I run telegraf --test, it is giving invalid subscription mode
When I run telegraf --test it gives the following error message.

2020-12-04T06:56:31Z I! Starting Telegraf 1.16.3
2020-12-04T06:56:31Z I! Using config file: /etc/telegraf/telegraf.conf
2020-12-04T06:56:31Z E! [agent] Starting input inputs.gnmi: invalid subscription mode

on the telegraf.conf, file, I see the below config,

[[inputs.gnmi]]

  • #Address and port of the GNMI GRPC server*
  • addresses = [“a.b.c.d:50051”]*
  • username = “admin”*
  • password = “admin”*
  • redial = “10s”*

[[inputs.gnmi.subscription]]

  • name = “Telemetry-Demo”*
  • origin = “openconfig”*
  • path = “/interfaces/interface/state/counters”*

Can anyone help me get past these hurdle’s?

Thanks in advance
/Satya Narra

Looks like you’re not including subscription_mode in the settings, which is a required field. Here’s the relevant section from the GNMI plugin docs:

# Subscription mode (one of: "target_defined", "sample", "on_change") and interval

subscription_mode = “sample”
sample_interval = “10s”

1 Like

Thanks @ssoroka

I made the following change,

[[inputs.gnmi.subscription]]

  • Name of the measurement that will be emitted*

  • name = “Telemetry-Demo”*

  • Origin and path of the subscription*

  • origin = “openconfig”*

  • path = “/interfaces/interface/state/counters”*

  • subscription_mode = “sample”*

  • sample_interval = “10s”*

and it seems to be working now.

[root@sanarra-centos7-wf1 telegraf]# telegraf --test
2020-12-04T20:33:43Z I! Starting Telegraf 1.16.3
2020-12-04T20:33:43Z I! Using config file: /etc/telegraf/telegraf.conf
Appreciate your help!!!

That resolved my first issue as well. (just had to restart the service).

Thanks for your help