# Can Telegraf track the uname command from a machine

**URL:** <https://community.influxdata.com/t/can-telegraf-track-the-uname-command-from-a-machine/30379>\
**Category:** Telegraf\
**Tags:** influxdb, telegraf, grafana\
**Created:** [June 21, 2023, 10:23am UTC](https://community.influxdata.com/t/can-telegraf-track-the-uname-command-from-a-machine/30379 "2023-06-21T10:23:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![raviteja.chandika](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/raviteja.chandika/32/13682_2.png) [@raviteja.chandika](https://community.influxdata.com/u/raviteja.chandika)\
**Post date:** [June 21, 2023, 10:23am UTC](https://community.influxdata.com/t/can-telegraf-track-the-uname-command-from-a-machine/30379/1 "2023-06-21T10:23:20Z")

</div>

i added the custom metrics in telegraf configuration as below

## Read the metrics from uname command

```
[[inputs.exec]]
 commands = ["uname -a"]
 timeout = "5s"

```

Now i’m trying the view the uname output in grafana dashboard  
i tried the below query to view the output but i’m not able to view the output of uname command in the grafana dashboard . please help on this

SELECT \* FROM “exec” WHERE “command” = ‘uname -a’

---

<div class="post-metadata">

**Author:** ![jpowers](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jpowers/32/8569_2.png) [@jpowers](https://community.influxdata.com/u/jpowers)\
**Post date:** [June 21, 2023, 1:14pm UTC](https://community.influxdata.com/t/can-telegraf-track-the-uname-command-from-a-machine/30379/2 "2023-06-21T13:14:22Z")

</div>

> view the uname output

The entire output? Or only a part of uname, like the kernel version?

```toml
[[inputs.exec]]
  commands = ["uname -r"]
  timeout = "5s"
  data_format = "value"
  data_type = "string"

```

can produce:

```auto
exec,host=ryzen value="6.3.8-arch1-1" 1687353243000000000

```

---

<div class="post-metadata">

**Author:** ![raviteja.chandika](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/raviteja.chandika/32/13682_2.png) [@raviteja.chandika](https://community.influxdata.com/u/raviteja.chandika)\
**Post date:** [June 22, 2023, 5:22am UTC](https://community.influxdata.com/t/can-telegraf-track-the-uname-command-from-a-machine/30379/3 "2023-06-22T05:22:27Z")

</div>

@jpowers  
i want the entire output .

and how i have to write the query to fetch this uname /any other custom command output in grafana . i’m using influxdb as datasource . please help me on this .

---

<div class="post-metadata">

**Author:** ![srebhan](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/srebhan/32/8572_2.png) [@srebhan](https://community.influxdata.com/u/srebhan)\
**Post date:** [June 26, 2023, 9:38am UTC](https://community.influxdata.com/t/can-telegraf-track-the-uname-command-from-a-machine/30379/4 "2023-06-26T09:38:56Z")

</div>

@raviteja.chandika if you just want the output as a single string (i.e. not split into fields) you can simply replace the `-r` flag in @jpowers example!?!
