Step 3: Configure Heartbeat monitors
editStep 3: Configure Heartbeat monitors
editHeartbeat provides monitors to check the status of hosts at set intervals. Heartbeat currently provides monitors for ICMP, TCP, and HTTP (see Heartbeat overview for more about these monitors).
You configure each monitor individually. In heartbeat.yml
, specify the
list of monitors that you want to enable. Each item in the list begins with a
dash (-). The following example configures Heartbeat to use two monitors, an
icmp
monitor and a tcp
monitor:
heartbeat.monitors: - type: icmp schedule: '*/5 * * * * * *' hosts: ["myhost"] - type: tcp schedule: '@every 5s' hosts: ["myhost:12345"] mode: any
The |
|
The |
|
The |
To test your configuration file, change to the directory where the Heartbeat binary
is installed, and run Heartbeat in the foreground with the following options specified:
./heartbeat test config -e
. Make sure your config files are in the path expected by
Heartbeat (see Directory layout), or use the
-c
flag to specify the path to the config file.
For more information about configuring Heartbeat, also see:
- Configure Heartbeat
- Config file format
-
heartbeat.reference.yml
: This reference configuration file shows all non-deprecated options. You’ll find it in the same location asheartbeat.yml
.