diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 6a28c321add7..a51fd81db0f6 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -261,6 +261,7 @@ https://github.com/elastic/beats/compare/v6.0.0-beta2...master[Check the HEAD di - Add experimental module to collect metrics from munin nodes. {pull}6517[6517] - Add support for wildcards and explicit metrics grouping in jolokia/jmx. {pull}6462[6462] - Set `collector` as default metricset in Prometheus module. {pull}6636[6636] +- Set default metricsets in vSphere module. {pull}6676[6676] *Packetbeat* diff --git a/metricbeat/docs/modules/vsphere.asciidoc b/metricbeat/docs/modules/vsphere.asciidoc index 689a19662fb1..824d8b583dd5 100644 --- a/metricbeat/docs/modules/vsphere.asciidoc +++ b/metricbeat/docs/modules/vsphere.asciidoc @@ -9,6 +9,7 @@ beta[] The vSphere module uses the https://github.com/vmware/govmomi[Govmomi] library to collect metrics from any Vmware SDK URL (ESXi/VCenter). This library is built for and tested against ESXi and vCenter 5.5, 6.0 and 6.5. +By default it enables the metricsets `datastore`, `host` and `virtualmachine`. [float] @@ -21,7 +22,6 @@ in <>. Here is an example configuration: ---- metricbeat.modules: - module: vsphere - metricsets: ["datastore", "host", "virtualmachine"] period: 10s hosts: ["https://localhost/sdk"] diff --git a/metricbeat/metricbeat.reference.yml b/metricbeat/metricbeat.reference.yml index c2d081c90cb4..73d26d2e3f3b 100644 --- a/metricbeat/metricbeat.reference.yml +++ b/metricbeat/metricbeat.reference.yml @@ -477,6 +477,7 @@ metricbeat.modules: #------------------------------- vSphere Module ------------------------------ - module: vsphere + enabled: true metricsets: ["datastore", "host", "virtualmachine"] period: 10s hosts: ["https://localhost/sdk"] @@ -487,7 +488,6 @@ metricbeat.modules: insecure: false # Get custom fields when using virtualmachine metric set. Default false. # get_custom_fields: false - #------------------------------- Windows Module ------------------------------ - module: windows diff --git a/metricbeat/module/vsphere/_meta/config.reference.yml b/metricbeat/module/vsphere/_meta/config.reference.yml new file mode 100644 index 000000000000..d4803d0c7753 --- /dev/null +++ b/metricbeat/module/vsphere/_meta/config.reference.yml @@ -0,0 +1,12 @@ +- module: vsphere + enabled: true + metricsets: ["datastore", "host", "virtualmachine"] + period: 10s + hosts: ["https://localhost/sdk"] + + username: "user" + password: "password" + # If insecure is true, don't verify the server's certificate chain + insecure: false + # Get custom fields when using virtualmachine metric set. Default false. + # get_custom_fields: false diff --git a/metricbeat/module/vsphere/_meta/config.yml b/metricbeat/module/vsphere/_meta/config.yml index c53563791d0d..d2badbc4c0e0 100644 --- a/metricbeat/module/vsphere/_meta/config.yml +++ b/metricbeat/module/vsphere/_meta/config.yml @@ -1,5 +1,4 @@ - module: vsphere - metricsets: ["datastore", "host", "virtualmachine"] period: 10s hosts: ["https://localhost/sdk"] diff --git a/metricbeat/module/vsphere/_meta/docs.asciidoc b/metricbeat/module/vsphere/_meta/docs.asciidoc index f11640801ef1..7a281ae4d18d 100644 --- a/metricbeat/module/vsphere/_meta/docs.asciidoc +++ b/metricbeat/module/vsphere/_meta/docs.asciidoc @@ -1,2 +1,3 @@ The vSphere module uses the https://github.com/vmware/govmomi[Govmomi] library to collect metrics from any Vmware SDK URL (ESXi/VCenter). This library is built for and tested against ESXi and vCenter 5.5, 6.0 and 6.5. +By default it enables the metricsets `datastore`, `host` and `virtualmachine`. diff --git a/metricbeat/module/vsphere/datastore/datastore.go b/metricbeat/module/vsphere/datastore/datastore.go index 153ee028c53d..2069d36650c8 100644 --- a/metricbeat/module/vsphere/datastore/datastore.go +++ b/metricbeat/module/vsphere/datastore/datastore.go @@ -14,9 +14,9 @@ import ( ) func init() { - if err := mb.Registry.AddMetricSet("vsphere", "datastore", New); err != nil { - panic(err) - } + mb.Registry.MustAddMetricSet("vsphere", "datastore", New, + mb.DefaultMetricSet(), + ) } type MetricSet struct { diff --git a/metricbeat/module/vsphere/host/host.go b/metricbeat/module/vsphere/host/host.go index 8a129d5382b4..d76b80e0d5a0 100644 --- a/metricbeat/module/vsphere/host/host.go +++ b/metricbeat/module/vsphere/host/host.go @@ -22,9 +22,9 @@ import ( ) func init() { - if err := mb.Registry.AddMetricSet("vsphere", "host", New); err != nil { - panic(err) - } + mb.Registry.MustAddMetricSet("vsphere", "host", New, + mb.DefaultMetricSet(), + ) } type MetricSet struct { diff --git a/metricbeat/module/vsphere/virtualmachine/virtualmachine.go b/metricbeat/module/vsphere/virtualmachine/virtualmachine.go index a6f8792c9c53..3ca221c68e00 100644 --- a/metricbeat/module/vsphere/virtualmachine/virtualmachine.go +++ b/metricbeat/module/vsphere/virtualmachine/virtualmachine.go @@ -23,9 +23,9 @@ import ( ) func init() { - if err := mb.Registry.AddMetricSet("vsphere", "virtualmachine", New); err != nil { - panic(err) - } + mb.Registry.MustAddMetricSet("vsphere", "virtualmachine", New, + mb.DefaultMetricSet(), + ) } type MetricSet struct { diff --git a/metricbeat/modules.d/vsphere.yml.disabled b/metricbeat/modules.d/vsphere.yml.disabled index c53563791d0d..d2badbc4c0e0 100644 --- a/metricbeat/modules.d/vsphere.yml.disabled +++ b/metricbeat/modules.d/vsphere.yml.disabled @@ -1,5 +1,4 @@ - module: vsphere - metricsets: ["datastore", "host", "virtualmachine"] period: 10s hosts: ["https://localhost/sdk"]