Lou’s Lab

Voor ik verga tot stof en as, wil ik weten hoe de wereld was (RvhG)

User Tools

Site Tools


elk_stack:metricbeat_werking

Metricbeat: werking

context

dit document beschrijft de werking van Metricbeat

configuratie

  1. /etc/metricbeat/metricbeat.yml
  2. vergelijkbaar met de configuratie van Filebeat heb je ook een .reference.yml-bestand waarin alle opties netjes worden uitgelegd.
  3. standaard staat output naar ES, ipv Logstash. Pas dit als volgt aan:
    1. zet IN commentaar:
      output.elasticsearch:
      hosts: ["localhost:9200"]
    2. voeg adres van kibana toe:
      setup.kibana:
        host: "localhost:5601"
    3. haal UIT commentaar:
      #output.logstash:
      #hosts: ["localhost:5044"]
  4. om de werking van de agent wat te leren kennen, zetten we logging aan:
    logging.level: debug
    logging.to_files: true
    logging.files:
      path: /var/log/metricbeat
    logging.metrics.enabled: false
  5. test je config file:
    metricbeat test config
  6. herstart metricbeat:
    sudo systemctl restart metricbeat

Kibana

  1. maak een index aan in kibana
  2. controleer dat events binnenkomen in Discover
    Nu kan je deze verwerken in visualizations
  3. activeer de voorbeeld dashboards als volgt:
    1. open /etc/metricbeat/metricbeat.yml
    2. activeer de waarde:
      setup.dashboards.enabled: true
    3. herstart metricbeat service:
      sudo systemctl restart metricbeat

problemen, problemen

  • ga kijken in /var/log/metricbeat/metricbeat

Kibana sample dashboards worden niet geladen

fout:

ERROR   instance/beat.go:933    Exiting: error connecting to Kibana: fail to get the Kibana version: HTTP GET request to http://localhost:5601/api/status fails: ... Get http://localhost:5601/api/status: dial tcp 127.0.0.1:5601: connect: connection refused. Response: .

oorzaak:filebeat maakt verbinding op Kibana API endpoint. Indien niet expliciet geconfigureerd, gaat filebeat uit van localhost. Als kibana luistert op ander adres, voeg dit dan als volgt toe in metricbeat.yml:

setup.kibana:

  # Kibana Host
  # Scheme and port can be left out and will be set to the default (http and 5601)
  # In case you specify and additional path, the scheme is required: http://localhost:5601/path
  # IPv6 addresses should always be defined as: https://[2001:db8::1]:5601
  host: "<ipKibanaHost>:5601"

meer info

elk_stack/metricbeat_werking.txt · Last modified: 2020/03/18 13:51 by koen