Skip to content
Nate Levesque edited this page Jan 11, 2016 · 6 revisions

Basics

Heartbeat v2.7.0+

Heartbeat stores its configuration files in /etc/heartbeat/ on Linux and in your Python directory on Windows in ProgramData\Settings\Heartbeat. At a minimum, Heartbeat requires a heartbeat.conf file, which is documented within the file itself.

Plugins can be enabled by adding them to the plugins array in the configuration file. Plugins may use their own configuration files stored in the same directory, which will be documented by the particular plugin they pertain to. A list of provided plugins is available here.

Heartbeat v2.4.0 to v2.6.0 (deprecated versions)

See Migrate from heartbeat.yml for details on how to migrate configuration from older versions to the current setup. See Creating a custom config for your module for additional lower-level information.

Heartbeat has a collection of configuration files located at /etc/heartbeat. These are yaml files with a .conf extension, so be sure to follow standard yaml syntax.

The basic (minimum required) files are below. The collection of configuration files may include additional files required by other heartbeat modules such as additional notifiers or monitors. Files are namespaced when loaded and will not conflict.

/etc/heartbeat/heartbeat.conf

The main configuration options for heartbeat itself. Documentation for these options can be found in comments in the file, which is well-documented.

/etc/heartbeat/notifying.conf

Configuration for notifiers. Some notifiers may use their own configuration file, particularly if they have a lot of configurable options.

/etc/heartbeat/monitoring.conf

Configuration for monitors. Some monitors may use their own configuration file, particularly if they have a lot of configurable options.

Versions below 2.4.0 (archaic versions)

See Migrate from heartbeat.yml for details on how to migrate configuration from older versions to the current setup. It is recommended that you upgrade to the new format.

Heartbeat's configuration file can be located at /etc/heartbeat.yml. This is a yaml file, so be sure to follow the appropriate syntax.

The basic options will be installed with the file. These are:

  • secret_key: This is an identifying string so that heartbeat can identify heartbeats and notifications broadcasted over the network. This is not "secret" so don't use anything too private. All devices that should be able to see each other need to use the same secret key value. Multiple heartbeats can coexist on the same network by using different secret keys.

  • port: The network port heartbeat should use. Similar to the secret key, all devices that should be able to see each other need to use the same port. This setting applies only to heartbeats, histamine notifications are not currently configurable.

  • cache_dir: This can be set to /dev/null if you choose. This is the location that heartbeat should use to cache known heartbeats on disk so the application can persist them between sessions. The location must exist and be accessible to heartbeat (running as root). It is recommended that this be set to a usable location particularly if multiple heartbeats are to be monitored, otherwise there will be a flood of "New Heartbeat" notifications each time heartbeat is started.

  • notifiers: A list of notification/event handlers for heartbeat to pass events to, such as finding or losing a heartbeat. Notifiers are stored in /heartbeat/notifications. The path is automatically prepended to all the configured notifiers.

  • monitors: A list of system monitors that will report back to heartbeat. These will generate events which heartbeat will pass to the configured notifiers. Monitors are stored in /heartbeat/monitoring. The import path is automatically prepended to the configured monitors before importing them.

  • enable_heartbeat: Whether or not the device should broadcast its own heartbeat (it will ignore its own heartbeat if it is also configured to listen)

  • enable_hwmonitor: Enable or disable monitoring. This must be enabled for any monitors to work, otherwise heartbeat will only broadcast a heartbeat (if enabled).

Notifiers

Notification settings are set up per-notifier. These are expected to be in the configuration file as the import path of the notifier. These MUST exist for each enabled notifier that expects them or heartbeat will have trouble when it attempts to handle events.

Monitoring

Configuration of monitors is basically the same as for notifiers. Once again, these must exist in order for heartbeat to work properly if the enabled monitors expect to find settings.