Metricbeat is a lightweight shipper that helps you monitor your servers by collecting metrics from the operating system and from services running on the Debian server. Configure Metricbeat using the pre-defined examples below to collect and ship Debian operating system, service metrics and statistics to Logstash or Elasticsearch.
First we need to install Metricbeat.
sudo apt-get install apt-transport-https wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - echo "deb https://artifacts.elastic.co/packages/oss-6.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-6.x.list sudo apt-get update && sudo apt-get install metricbeat
We'll be shipping to Logstash so that we have the option to run filters before the data is indexed.
Comment out the elasticsearch output block.
## Comment out elasticsearch output #output.elasticsearch: # hosts: ["localhost:9200"]
Uncomment and change the logstash output to match below.
output.logstash: hosts: ["your-logstash-host:your-port"] loadbalance: true ssl.enabled: true
There are several built in metricbeat modules you can use. To enable the system module, run the following:
metricbeat modules list metricbeat modules enable system
Each module has its own configuration file where different metricsets can be enabled / disabled. Locate the configuration file for the system module.
By default the following metrics are enabled. To enable or disable a metric simply comment or uncomment the line out.
- module: system period: 10s metricsets: - cpu - load - memory - network - process - process_summary - socket_summary #- core #- diskio #- socket
Ok, time to start ingesting data!
sudo systemctl enable metricbeat sudo systemctl start metricbeat
The System module comes with a predefined Kibana dashboard. To view your dashboards for any of your Logit stacks, launch Kibana and choose Dashboards.