Metricbeat is lightweight monitoring application provided in Elastic Stack which could be used to monitor various components like Server, apache, mysql, redis etc. In this article are going to configure Metricbeat to monitor Linux Server Usage and Apache Web Server metrics.
Please use the link to download Metricbeat 7.4
Once you have downloaded the Metricbeat application copy it to the servers that you want to monitor and extract the contents.
In metricbeat there are two items that needs to be configured
- Metricbeat configuration to connect to Elasticsearch and Kibana
- Modules that needs to be activated for monitoring
Use the below setting to establish connectivity.
ssl.verification_mode: none #Disabled ssl certificate verification as we are using selfsigned certificate
password: "elasticsearchpassword" # Password generated during Securing Easticsearch
Once the above configuration is added to metricbeat.yml we should be able to establish connection.
2. Configure modules for metrics collection: To enable the modules change directory to "modules.d" under Metricbeats base directory and in the directory you will find all the modules that could be used as a part of metricbeats.
As we are monitoring only Linux and Apache we move need to change file extensions from .yml.disabled. The two config files that we need are "system.yml" and apache.yml"
Use below command to make the change.
mv modulesname.yml.disabled modulesname.yml
You can find both config files in Github.
Once you are done with configuration lets start Metricbeat.
1. Lets make metricbeat executable
chmod 775 metricbeat
2. Start Metricbeat
/metricbeat -c metricbeat.yml
3. Once we have metricbeat running we can setup dashboards using below command.
Once you have completed above steps you should be able to see the data getting transfred to elasticsearch, we can now visualize data using Kibana dashboards.
Overview System Dashboard shows all the configured servers.
Individual Linux server Metrics
Apache Web Server Metrics