Nous avons précédement vu comment installer Elastic Stack ici et nous allons voir ici comment monitorer l'utilisation des ressources matérielle avec Metricbeat.
Ce module va nous permettre de surveiller la consommation de processeur, mémoire, réseau et utilisation disque depuis des vues graphiques.
Voyons donc comment l'installer sur Windows et GNU/Linux.
Metricbeat doit être installé sur chacune des machines que l'on souhaite monitorer depuis Elasticsearch.
# =================================== Kibana =================================== # Starting with Beats version 6.0.0, the dashboards are loaded via the Kibana API. # This requires a Kibana endpoint configuration. 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: "https://X.X.X.X:5601" ssl.verification_mode: none username: "elastic" password: "elastic_password;)" # ---------------------------- Elasticsearch Output ---------------------------- output.elasticsearch: # Array of hosts to connect to. hosts: ["X.X.X.X:9200"] # Protocol - either `http` (default) or `https`. protocol: "https" ssl.verification_mode: none # Authentication credentials - either API key or username/password. #api_key: "id:api_key" username: "elastic" password: "elastic_password;)"
PS C:\> cd "C:\Program Files\metricbeat"
PS C:\> .\metricbeat.exe test config -c .\metricbeat.yml
PS C:\> powershell -executionpolicy Unrestricted -file .\install-service-metricbeat.ps1
PS C:\> .\metricbeat.exe setup -e
PS C:\> Start-Service metricbeat
root@host:~# apt update && apt-get install apt-transport-https gnupg curl wget
root@host:~# wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | gpg --dearmor -o /usr/share/keyrings/elasticsearch-keyring.gpg
root@host:~# echo "deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/8.x/apt stable main" | tee /etc/apt/sources.list.d/elastic-8.x.list
root@host:~# apt update && apt-get install metricbeat
# =================================== Kibana =================================== # Starting with Beats version 6.0.0, the dashboards are loaded via the Kibana API. # This requires a Kibana endpoint configuration. 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: "https://X.X.X.X:5601" ssl.verification_mode: none username: "elastic" password: "elastic_password;)" # ---------------------------- Elasticsearch Output ---------------------------- output.elasticsearch: # Array of hosts to connect to. hosts: ["X.X.X.X:9200"] # Protocol - either `http` (default) or `https`. protocol: "https" ssl.verification_mode: none # Authentication credentials - either API key or username/password. #api_key: "id:api_key" username: "elastic" password: "elastic_password;)"
root@host:~# systemctl start metricbeat
root@host:~# systemctl enable metricbeat
Il y a pas mal de dashboard prédéfinis pour Metricbeat nous allons voir comment les utiliser.
Contact :