# Telegraf - 16.3 inputs.gnmi

**URL:** <https://community.influxdata.com/t/telegraf-16-3-inputs-gnmi/17082>\
**Category:** Telegraf\
**Tags:** influxdb, telegraf, grafana\
**Created:** [December 4, 2020, 7:26am UTC](https://community.influxdata.com/t/telegraf-16-3-inputs-gnmi/17082 "2020-12-04T07:26:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sanarra](https://avatars.discourse-cdn.com/v4/letter/s/ac91a4/32.png) [@sanarra](https://community.influxdata.com/u/sanarra)\
**Post date:** [December 4, 2020, 7:26am UTC](https://community.influxdata.com/t/telegraf-16-3-inputs-gnmi/17082/1 "2020-12-04T07:26:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ssoroka](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/ssoroka/32/6154_2.png) [@ssoroka](https://community.influxdata.com/u/ssoroka)\
**Post date:** [December 4, 2020, 6:48pm UTC](https://community.influxdata.com/t/telegraf-16-3-inputs-gnmi/17082/2 "2020-12-04T18:48:10Z")

</div>

> [@sanarra](#):
>
> _[[inputs.gnmi.subscription]]_
> 
> - name = “Telemetry-Demo”\*
> - origin = “openconfig”\*
> - path = “/interfaces/interface/state/counters”\*

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”

---

<div class="post-metadata">

**Author:** ![sanarra](https://avatars.discourse-cdn.com/v4/letter/s/ac91a4/32.png) [@sanarra](https://community.influxdata.com/u/sanarra)\
**Post date:** [December 4, 2020, 8:36pm UTC](https://community.influxdata.com/t/telegraf-16-3-inputs-gnmi/17082/3 "2020-12-04T20:36:08Z")

</div>

> [@ssoroka](#):
>
> ```auto
> # Subscription mode (one of: "target_defined", "sample", "on_change") and interval
> 
> ```
> 
> subscription\_mode = “sample”  
> sample\_interval = “10s”

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
