# Heartbeat.config.monitors option not working on 6.5.4?

**URL:** https://discuss.elastic.co/t/heartbeat-config-monitors-option-not-working-on-6-5-4/166755
**Category:** Beats
**Tags:** heartbeat
**Created:** [February 1, 2019, 3:27pm UTC](https://discuss.elastic.co/t/heartbeat-config-monitors-option-not-working-on-6-5-4/166755 "2019-02-01T15:27:14Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [February 1, 2019, 3:27pm UTC](https://discuss.elastic.co/t/heartbeat-config-monitors-option-not-working-on-6-5-4/166755/1 "2019-02-01T15:27:14Z")

</div>

Hello,

I'm trying to use heartbeat to monitor the uptime of some devices and looking into the documentation I saw that is possible to have your monitors in a separated file instead of having them in the main `heartbeat.yml` file.

I created the file `uptime.yml` inside the folder `/etc/heartbeat/monitors.d/` and put my monitors there, each monitor is like the following, and I have thousands of them.

```auto
- type: icmp
  schedule: "* */5 * * * * *"
  hosts: ["host-0001"]

```

On my `heartbeat.yml` I used the following configuration for the monitoring:

```auto
heartbeat.config.monitors:
  path: /etc/heartbeat/monitors.d/*.yml
  reload.enabled: true
  reload.period: 3600s

```

But this does not work, the devices are not being monitored.

If I put the monitors inside `heartbeat.yml` and use `heartbeat.monitors:` as show below, everything works.

```auto
heartbeat.monitors:
- type: icmp
  schedule: "* */5 * * * * *"
  hosts: ["host-0001"]
- type: icmp
  schedule: "* */5 * * * * *"
  hosts: ["host-0002"]
- type: icmp
  schedule: "* */5 * * * * *"
  hosts: ["host-NNNN"]

```

Am I missing something? I just following the documentation provided here [https://www.elastic.co/guide/en/beats/heartbeat/6.5/configuration-heartbeat-options.html](https://www.elastic.co/guide/en/beats/heartbeat/6.5/configuration-heartbeat-options.html)

---

<div class="post-metadata">

### Author: ![Andrew\_Cholakian1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_cholakian1/32/3612_2.png) [@Andrew\_Cholakian1](https://discuss.elastic.co/u/Andrew_Cholakian1)
#### Post date: [February 1, 2019, 4:08pm UTC](https://discuss.elastic.co/t/heartbeat-config-monitors-option-not-working-on-6-5-4/166755/2 "2019-02-01T16:08:30Z")

</div>

Are you sure you meant to use `* */5 * * * * *` as the cron syntax? That will check the monitors once every 5 hours. So, it may take up to 5 hours to see any data. It's probably easier to use Heartbeat's `@every` syntax, where you could write `@every 5m`

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [February 1, 2019, 4:33pm UTC](https://discuss.elastic.co/t/heartbeat-config-monitors-option-not-working-on-6-5-4/166755/3 "2019-02-01T16:33:02Z")

</div>

It's every 5 minutes, not every 5 hours.

It is working when the monitors are on the `heartbeat.yml`, but it does not work when I configure it to use the `heartbeat.config.monitors` and put the monitors on another file.

 ![heartbeat](https://us1.discourse-cdn.com/elastic/original/3X/0/8/08b8269eaee7f7c09625ecc492c34453c11db961.png)

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [February 1, 2019, 8:03pm UTC](https://discuss.elastic.co/t/heartbeat-config-monitors-option-not-working-on-6-5-4/166755/4 "2019-02-01T20:03:14Z")

</div>

Updated heartbeat to 6.6 but had the same problem, if the monitors are on separated files they do not work.

Tested using the path as a reference to path.config, but no change, using quotes or not also made no difference.

```auto
heartbeat.config.monitors:
  path: ${path.config}/monitors.d/*.yml
  reload.enabled: true
  reload.period: 3600s

```

---

<div class="post-metadata">

### Author: ![Andrew\_Cholakian1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_cholakian1/32/3612_2.png) [@Andrew\_Cholakian1](https://discuss.elastic.co/u/Andrew_Cholakian1)
#### Post date: [February 1, 2019, 10:30pm UTC](https://discuss.elastic.co/t/heartbeat-config-monitors-option-not-working-on-6-5-4/166755/5 "2019-02-01T22:30:39Z")

</div>

I've confirmed that 6.6 does work correctly with the given config. The cron config is however incorrect, the first position is minutes, the second position is hours.

Can you give it a shot with a schedule of `@every 5m` or `"*/1 * * * * * *"`

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [February 2, 2019, 3:56pm UTC](https://discuss.elastic.co/t/heartbeat-config-monitors-option-not-working-on-6-5-4/166755/6 "2019-02-02T15:56:00Z")

</div>

I will try to change it to `@every 5m` when I get back to work to see if it solves the problem, but I dont think that the cron expression is wrong, the [documentation](https://www.elastic.co/guide/en/beats/heartbeat/current/heartbeat-configuration.html) even has an example where the first position is seconds.

And as I showed on a previous post, the monitoring is working when I use the monitors on `heartbeat.yml` with `heartbeat.monitors`, but it does not work if I use an external file and use `heartbeat.config.monitors`, that is what I'm trying to understand what is missing.

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [February 4, 2019, 4:59pm UTC](https://discuss.elastic.co/t/heartbeat-config-monitors-option-not-working-on-6-5-4/166755/7 "2019-02-04T16:59:45Z")

</div>

Hello,

I made some tests today and I think I've found the problem.

When using `heartbeat.config.monitors` heartbeat is only loading the configuration after the `reload.period` has elapsed.

On my configuration I was using `reload.period` equal as 3600s, when I changed the `reload.period` to `30s` I saw that the monitors set with the schedule of `@every 5m` started appearing `5m+30s` after heartbeat was started.

As you can see in the prints below, I've started heartbeat at `12:45:03`, so the beats should be triggered on `12:50:03` but they were only triggered at `12:50:33`.

Heartbeat started time print.

 ![hb-01](https://us1.discourse-cdn.com/elastic/original/3X/9/2/9238488aad5b363be280a6bf75998b665ae2aea2.png)

First beat triggered 5m + 30s after heartbeat start time and after that, each 5 minutes.  
 ![hb-02](https://us1.discourse-cdn.com/elastic/original/3X/1/2/12f4692fa34461baf1ae6b5f349a05c537e5e25d.png)

For another test I've changed my `reload.period` to `45s` and could confirm that the configuration is only loadaded after the `reload.period` time has elapsed.

Heartbeat started at `13:20:00`

 ![hb-04](https://us1.discourse-cdn.com/elastic/original/3X/c/6/c61289a2e8cd1d0f83bc2f1393f93361dd4f0b70.png)

First beat after schedule time + `reload.period`  
 ![hb-03](https://us1.discourse-cdn.com/elastic/original/3X/2/6/261fcc72eeb440b25f1b52b575930cfc4157459e.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 4, 2019, 4:59pm UTC](https://discuss.elastic.co/t/heartbeat-config-monitors-option-not-working-on-6-5-4/166755/8 "2019-03-04T16:59:50Z")

</div>

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