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.
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
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.
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 * * * * * *"
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 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.
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.
First beat triggered 5m + 30s after heartbeat start time and after that, each 5 minutes.
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.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.