mozilla

Heartbeat monitoring per hostΒΆ

New in version 0.9.

Plugin Name: SandboxFilter
File Name: lua_filters/heartbeat.lua

Heartbeat monitoring per host.

Generates a JSON structure that can be used to create a custom heartbeat dashboard. The output consists of a row per host which includes the host’s last_heartbeat, last_alert and status.

This plugin also sends an alert when the heartbeat_timeout is exceeded and supports alert throttling to reduce noise.

Config:

  • heartbeat_timeout (uint, optional, default 30)

    Sets the maximum duration (in seconds) between heartbeats before an alert is sent.

  • alert_throttle (uint, optional, default 300)

    Sets the minimum duration (in seconds) between alert event outputs.

Example Heka Configuration

[heartbeat]
type = "SandboxFilter"
filename = "lua_filters/heartbeat.lua"
ticker_interval = 30
preserve_data = true
message_matcher = "Type == 'heartbeat'"

  [heartbeat.config]
  heartbeat_timeout = 30
  alert_throttle = 300

[alert-encoder]
type = "SandboxEncoder"
filename = "lua_encoders/alert.lua"

[email-alert]
type = "SmtpOutput"
message_matcher = "Type == 'heka.sandbox-output' && Fields[payload_type] == 'alert'"
send_from = "acme-alert@example.com"
send_to = ["admin@example.com"]
auth = "Plain"
user = "smtp-user"
password = "smtp-pass"
host = "mail.example.com:25"
encoder = "alert"

Example Output

{"ip-10-0-0-11":{"last_heartbeat":1415311858257,"status":"up","last_alert":1415310603648},"ip-10-0-0-187":{"last_heartbeat":1415311856214,"status":"down","last_alert":1415310603648}
Timestamp:2014-05-14T14:20:18Z
Hostname:ip-10-226-204-51
Plugin:heartbeat
Alert:Missing Heartbeat - ip-10-0-0-187