{"id":4615,"date":"2019-05-11T18:26:43","date_gmt":"2019-05-11T16:26:43","guid":{"rendered":"https:\/\/nil.uniza.sk\/?p=4615"},"modified":"2019-06-07T12:10:36","modified_gmt":"2019-06-07T10:10:36","slug":"server-monitoring-with-elastic-stack","status":"publish","type":"post","link":"https:\/\/nil.uniza.sk\/en\/server-monitoring-with-elastic-stack\/","title":{"rendered":"Server monitoring with Elastic Stack"},"content":{"rendered":"<h1 class=\"wp-block-heading\">Server monitoring with Elastic Stack<\/h1>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Author<\/strong>: Miroslav Koh\u00fatik<\/li><li><strong>Elastic Stack Version<\/strong>: 6.7.0<\/li><li><strong>Operating system<\/strong> : Ubuntu 16.04<\/li><\/ul>\n\n\n\n<p>Elastic stack is a group of products from the Elastic company built around the Elasticsearch database designed to process data from any type of source.<\/p>\n\n\n\n<p>In this article we will show you how to monitor the state of the  Elasticsearch service and server load using the Elastic Stack services. <\/p>\n\n\n\n<p>Before you begin, install Elasticsearch, installation guide can be found in the section <strong>Setup before installation <\/strong>at the beginning of <a href=\"https:\/\/nil.uniza.sk\/en\/moloch-v1-7-0-installation\/\">this article<\/a>. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">X-pack<\/h3>\n\n\n\n<p>X-Pack is an Elastic Stack extension that bundles security, alerting, monitoring and reporting services into one easy-to-install package. Since Elastic Stack version 6.3, X-Pack comes pre-installed as a part of every Elastic Stack component, eliminating the previous need for separate installation.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Kibana<\/h3>\n\n\n\n<p>Kibana is an Elastic Stack component that provides visualization of Elasticsearch data. For monitoring purposes, Kibana provides visual access to data generated by X-Pack. <\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Installing Kibana<\/h5>\n\n\n\n<p>Download and install public GPG key<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wget -qO - https:\/\/artifacts.elastic.co\/GPG-KEY-elasticsearch | sudo apt-key add -<\/code><\/pre>\n\n\n\n<p>Download Kibana installation package<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wget https:\/\/artifacts.elastic.co\/downloads\/kibana\/kibana-6.7.0-amd64.deb<\/code><\/pre>\n\n\n\n<p>Unpack and install the Kibana package<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dpkg -i kibana-6.7.0-amd64.deb<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">Kibana configuration<\/h5>\n\n\n\n<p>Your Kibana should be ready to use now, however, only on the local device. If you wish to access Kibana from a remote device, you need to configure the IP address for web UI access. <\/p>\n\n\n\n<p>Open the kibana.yaml configuration file<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/etc\/kibana\/kibana.yaml<\/code><\/pre>\n\n\n\n<p>Search for the line <em>#server.host: &#8222;localhost&#8220;<\/em>, uncomment it (by deleting the &#8222;#&#8220; at the line start) and modify it to <em>server.host: &#8222;x.x.x.x&#8220;<\/em>, where x.x.x.x is the IP address of the device you are currently installing Kibana on.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/i.imgur.com\/QhIw6Nx.png\" alt=\"kibana.yaml\" \/><\/figure>\n\n\n\n<p>If you want Kibana to run on startup, enter the following lines<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo \/bin\/systemctl daemon-reload\nsudo \/bin\/systemctl enable kibana.service<\/code><\/pre>\n\n\n\n<p>Now you can run Kibana with the folowing command<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl start kibana.service<\/code><\/pre>\n\n\n\n<p>Enter the following command to check the status of Kibana <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl status kibana.service<\/code><\/pre>\n\n\n\n<p>To access Kibana web UI through web browser, enter the combination of server IP address and Kibana&#8217;s default port: x.x.x.x:5601.<br>\nClick on the monitoring tab in Kibana menu to access monitoring data. On first startup, you will be notified that monitoring is currently off, turn it on by clicking the &#8222;Turn on monitoring&#8220; button.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/i.imgur.com\/6yEX6FE.png\" alt=\"Monitoring tab on fist startup\" \/><\/figure>\n\n\n\n<p>Status of the Elasticsearch service can be tracked by clicking the &#8222;Nodes&#8220; button, which will display a list of all the devices Elasticsearch is distributed on. <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/i.imgur.com\/iqXcFnC.png\" alt=\"Z\u00e1lo\u017eka monitoring pri akt\u00edvnom nasaden\u00ed\" \/><\/figure>\n\n\n\n<h5 class=\"wp-block-heading\">Metricbeat<\/h5>\n\n\n\n<p>X-pack only collects statistics on the status of individual Elastic Stack components while Metricbeat is used to monitor the overall server load status in Elastic Stack.<\/p>\n\n\n\n<p>Provided you have Kibana up and running, Metricbeat installation is simple.<\/p>\n\n\n\n<p>Download and install the Metricbeat installation package<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -L -O https:\/\/artifacts.elastic.co\/downloads\/beats\/metricbeat\/metricbeat-6.7.0-amd64.deb\nsudo dpkg -i metricbeat-6.7.0-amd64.deb<\/code><\/pre>\n\n\n\n<p>Modify the file located in <em>\/etc\/metricbeat\/metricbeat.yml<\/em> by appending the following lines<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>setup.kibana:\n    host: \"192.168.1.186:5601\"\noutput.elasticsearch:\n    hosts: [\"localhost:9200\"]<\/code><\/pre>\n\n\n\n<p>Enable the system module which enables Metricbeat to collect monitoring data<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo metricbeat modules enable system<\/code><\/pre>\n\n\n\n<p>Configure Metricbeat<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo metricbeat setup<\/code><\/pre>\n\n\n\n<p>Run Metricbeat<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl start metricbeat.service<\/code><\/pre>\n\n\n\n<p>You should now be able to see server stats in the &#8222;Dashboard&#8220; tab by visualizing  \u201c[Metricbeat System] Host overview\u201d.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/i.imgur.com\/tZ0qZ8B.png\" alt=\"Stav servera\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Sources:<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/www.elastic.co\/guide\/en\/kibana\/6.7\/deb.html\">Kibana user guide<\/a><\/li><li><a href=\"https:\/\/www.elastic.co\/guide\/en\/beats\/metricbeat\/6.7\/index.html\">Metricbeat reference<\/a><\/li><\/ul>","protected":false},"excerpt":{"rendered":"<p>Server monitoring with Elastic Stack Author: Miroslav Koh\u00fatik Elastic Stack Version: 6.7.0 Operating system : Ubuntu 16.04 Elastic stack is a group of products from the Elastic company built around the Elasticsearch database designed to process data from any type of source. In this article we will show you how to monitor the state of&#8230;<\/p>","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"categories":[687],"tags":[900,1031],"class_list":["post-4615","post","type-post","status-publish","format-standard","hentry","category-monitoring-management-measurement","tag-elasticsearch","tag-monitoring"],"taxonomy_info":{"category":[{"value":687,"label":"Monitoring, Management, Measurement"}],"post_tag":[{"value":900,"label":"elasticsearch"},{"value":1031,"label":"monitoring"}]},"featured_image_src_large":false,"author_info":{"display_name":"Miroslav Koh\u00fatik","author_link":"https:\/\/nil.uniza.sk\/en\/author\/miroslav-kohutik\/"},"comment_info":11,"category_info":[{"term_id":687,"name":"Monitoring, Management, Measurement","slug":"monitoring-management-measurement","term_group":0,"term_taxonomy_id":685,"taxonomy":"category","description":"","parent":0,"count":5,"filter":"raw","cat_ID":687,"category_count":5,"category_description":"","cat_name":"Monitoring, Management, Measurement","category_nicename":"monitoring-management-measurement","category_parent":0}],"tag_info":[{"term_id":900,"name":"elasticsearch","slug":"elasticsearch","term_group":0,"term_taxonomy_id":898,"taxonomy":"post_tag","description":"","parent":0,"count":5,"filter":"raw"},{"term_id":1031,"name":"monitoring","slug":"monitoring","term_group":0,"term_taxonomy_id":1029,"taxonomy":"post_tag","description":"","parent":0,"count":6,"filter":"raw"}],"_links":{"self":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/posts\/4615","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/comments?post=4615"}],"version-history":[{"count":0,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/posts\/4615\/revisions"}],"wp:attachment":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/media?parent=4615"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/categories?post=4615"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/tags?post=4615"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}