configuring-elastic-agent.asciidoc 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. [[configuring-elastic-agent]]
  2. == Collecting {es} monitoring data with {agent}
  3. [subs="attributes"]
  4. ++++
  5. <titleabbrev>Collecting monitoring data with {agent}</titleabbrev>
  6. ++++
  7. In 8.5 and later, you can use {agent} to collect data about {es} and ship it to
  8. the monitoring cluster, rather than <<configuring-metricbeat,using {metricbeat}>>
  9. or routing it through exporters as described in <<collecting-monitoring-data>>.
  10. [discrete]
  11. === Prerequisites
  12. * (Optional) Create a monitoring cluster as described in <<monitoring-production>>.
  13. * Create a user on the production cluster that has the
  14. `remote_monitoring_collector` {ref}/built-in-roles.html[built-in role].
  15. [discrete]
  16. === Add {es} monitoring data
  17. To collect {es} monitoring data, add an {es} integration to an {agent} and
  18. deploy it to the host where {es} is running.
  19. . Go to the {kib} home page and click **Add integrations**.
  20. . In the query bar, search for and select the **{es}** integration for
  21. {agent}.
  22. . Read the overview to make sure you understand integration requirements and
  23. other considerations.
  24. . Click **Add Elasticsearch**.
  25. +
  26. TIP: If you're installing an integration for the first time, you may be prompted
  27. to install {agent}. Click **Add integration only (skip agent installation)**.
  28. . Configure the integration name and optionally add a description. Make sure you
  29. configure all required settings:
  30. .. Under **Collect Elasticsearch logs**, modify the log paths to match your {es}
  31. environment.
  32. .. Under **Collect Elasticsearch metrics**, make sure the hosts setting points to
  33. your {es} host URLs. By default, the integration collects {es} monitoring
  34. metrics from `localhost:9200`. If that host and port number are not correct,
  35. update the `hosts` setting. If you configured {es} to use encrypted
  36. communications, you must access it via HTTPS. For example, use a `hosts` setting
  37. like `https://localhost:9200`.
  38. .. Expand **Advanced options**. If the Elastic {security-features} are enabled,
  39. enter the username and password of a user that has the
  40. `remote_monitoring_collector` role.
  41. .. Specify the scope:
  42. ** Specify `cluster` if each entry in the hosts list indicates a single
  43. endpoint for a distinct {es} cluster (for example, a load-balancing proxy
  44. fronting the cluster that directs requests to the master-ineligible nodes in the
  45. cluster).
  46. ** Otherwise, accept the default scope, `node`. If this scope is set, you
  47. will need to install {agent} on each {es} node to collect all metrics. {agent}
  48. will collect most of the metrics from the elected master of the cluster, so you
  49. must scale up all your master-eligible nodes to account for this extra load. Do
  50. not use this `node` if you have dedicated master nodes.
  51. . Choose where to add the integration policy. Click **New hosts** to add it to
  52. new agent policy or **Existing hosts** to add it to an existing agent policy.
  53. . Click **Save and continue**. This step takes a minute or two to complete. When
  54. it's done, you'll have an agent policy that contains an integration for
  55. collecting monitoring data from {es}.
  56. . If an {agent} is already assigned to the policy and deployed to the host where
  57. {es} is running, you're done. Otherwise, you need to deploy an {agent}. To
  58. deploy an {agent}:
  59. .. Go to **{fleet} -> Agents**, then click **Add agent**.
  60. .. Follow the steps in the **Add agent** flyout to download, install,
  61. and enroll the {agent}. Make sure you choose the agent policy you created
  62. earlier.
  63. . Wait a minute or two until incoming data is confirmed.
  64. . {kibana-ref}/monitoring-data.html[View the monitoring data in {kib}].