# Heartbeat list of host help

**URL:** https://discuss.elastic.co/t/heartbeat-list-of-host-help/217415
**Category:** Beats
**Created:** [January 31, 2020, 3:43pm UTC](https://discuss.elastic.co/t/heartbeat-list-of-host-help/217415 "2020-01-31T15:43:03Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![delatucci](https://avatars.discourse-cdn.com/v4/letter/d/258eb7/32.png) [@delatucci](https://discuss.elastic.co/u/delatucci)
#### Post date: [January 31, 2020, 3:43pm UTC](https://discuss.elastic.co/t/heartbeat-list-of-host-help/217415/1 "2020-01-31T15:43:03Z")

</div>

Hi all,

I am trying to configure an icmp.yml file to ping a list of hosts on my network.  
I got it to ping the host that part is working, how do I add name: to the list of host.

- type: icmp  
enabled: true  
schedule: '@every 1m'
# List of hosts to ping
hosts:  
- host1  
- host2  
- etc....

is there a way to add a name so I don't get the unnamed - auto gibberish name in the Kibana dashboard?

thanks

---

<div class="post-metadata">

### Author: ![ropc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ropc/32/47022_2.png) [@ropc](https://discuss.elastic.co/u/ropc)
#### Post date: [February 1, 2020, 1:58am UTC](https://discuss.elastic.co/t/heartbeat-list-of-host-help/217415/2 "2020-02-01T01:58:48Z")

</div>

Hi @delatucci - Welcome to our community forums!

You may want to consider using the following monitors options: [id](https://www.elastic.co/guide/en/beats/heartbeat/master/configuration-heartbeat-options.html#monitor-id) and [name](https://www.elastic.co/guide/en/beats/heartbeat/master/configuration-heartbeat-options.html#monitor-name).

I believe the `auto gibberish name` you are referring to is actually the `id`. Since the `id` is not specified, a generated value will be used (c.f. [documentation](https://www.elastic.co/guide/en/beats/heartbeat/master/configuration-heartbeat-options.html#monitor-id)).

I hope that helps.

---

<div class="post-metadata">

### Author: ![delatucci](https://avatars.discourse-cdn.com/v4/letter/d/258eb7/32.png) [@delatucci](https://discuss.elastic.co/u/delatucci)
#### Post date: [February 5, 2020, 5:01pm UTC](https://discuss.elastic.co/t/heartbeat-list-of-host-help/217415/3 "2020-02-05T17:01:48Z")

</div>

Thank you for your guidance.

I dont expect the great people of the community to do my job for me but can you give me an example of how that yaml file should be laid out. I have tried all different ways, to no success.

---

<div class="post-metadata">

### Author: ![ropc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ropc/32/47022_2.png) [@ropc](https://discuss.elastic.co/u/ropc)
#### Post date: [February 6, 2020, 2:04am UTC](https://discuss.elastic.co/t/heartbeat-list-of-host-help/217415/4 "2020-02-06T02:04:08Z")

</div>

@delatucci - `I have tried all different ways, to no success.` - I am not sure what you have tried and which issue you are facing. Did you include the `id` in option in `heartbeat.yml` file and did you check if the value was correctly indexed? May be you could share with us the `heartbeat.yml` and some documents from your index as well as some screenshots of the issue.

---

<div class="post-metadata">

### Author: ![delatucci](https://avatars.discourse-cdn.com/v4/letter/d/258eb7/32.png) [@delatucci](https://discuss.elastic.co/u/delatucci)
#### Post date: [February 6, 2020, 2:55pm UTC](https://discuss.elastic.co/t/heartbeat-list-of-host-help/217415/5 "2020-02-06T14:55:05Z")

</div>

Again thanks you for your help.

for example, this is what the most recent attempt looks like. please see below - This is the icmp.yml

These files contain a list of monitor configurations identical

# to the heartbeat.monitors section in heartbeat.yml

# The .example extension on this file must be removed for it to

# be loaded.

- type: icmp # monitor type `icmp` (requires root) uses ICMP Echo Request to ping

the heartbeat log has this error in response:  
job err parse icmp://hostname1 name:hostname1: invalid port ":hostname1" after host

I also got this error"  
error invalid config: yaml: line 22: mapping values are not allowed in this context  
when i tried it this way  
hosts:  
-host1  
id: host1

Again any guidance on the correct syntax/structure of how to properly create this file will be greatly appreciated.

---

<div class="post-metadata">

### Author: ![delatucci](https://avatars.discourse-cdn.com/v4/letter/d/258eb7/32.png) [@delatucci](https://discuss.elastic.co/u/delatucci)
#### Post date: [February 6, 2020, 5:24pm UTC](https://discuss.elastic.co/t/heartbeat-list-of-host-help/217415/6 "2020-02-06T17:24:19Z")

</div>

Ok So i got the name to show up in Kibana the way i wanted it to show with this yml config

type: icmp  
name: icmp  
enabled: true  
schedule: '@every 2m'

# List of hosts to ping

hosts: host1  
name: host1

however when i added an additional host like so

type: icmp  
name: icmp  
enabled: true  
schedule: '@every 2m'

# List of hosts to ping

hosts: host1  
name: host1  
hosts: "x.x.x.x"  
name: "host2"

it looks like it stop pinging host 1 and now only pings "x.x.x.x"

\*\*it only shows the last host that was added. \*\*

\*\*\*for example my most recent config file had "x.x.x.x" "y.y.y.y" and "z.z.z.z" now it only show 1 ping top z.z.z.z \*\*\*

I am going to use this discussion to add notes for others in the future that may have this similar issue.

---

<div class="post-metadata">

### Author: ![delatucci](https://avatars.discourse-cdn.com/v4/letter/d/258eb7/32.png) [@delatucci](https://discuss.elastic.co/u/delatucci)
#### Post date: [February 6, 2020, 6:22pm UTC](https://discuss.elastic.co/t/heartbeat-list-of-host-help/217415/7 "2020-02-06T18:22:30Z")

</div>

ok so this is my new icmp.yml file looks like this basically

- type: icmp  
name: icmp  
enable: true  
schedule: '@every 2m'  
hosts: "x.x.x.x"  
name: host1
- type: icmp  
name: icmp  
enable: true  
schedule: '@every 2m'  
hosts: "y.y.y.y"  
name: host2
- type: icmp  
name: icmp  
enable: true  
schedule: '@every 2m'  
hosts: "z.z.z.z"  
name: host3

I couldn't figure out how to do it as a list for example:

hosts:

- "x.x.x.x"  
name: host1
- "y.y.y.y"  
name: host2
- "z.z.z.z"  
name: host3

I think doing it in the list format would be much cleaner and more efficient but I am unable to produce the desired results.

---

<div class="post-metadata">

### Author: ![ropc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ropc/32/47022_2.png) [@ropc](https://discuss.elastic.co/u/ropc)
#### Post date: [February 7, 2020, 1:36am UTC](https://discuss.elastic.co/t/heartbeat-list-of-host-help/217415/8 "2020-02-07T01:36:47Z")

</div>

Thank you for the feedback provided @delatucci. Let me clarify a few things:

1. The `id` and `name` monitor options are **specific to a monitor** (and not to the `hosts`). For example, a valid configuration would be:

```auto
# heartbeat.yml
heartbeat.monitors:
- type: icmp
  id: "my-icmp-monitor-id"
  name: "my-icmp-monitor-name"
  schedule: '*/5 * * * * * *'
  hosts: ["host1,host2,host3"]
heartbeat.scheduler:
  limit: 10

```

1. Within an ICMP monitor, you will not be able to define multiple hosts option. `hosts` can only appear once within the monitor definition and it is an array of hosts to ping. This is why the configuration you mentioned earlier will not work.

2. If you create an ICMP monitor with multiple hosts to ping, this would correspond to a logical grouping and as such, I do not see what would be the benefits of having a separate `id`, `name` for each host.

3. The only way you could achieve what you want (`id`, `name` per monitor per host) would be to define one ICMP monitor for each host. Example of such configuration (not tested):

```auto
# heartbeat.yml
heartbeat.monitors:
- type: icmp
  id: "my-icmp-monitor-id1"
  name: "my-icmp-monitor-name1"
  schedule: '*/5 * * * * * *'
  hosts: ["host1"]
- type: icmp
  id: "my-icmp-monitor-id2"
  name: "my-icmp-monitor-name2"
  schedule: '*/5 * * * * * *'
  hosts: ["host2"]
- type: icmp
  id: "my-icmp-monitor-id3"
  name: "my-icmp-monitor-name3"
  schedule: '*/5 * * * * * *'
  hosts: ["host3"]
heartbeat.scheduler:
  limit: 10

```

I hope that helps.

---

<div class="post-metadata">

### Author: ![delatucci](https://avatars.discourse-cdn.com/v4/letter/d/258eb7/32.png) [@delatucci](https://discuss.elastic.co/u/delatucci)
#### Post date: [February 10, 2020, 5:41pm UTC](https://discuss.elastic.co/t/heartbeat-list-of-host-help/217415/9 "2020-02-10T17:41:16Z")

</div>

Thanks Romain,

What i am trying to do:

I am using the ICMP monitor to ping by ip address  
I want the `id` or `name` to display a Human Readable description of the IP address.  
for example my icmp.yml is as follows

- type: icmp  
name: icmp  
enable: true  
schedule: '@every 2m'  
hosts: "x.x.x.x"  
name: "Printer in John's office"
- type: icmp  
name: icmp  
enable: true  
schedule: '@every 2m'  
hosts: "y.y.y.y"  
name: "switch in conference room A"
- type: icmp  
name: icmp  
enable: true  
schedule: '@every 2m'  
hosts: "z.z.z.z"  
name: "Wireless AP in the cube farm"

and so on and so on.

This has worked so far as looking at the Uptime dashboard now I am able to see the names, however, I haven't learned how to sort it or search by name.

 ![tempsnip](https://us1.discourse-cdn.com/elastic/original/3X/1/e/1edf46bf04506412cfd29a702c4cf610ff3bf6db.png)

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [March 9, 2020, 7:41pm UTC](https://discuss.elastic.co/t/heartbeat-list-of-host-help/217415/10 "2020-03-09T19:41:19Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
