diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index c1b5f38c045..74511b91213 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -352,6 +352,7 @@ https://github.com/elastic/beats/compare/v6.4.0...v6.5.0[View commits] - Added support for extra TLS/x509 metadata. {pull}7944[7944] - Added stats and state metrics for number of monitors and endpoints started. {pull}8621[8621] - Add last monitor status to dashboard table. Further break out monitors in dashboard table by monitor.ip. {pull}9022[9022] +- Add central management support. {pull}9254[9254] *Journalbeat* diff --git a/heartbeat/beater/heartbeat.go b/heartbeat/beater/heartbeat.go index d494b555f62..162f4870bde 100644 --- a/heartbeat/beater/heartbeat.go +++ b/heartbeat/beater/heartbeat.go @@ -30,7 +30,9 @@ import ( "github.com/elastic/beats/libbeat/beat" "github.com/elastic/beats/libbeat/cfgfile" "github.com/elastic/beats/libbeat/common" + "github.com/elastic/beats/libbeat/common/reload" "github.com/elastic/beats/libbeat/logp" + "github.com/elastic/beats/libbeat/management" ) // Heartbeat represents the root datastructure of this beat. @@ -82,6 +84,10 @@ func (bt *Heartbeat) Run(b *beat.Beat) error { return err } + if b.ConfigManager.Enabled() { + bt.RunCentralMgmtMonitors(b) + } + if bt.config.ConfigMonitors.Enabled() { bt.monitorReloader = cfgfile.NewReloader(b.Publisher, bt.config.ConfigMonitors) defer bt.monitorReloader.Stop() @@ -127,6 +133,12 @@ func (bt *Heartbeat) RunStaticMonitors(b *beat.Beat) error { return nil } +// RunCentralMgmtMonitors loads any central management configured configs. +func (bt *Heartbeat) RunCentralMgmtMonitors(b *beat.Beat) { + monitors := cfgfile.NewRunnerList(management.DebugK, bt.dynamicFactory, b.Publisher) + reload.Register.MustRegisterList(b.Info.Beat+".monitors", monitors) +} + // RunReloadableMonitors runs the `heartbeat.config.monitors` portion of the yaml config if present. func (bt *Heartbeat) RunReloadableMonitors(b *beat.Beat) (err error) { // Check monitor configs diff --git a/libbeat/docs/shared-central-management.asciidoc b/libbeat/docs/shared-central-management.asciidoc index d76d61dbb95..f2095ca2c57 100644 --- a/libbeat/docs/shared-central-management.asciidoc +++ b/libbeat/docs/shared-central-management.asciidoc @@ -56,6 +56,8 @@ environment. The `development` tag might have: another that reads metrics from Apache HTTP servers * Two Filebeat module configuration blocks: one that reads Apache HTTP server logs and another that reads system logs +* One heartbeat monitor configuration block: checks that a public facing website +is live. * One Elasticsearch output configuration block that sends the output to your {es} development cluster