<?xml version="1.0" encoding="UTF-8" ?><!-- generator=Zoho Sites --><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><atom:link href="https://www.daihockhonggiay.com/blogs/tag/giám-sát/feed" rel="self" type="application/rss+xml"/><title>Đại học Không Giấy - Blog #giám sát</title><description>Đại học Không Giấy - Blog #giám sát</description><link>https://www.daihockhonggiay.com/blogs/tag/giám-sát</link><lastBuildDate>Sun, 14 Sep 2025 15:27:02 -0700</lastBuildDate><generator>http://zoho.com/sites/</generator><item><title><![CDATA[Giới thiệu về ELK Stack]]></title><link>https://www.daihockhonggiay.com/blogs/post/gioi-thieu-ve-elk-stack</link><description><![CDATA[<img align="left" hspace="5" src="https://www.daihockhonggiay.com/ELK/7.jpg"/>ELK là viết tắt của tập hợp 3 phần mềm cốt lõi đi kèm với nhau, phục vụ cho công việc giám sát hệ thống. Ba phần mềm này lần lượt là Elasticsearch, Logstash và Kibana. ELK được phát triển từ đầu những năm 2000 và cho đến nay đã hơn 250 triệu lượt tải xuống và sử dụng.]]></description><content:encoded><![CDATA[<div class="zpcontent-container blogpost-container "><div data-element-id="elm_UJalNeL8TOGsiL2_4dlOsA" data-element-type="section" class="zpsection "><style type="text/css"></style><div class="zpcontainer-fluid zpcontainer"><div data-element-id="elm_6QVmvkeQQ36xm5ZhFBPM1g" data-element-type="row" class="zprow zprow-container zpalign-items- zpjustify-content- " data-equal-column=""><style type="text/css"></style><div data-element-id="elm_i6AkWcx-T7-KYU0RJtEvRg" data-element-type="column" class="zpelem-col zpcol-12 zpcol-md-12 zpcol-sm-12 zpalign-self- "><style type="text/css"></style><div data-element-id="elm_UONgmLlnScGl5MDzMy_Hdg" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_UONgmLlnScGl5MDzMy_Hdg"].zpelem-text { border-style:none; } </style><div class="zptext zptext-align-center " data-editor="true"><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);font-weight:bold;">I. Tổng quan về ELK</span></p><p style="text-align:left;text-indent:0.5in;"><span style="font-size:14px;color:rgb(11, 35, 45);">ELK là viết tắt của tập hợp 3 phần mềm cốt lõi đi kèm với nhau, phục vụ cho công việc giám sát hệ thống. Ba phần mềm này lần lượt là Elasticsearch, Logstash và Kibana. ELK được phát triển từ đầu những năm 2000 và cho đến nay đã hơn 250 triệu lượt tải xuống và sử dụng. Hiện tại phiên bản mới nhất của ELK là 6.4. Đây là bộ công cụ giám sát tập trung mã nguồn mở rất mạnh, có thể xử lý rất nhiều bài toán quản lý hệ thống mạng nên rất được các công ty, tổ chức tin dùng.</span></p><p style="text-align:left;text-indent:0.5in;"><b><span style="font-size:14px;color:rgb(11, 35, 45);">Ưu điểm phần mềm ELK stack:</span></b></p><p style="text-align:left;text-indent:0.5in;"><span style="font-size:14px;color:rgb(11, 35, 45);">- ELK stack là phần mềm mã nguồn mở, không tốn nhiều chi phí khi triển khai.</span></p><p style="text-align:left;text-indent:0.5in;"><span style="font-size:14px;color:rgb(11, 35, 45);">- ELK mới được phát triển mạnh gần đây, nên cộng đồng hỗ trợ rất đông đúc và mạnh mẽ.</span></p><p style="text-align:left;text-indent:0.5in;"><span style="font-size:14px;color:rgb(11, 35, 45);">- Thu thập được log từ rất nhiều nguồn khác nhau: log hệ thống, log ứng dụng, log thiết bị mạng, log snmp, log từ các hệ thống API (Application Programming Interface)…</span></p><p style="text-align:left;text-indent:0.5in;"><span style="font-size:14px;color:rgb(11, 35, 45);">- Khả năng tương thích cao, dễ dàng tích hợp với các hệ thống khác mà không gặp khó khăn.</span></p><p style="text-align:left;text-indent:0.5in;"><span style="font-size:14px;color:rgb(11, 35, 45);">- Giao diện Kibana trực quan, sinh động.</span></p><p style="text-align:left;text-indent:0.5in;"><span style="font-size:14px;color:rgb(11, 35, 45);">- Phương tiện cảnh báo đa dạng, tích hợp với email, sms, slack, các ứng dụng OTP (One Time Password) như Telegram, Whatsapp,...</span></p><p style="text-align:left;text-indent:0.5in;"><span style="font-size:14px;color:rgb(11, 35, 45);">- Hiệu năng xử lý cao, có thể chịu tải được một lượng lớn dữ liệu (log) đẩy về mà không phải quá phụ thuộc vào khả năng xử lý của phần cứng.</span></p><p style="text-align:left;text-indent:0.5in;"><span style="font-size:14px;color:rgb(11, 35, 45);">- Giải quyết được hầu hết các bài toán trong giám sát hệ thống mạng: giám sát hạ tầng, giám sát dịch vụ, giám sát an ninh, giám sát người dùng,... Đây là đặc điểm chính giúp cho ELK trong tương lai sẽ được các công ty và tổ chức sử dụng để triển khai hệ thống giám sát tập trung bên trong hệ thống mạng của họ.</span></p><p style="text-align:left;text-indent:0.5in;"><b><span style="font-size:14px;color:rgb(11, 35, 45);">Các thành phần chính trong ELK stack gồm 4 thành phần:</span></b></p><p style="text-align:left;text-indent:0.5in;"><span style="color:rgb(11, 35, 45);"><b><span style="font-size:14px;">- Elasticsearch</span></b><b><span style="font-size:14px;">:</span></b><span style="font-size:14px;"> Dùng để tìm kiếm và query log</span></span></p><p style="text-align:left;text-indent:0.5in;"><span style="color:rgb(11, 35, 45);"><b><span style="font-size:14px;">- Logstash</span></b><b><span style="font-size:14px;">:</span></b><span style="font-size:14px;"> Tiếp nhận log từ nhiều nguồn, sau đó xử lý log và ghi vào cơ sở dữ liệu.</span></span></p><p style="text-align:left;text-indent:0.5in;"><span style="color:rgb(11, 35, 45);"><b><span style="font-size:14px;">- Kibana</span></b><b><span style="font-size:14px;">:</span></b><span style="font-size:14px;"> Giao diện để quản lý, thống kê log. Đọc thông tin từ Elasticsearch.</span></span></p><p style="text-align:left;text-indent:0.5in;"><span style="color:rgb(11, 35, 45);"><b><span style="font-size:14px;">- Beats:</span></b><span style="font-size:14px;"> Một tập các công cụ chuyên dùng để thu thập dữ liệu cực mạnh.</span></span></p><p align="center"></p><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);"><b><br></b></span></p><p style="text-align:center;"><img src="/ELK/6.jpg"><span style="font-size:14px;color:rgb(11, 35, 45);"><b><br></b></span></p><p style="text-align:center;"><span style="font-size:14px;color:rgb(11, 35, 45);"><b>Các thành phần trong ELK stack</b><b></b><b></b></span></p><p style="text-align:center;"><span style="font-size:14px;color:rgb(11, 35, 45);"><b><br></b></span></p><p style="text-align:left;text-indent:0.5in;"><b><span style="font-size:14px;color:rgb(11, 35, 45);">Về nguyên lý hoạt động của ELK stack: </span></b></p><p style="text-align:left;text-indent:0.5in;"><span style="font-size:14px;color:rgb(11, 35, 45);">- Đầu tiên, thông tin cần giám sát sẽ được đưa đến máy chủ ELK thông qua nhiều con đường, ví dụ như server gửi UDP request chứa log tới URL của Logstash, hoặc Beats thu thập các thông tin từ các bộ công cụ chuyên dụng cài trên các server và gửi lên Logstash hoặc Elasticsearch.</span></p><p style="text-align:left;text-indent:0.5in;"><span style="font-size:14px;color:rgb(11, 35, 45);">- Logstash sẽ đọc những log này, thêm những thông tin như thời gian, IP, parse dữ liệu từ log (server nào, độ nghiêm trọng, nội dung log) ra, sau đó ghi xuống database là Elasticsearch.</span></p><p style="text-align:left;text-indent:0.5in;"><span style="font-size:14px;color:rgb(11, 35, 45);">- Khi muốn xem log, người dùng vào URL của Kibana. Kibana sẽ đọc thông tin log trong Elasticsearch, hiển thị lên giao diện cho người dùng query và xử lý. Kibana hiển thị thông tin từ log cho người dùng.</span></p><p style="text-align:left;text-indent:0.5in;"><span style="font-size:14px;color:rgb(11, 35, 45);"><br></span></p><p align="center"><b><span style="font-size:14px;color:rgb(11, 35, 45);"></span></b></p><h3 align="center" style="text-align:center;"><img src="/ELK/7.jpg" style="color:rgb(0, 0, 0);font-size:14px;"><span style="color:rgb(11, 35, 45);"><b><span style="font-size:14px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span></b></span></h3><h3 align="center" style="text-align:center;"><span style="color:rgb(11, 35, 45);"><b><span style="font-size:14px;">Cấu trúc của ELK</span></b><b></b></span></h3><div><span style="color:rgb(11, 35, 45);"><b><span style="font-size:14px;"><br></span></b></span></div><p style="text-align:left;text-indent:0.5in;"><span style="font-size:14px;color:rgb(11, 35, 45);">Sau đây, luận văn sẽ tìm hiểu chi tiết về từng thành phần trong bộ công cụ ELK stack để lý giải về khả năng của bộ công cụ giám sát tập trung mã nguồn mở ELK stack.</span></p><p style="text-align:left;text-indent:0.5in;"><b><u><span style="font-size:14px;color:rgb(11, 35, 45);">Elasticsearch</span></u></b></p><p style="text-align:left;"><span style="color:rgb(11, 35, 45);"><i><span style="font-size:14px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span></i><span style="font-size:14px;">Đầu tiên cần hiểu ElasticSearch là một công cụ tìm kiếm cấp doanh nghiệp (enterprise-level search engine). Mục tiêu của nó là tạo ra một công cụ, nền tảng hay kỹ thuật tìm kiếm và phân tích trong thời gian thực (ý nói ở đây là nhanh chóng và chính xác), cũng như cách để nó có thể áp dụng hay triển khai một cách dễ dàng vào nhiều nguồn dữ liệu (data sources) khác nhau. Nguồn dữ liệu nói ở trên trên bao gồm các cơ sở dữ liệu nổi tiếng như MS SQL, PostgreSQL, MySQL, ... </span></span></p><p align="center"></p><h3 align="center" style="text-align:center;"><span style="color:rgb(11, 35, 45);"><b><span style="font-size:14px;"><br></span></b></span></h3><h3 align="center" style="text-align:center;"><img src="/ELK/8.jpg"><span style="color:rgb(11, 35, 45);"><b><span style="font-size:14px;"><br></span></b></span></h3><h3 align="center" style="text-align:center;"><span style="color:rgb(11, 35, 45);"><b><span style="font-size:14px;">Công cụ Elasticsearch</span></b><b></b></span></h3><div><span style="color:rgb(11, 35, 45);"><b><span style="font-size:14px;"><br></span></b></span></div><p style="text-align:left;text-indent:0.5in;"><span style="font-size:14px;color:rgb(11, 35, 45);">Một số đặc điểm về ElasticSearch:</span></p><p style="text-align:left;text-indent:0.5in;"><span style="font-size:14px;color:rgb(11, 35, 45);">- Elasticsearch là một search engine.</span></p><p style="text-align:left;text-indent:0.5in;"><span style="font-size:14px;color:rgb(11, 35, 45);">- Elasticsearch được xây dựng để hoạt động như một server cloud</span></p><p style="text-align:left;text-indent:0.5in;"><span style="font-size:14px;color:rgb(11, 35, 45);">- Phát triển bằng ngôn ngữ Java.</span></p><p style="text-align:left;text-indent:0.5in;"><span style="font-size:14px;color:rgb(11, 35, 45);">- Là phần mềm open-source được phát hành theo giất phép của Apache License.</span></p><p style="text-align:left;text-indent:0.5in;"><span style="font-size:14px;color:rgb(11, 35, 45);">- Elasticsearch có thể tích hợp được với tất cả các ứng dụng sử dụng các loại ngôn ngữ: Java, JavaScript, Groovy, .NET, PHP, Perl, Python, Ruby</span></p><p style="text-align:left;text-indent:0.5in;"><span style="font-size:14px;color:rgb(11, 35, 45);">Cơ chế hoạt động của ElasticSearch:</span></p><p style="text-align:left;text-indent:0.5in;"><span style="font-size:14px;color:rgb(11, 35, 45);">- Sở dĩ Elasticsearch được gọi là &quot;search &amp; analyze in real time&quot; là vì nó có khả năng trả về kết quả tìm kiếm một cách nhanh chóng và chính xác trong một nguồn dữ liệu lớn (big data source).</span></p><p style="text-align:left;text-indent:0.5in;"><span style="font-size:14px;color:rgb(11, 35, 45);">- Elasticsearch không chỉ tìm kiếm được các nguồn cơ sở dữ liệu nổi tiếng như MySQL, MS SQL, PostgreSQL, mà nó có thể là văn bản (text), pdf, doc.</span></p><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Theo như cách thông thường tìm kiếm trong cơ sở dữ liệu database đều biết thì có hai cách là:</span></p><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; - Cách 1: Lật từng trang để tìm kiếm (No index).</span></p><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; - Cách 2: Lật tới phần mục lục để tìm kiếm.</span></p><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Về cơ bản thì ElasticSearch cũng áp dụng giải pháp giống Index. Tuy nhiên về mặt cơ chế xử lý và tìm kiếm thì có sự khác biệt, Index trong ElasticSearch được gọi là Inverted Index.kỹ thuật thay vì index theo từng đơn vị row (document) giống như mysql thì chúng ta sẽ biến thành Index theo đơn vị term. Cụ thể hơn, Inverted Index là một cấu trúc dữ liệu, nhằm mục đích map giữa term và các document chứa term đó, giúp gia tăng khả năng tìm kiếm.</span></p><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<b><u>Logstash</u></b></span></p><p style="text-align:left;"><span style="color:rgb(11, 35, 45);"><b><span style="font-size:14px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span></b><span style="font-size:14px;">Logstash là một công cụ thu thập dữ liệu mã nguồn mở với khả năng pipelining thời gian thực. Logstash có thể tự động thu thập dữ liệu từ nhiều nguồn khác nhau và chuẩn hóa dữ liệu đó phụ thuộc vào đích đến của dữ liệu. <b><u></u></b></span></span></p><p style="text-align:left;"><span style="color:rgb(11, 35, 45);"><b><span style="font-size:14px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span></b><span style="font-size:14px;">Ban đầu logstash chỉ đóng vai trò là một bộ thu thập log, nhưng khả năng của logstash hiện nay đã vượt qua cả vai trò đó. Bất kỳ một dạng sự kiện nào cũng đều có thể được logstash thu thập thông qua các plugins input và output, cùng với những code đã được đơn giản hóa giúp gia tăng khả năng nhập, xử lý và khai thác hiệu quả nhiều loại dữ liệu khác nhau.<b><u></u></b></span></span></p><p align="center"></p><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);"><br></span></p><p style="text-align:center;"><img src="/ELK/9.jpg"><span style="font-size:14px;color:rgb(11, 35, 45);"><br></span></p><p style="text-align:center;"><span style="font-size:14px;color:rgb(11, 35, 45);font-weight:bold;">Công cụ Logstash và nguyên lý hoạt động</span></p><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);"><br></span></p><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Logstash có một số lượng plugin đồ sộ (hơn 200) có thể đáp ứng bất kỳ dữ liệu nào được đưa đến đầu vào. Đơn giản nhất là log, metrics. Với web, logstash có thể biến các requests HTTP thành các sự kiện để phân tích. Hay có thể làm việc với NoSQL thông qua giao diện JDBC, cung cấp các cảm biến và IoT,…</span></p><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Logstash thường sử dụng giao thức Syslog hay SNMP để có thể thu thập log. Đây là 2 giao thức chính thường được sử dụng trong các hệ thống giám sát nhằm thu thập các thông tin và đẩy dữ liệu về máy chủ giám sát.</span></p><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Syslog là một giao thức client/server. Đây là giao thức dùng để chuyển log và thông điệp đến máy nhận log. Máy nhận log thường được gọi là syslogd, syslog daemon hoặc syslog server. Syslog có thể gửi qua UDP hoặc TCP. Các dữ liệu được gửi dạng cleartext. Syslog dùng cổng 514.</span></p><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Syslog được phát triển năm 1980 bởi Eric Allman, nó là một phần của dự án Sendmail, và ban đầu chỉ được sử dụng duy nhất cho Sendmail. Nhưng syslog hiện nay trở thành giải pháp khai thác log tiêu chuẩn trên Unix-Linux cũng như trên hàng loạt các hệ điều hành khác và thường được tìm thấy trong các thiết bị mạng như switch, router. </span></p><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Syslog ban đầu sử dụng UDP, điều này đương nhiên không đảm bảo cho việc truyền tin. Tuy nhiên sau đó IETF đã ban hành RFC 3195 Reliable Delivery cho syslog. Nó giúp đảm bảo tin cậy cho syslog và RFC 6587 Transmission of Syslog Messages over TCP giúp truyền tải thông báo syslog qua TCP. Điều này có nghĩa là ngoài UDP thì giờ đây syslog cũng đã sử dụng TCP để đảm bảo an toàn cho quá trình truyền tin.</span></p><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Trong chuẩn syslog, mỗi thông báo đều được dán nhãn và được gán các mức độ nghiêm trọng khác nhau. Các loại phần mềm sau có thể sinh ra thông báo: auth , authPriv , daemon , cron , ftp , dhcp , kern , mail, syslog, user, ... Với các mức độ nghiêm trọng từ cao nhất trở xuống Emergency, Alert, Critical, Error, Warning, Notice, Info, and Debug.</span></p><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SNMP viết tắt của Simple Network Management Protocol, là một giao thức chuyên được sử dụng trong vấn đề quản lý, giám sát hệ thống mạng. SNMP có những quy định riêng, những thành phần riêng để các thành phần trong hệ thống mạng có thể tuân theo, từ đó thu thập được các log trong hệ thống mạng để quản lý, giám sát. SNMP sử dụng UDP, chạy trên cổng 161 hoặc 162.</span></p><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Một số các chức năng của các phần mềm sử dụng giao thức SNMP gồm:</span></p><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;- Theo dõi tốc độ đường truyền, lưu lượng truyền và nhận.</span></p><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;- Lấy thông tin về phần cứng của máy chủ (RAM, Chip, Ổ cứng,…).</span></p><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;- Tự động cảnh báo (gửi mail, sms) khi có sự cố.</span></p><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SNMP được thiết kế chạy trên nền TCP/IP và quản lý các thiết bị có nối mạng TCP/IP. Nếu thiết bị cần giám sát có nối mạng, sử dụng IP và hỗ trợ SNMP thì hoàn toàn có thể giám sát, quản lý nó từ xa thông qua SNMP. </span></p><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Đặc điểm của giao thức SNMP:</span></p><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;- Thiết kế đơn giản hóa quá trình quản lý các thành phần trong mạng. Các phần mềm sử dụng SNMP có thể được phát triển nhanh và tốn ít chi phí.</span></p><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;- Có thể mở rộng các chức năng quản lý, giám sát.</span></p><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;- Có thể thiết kế để hoạt động độc lập với các kiến trúc và cơ chế của các thiết bị hỗ trợ SNMP.</span></p><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<b><u>Kibana</u></b></span></p><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Kibana là một nền tảng phân tích và trực quan mã nguồn mở được thiết kế để làm việc với Elasticsearch. Ta sử dụng Kibana để tìm kiếm, xem và tương tác với dữ liệu được lưu trữ trong Elasticsearch. Từ đó dễ dàng thực hiện phân tích dữ liệu và trực quan hóa dữ liệu của mình thông qua biểu đồ, bảng.</span></p><p align="center"></p><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);"><br></span></p><p style="text-align:center;"><img src="/ELK/10.jpg"><span style="font-size:14px;color:rgb(11, 35, 45);"><br></span></p><p style="text-align:center;"><span style="font-size:14px;color:rgb(11, 35, 45);font-weight:bold;">Công cụ Kibana</span></p><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);"><br></span></p><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Kibana giúp nắm bắt nhanh chóng các dữ liệu có khối lượng lớn. Giao diện đơn giản, dựa vào trình duyệt cho phép nhanh chóng hiển thị các thay đổi khi truy vấn Elasticsearch trong thời gian thực.</span></p><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<b><u>Beats</u></b></span></p><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Beats là một tập hợp các công cụ thu thập thông tin chuyên dụng, được biết đến như là các Shipper (người vận chuyển) giúp thu thập và gửi dữ liệu từ Client tới máy chủ ELK. Ngoài ra, các beat này có thể được gửi thẳng trực tiếp lên Elasticsearch do bản thân các công cụ đã được chuẩn hóa sẵn, việc kết nối các beat đến logstash thường mang ý nghĩa bảo mật đối với các hệ thống tầm lớn khi họ muốn bảo vệ dịch vụ elasticsearch.</span></p><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);"><br></span></p><p align="center"></p><h3 align="center" style="text-align:center;"><img src="/ELK/11.jpg"><span style="color:rgb(11, 35, 45);"><b><i><span style="font-size:14px;"><br></span></i></b></span></h3><h3 align="center" style="text-align:center;"><b style="color:rgb(11, 35, 45);"><span style="font-size:14px;">Beats và nguyên lý hoạt động</span></b><br></h3><div><span style="color:rgb(11, 35, 45);"><b><i><span style="font-size:14px;"><br></span></i></b></span></div><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Trong Beats có rất nhiều các Beat “con”, cụ thể:</span></p><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; - Filebeat: đây là công cụ chuyên dùng để thu thập log và gửi log về cho hệ thống ELK. Filebeat có một điểm mạnh mà cách thu thập thông thường không thể có được, chính là khả năng theo dõi tình trạng của ELK và điều chỉnh lượng log đẩy về. Nếu hệ thống ELK đang gặp tình trạng quá tải về khối lượng cần xử lý, Filebeat sẽ quan sát và giảm lượng log đổ về bằng cách sử dụng hàng chờ.</span></p><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; - Metricbeat: đây là công cụ chuyên dùng để thu thập hiệu năng của máy chủ. Ngoài hiệu năng phần cứng máy chủ, Metricbeat có thể khai thác thông tin các dịch vụ web (Apache, Nginx) hay của database (MySQL, MongoDB).</span></p><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; - Packetbeat: công cụ này sử dụng để giám sát lưu lượng và băng thông trên các máy chủ. Packetbeat sẽ thu thập thông tin về lưu lượng gói tin vào và ra của máy chủ, từ đó tổng kết và gửi về cho hệ thống ELK.</span></p><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; - Winlogbeat: khác với các hệ điều hành mã nguồn mở Linux, Windows có một cấu trúc hoàn toàn khác, và khó can thiệp vào sâu trong hệ thống để thu thập thông tin. Winlogbeat ra đời nhằm thu thập những sự kiện xảy ra bên trong hệ điều hành Windows.</span></p><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; - Auditbeat: Winlogbeat dành cho hệ điều hành Windows, thì Auditbeat được dành riêng cho hệ điều hành linux. Auditbeat giúp quản lý các folder, các tập tin hệ thống trong hệ điều hành Linux.&nbsp; </span></p><p style="text-align:left;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; - Heartbeat: công vụ Heartbeat được sử dụng nhằm giúp cho hệ thống giám sát có thể biết được trạng thái dịch vụ đó có còn hoạt động hay không.</span></p><p align="center"></p><p><span style="font-size:14px;color:rgb(11, 35, 45);"></span></p><h3 align="center"><div style="text-align:left;"></div></h3><h3 align="center"><div style="text-align:left;"></div></h3><h3 align="center"><div style="text-align:left;"></div></h3><h3 align="center"><div style="text-align:left;"><b><i><span style="font-size:14px;color:rgb(11, 35, 45);"><br></span></i></b></div><div><img src="/ELK/12.jpg"><b><i><span style="font-size:14px;color:rgb(11, 35, 45);"><br></span></i></b></div><div><b><i><span style="font-size:14px;color:rgb(11, 35, 45);">Beats Family</span></i></b></div><div style="text-align:left;"><b><i><span style="font-size:14px;color:rgb(11, 35, 45);"><br></span></i></b></div><p style="text-align:left;"><b><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<u>Tổng kết</u></span></b></p><span style="font-size:14px;"><p style="color:rgb(11, 35, 45);text-align:left;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Sử dụng các Beats, Logstash – thông qua giao thức Syslog và SNMP, để thu thập nhiều loại thông tin, Elasticsearch giúp việc tìm kiếm trở nên hiệu quả hơn cùng Kibana với khả năng phân tích mạnh mẽ và biểu diễn trực quan, ELK stack là một công cụ tuyệt vời trong giám sát hệ thống mạng nói chung và giám sát tập trung nói riêng.</p><p style="color:rgb(11, 35, 45);text-align:left;">&nbsp;</p><p style="color:rgb(11, 35, 45);text-align:left;"><span style="font-weight:bold;">II. Cài đăt ELK</span></p><p style="text-align:left;"><span style="color:rgb(0, 0, 0);font-weight:bold;">1. Yêu cầu chuẩn bị</span><br></p><p style="text-align:left;"><span style="color:rgb(0, 0, 0);"><span>Các file RPM của ELK</span><br></span></p><p style="text-align:left;"><span style="color:rgb(0, 0, 0);">&nbsp; &nbsp; &nbsp; &nbsp;<a href="https://sitebuilder-688732336.zohositescontent.com/blogs/post/elasticsearch-6.1.2.rpm">elasticsearch-6.1.2.rpm</a></span></p><p style="text-align:left;"><span style="color:rgb(0, 0, 0);">&nbsp; &nbsp; &nbsp; &nbsp;<span style="text-align:center;">kibana-6.1.2-x86_64.rpm</span></span></p><p style="text-align:left;"><span><span style="text-align:center;color:rgb(0, 0, 0);">&nbsp; &nbsp; &nbsp; &nbsp;<a href="https://sitebuilder-688732336.zohositescontent.com/blogs/post/logstash-6.1.2.rpm">logstash-6.1.2.rpm</a></span></span></p><p style="text-align:left;"><span style="color:rgb(0, 0, 0);">&nbsp; &nbsp; &nbsp; &nbsp;Link tải về:&nbsp;</span><a href="https://drive.google.com/open?id=1wzaQb9QDH02fG7cGdKqtR-b9LDopFeK7" style="color:rgb(48, 4, 234);">https://drive.google.com/open?id=1wzaQb9QDH02fG7cGdKqtR-b9LDopFeK7</a></p><p style="text-align:left;"><span style="text-align:center;color:rgb(0, 0, 0);">Phần mềm VMware Workstation đã cài HĐH CentOS-7</span></p><p style="text-align:left;"><span style="text-align:center;color:rgb(0, 0, 0);">Phần mềm SecureCRT</span></p><p style="text-align:left;"><span style="text-align:center;color:rgb(0, 0, 0);">Phần mềm WinSCP</span></p><p style="text-align:left;"><span style="font-weight:bold;color:rgb(0, 0, 0);">2. Nội dung triển khai</span></p><p style="text-align:left;"><span style="color:rgb(0, 0, 0);"><span><span style="text-indent:48px;">Cài đặt Java hỗ trợ ELK</span></span><br></span></p><p style="text-align:left;"><span><span style="text-indent:48px;color:rgb(0, 0, 0);">Cấu hình Elasticsearch<br></span></span></p><p style="text-align:left;"><span><span style="text-indent:48px;color:rgb(0, 0, 0);">Cấu hình Kibana<br></span></span></p><p style="text-align:left;"><span><span style="text-indent:48px;color:rgb(0, 0, 0);">Chỉnh sửa file cấu hình nginx<br></span></span></p><p style="text-align:left;"><span><span style="text-indent:48px;color:rgb(0, 0, 0);">Tạo file mới, ghi nội dung của kibana<br></span></span></p><p style="text-align:left;"><span style="font-size:24px;"><span style="font-size:14px;color:rgb(0, 0, 0);"></span></span></p><p style="text-align:left;"><span><span style="text-indent:48px;color:rgb(0, 0, 0);">Vào ELK thông qua giao diện Kibana</span></span></p><p style="color:rgb(11, 35, 45);text-align:left;"><span style="font-weight:bold;">3. Các bước Step</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span>Phần mềm ELK được cài đặt trên HĐH máy chủ Linux: CentOS-7 (64-bit). Các bước cài đặt HĐH CentOS-7 được triển khai bình thường.</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span style="font-weight:bold;">Cài đặt hostname</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span># vi /etc/hostname</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span>Đổi hostname thành elk.dnu.vn, cần <i>reboot </i>để server nhận hostname mới</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span style="font-weight:bold;">Cài đặt hosts</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span># vi /etc/hosts</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span>Thêm vào như sau</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span>66.0.0.66&nbsp; elk.dnu.vn</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span style="font-weight:bold;">Chỉnh sửa IP, Subnet, Gateway</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span># vi /etc/sysconfig/network-scripts/ifccfg-ens33</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span>IPADDR=”66.0.0.66”</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span>GATEWAY=”66.0.0.1”</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span>DNS1=”8.8.8.8”</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span style="font-weight:bold;">Sau đó khởi động lại dịch vụ mạng</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span># systemctl restart network</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span>Cần thiết có thể ping 8.8.8.8 để kiểm tra kết nối mạng</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span style="font-weight:bold;">Cập nhật hệ điều hành máy chủ</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span># yum update –y</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span style="font-weight:bold;">Tắt SELinux</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span># vi /etc/sysconfig/selinux</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span>Thay dòng “SELINUX=enforcing” thành “SELINUX=disabled”</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span style="font-weight:bold;">Firewall: </span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span># systemctl stop firewalld</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span># systemctl disable firewalld</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span style="font-weight:bold;">Cài đặt Java hỗ trợ ELK</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span># </span><span>yum install java-1.8.0-openjdk.x86_64 –y</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span style="font-weight:bold;">Giờ ta sử dụng WinSCP, đưa 3 file ELK đã tải vào trong thư mục /opt</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span style="font-weight:bold;">Quay lại màn hình làm việc CentOS để cài đặt ELK</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span style="font-weight:bold;">Ta vào trong thư mục /opt nơi vừa để 3 file ta tải và cài đặt ELK</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span># cd /opt</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span># yum localinstall elasticsearch-6.1.2.rpm kibana-6.1.2-x86_64.rpm logstash-6.1.2.rpm</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span>Hệ điều hành sẽ tự động cài ELK.</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span style="font-weight:bold;">Cấu hình Elasticsearch</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span># vi /etc/elasticsearch/elasticsearch.yml</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span>Bỏ dấu # ở trước 2 dòng: ( ấn I để vào insert )</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span>Network.host: 66.0.0.66</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span>http.port: 9200</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span>Sau đó save lại ( :x ) rồi <span style="font-weight:bold;">khởi động dịch vụ</span></span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span># systemctl start elasticsearch</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span># systemctl enable elasticsearch</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span style="font-weight:bold;">Cấu hình Kibana</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span># vi /etc/kibana/kibana.yml</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span>Đổi thành: </span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span>server.host: “66.0.0.66”</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span>elasticsearch.url: “66.0.0.66:9200”</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span>( Lưu ý trước server.host, server.port và elasticsearch.url không có dấu # )</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span style="font-weight:bold;">Khởi động dịch vụ</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span># systemctl start kibana</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span># systemctl enable kibana</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span><span style="font-weight:bold;">Cài đặt Nginx</span> ( việc cài đặt nginx có thể có hoặc không có, tùy vào mục đích )</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span># yum -y install epel-release</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span># yum -y install nginx </span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span style="font-weight:bold;">Chỉnh sửa file cấu hình nginx</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span># vi /etc/nginx/nginx.conf</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span style="font-weight:bold;">Tìm và xóa đoạn server { } – xóa đến khi đoạn cuối file chỉ còn như sau:</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span>include /etc/nginx/conf.d/*.conf;</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span>}</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span style="font-weight:bold;">Sau đó ta tạo file mới, ghi nội dung của kibana:</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span># vi /etc/nginx/conf.d/kibana.conf</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span>server {</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span>listen 80;</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span style="text-indent:0.5in;">server_name dnu.vn;</span></p><p style="color:rgb(11, 35, 45);text-align:left;"><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; auth_basic &quot;Restricted Access&quot;;</span></p><p style="color:rgb(11, 35, 45);text-align:left;"><span style="text-indent:0.5in;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; location / {</span></p><p style="color:rgb(11, 35, 45);text-align:left;"><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proxy_pass http://localhost:5601;</span></p><p style="color:rgb(11, 35, 45);text-align:left;"><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proxy_http_version 1.1;</span></p><p style="color:rgb(11, 35, 45);text-align:left;"><span style="text-indent:0.5in;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proxy_set_header Upgrade $http_upgrade;</span></p><p style="color:rgb(11, 35, 45);text-align:left;"><span style="text-indent:48px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proxy_set_header Connection 'upgrade';</span></p><p style="color:rgb(11, 35, 45);text-align:left;"><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proxy_set_header Host $host;</span></p><p style="color:rgb(11, 35, 45);text-align:left;"><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proxy_cache_bypass $http_upgrade;&nbsp; </span></p><p style="color:rgb(11, 35, 45);text-align:left;"><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</span></p><p style="color:rgb(11, 35, 45);text-align:left;"><span style="text-indent:0.5in;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span style="font-weight:bold;">Sau đó ta khởi động dịch vụ nginx và logstash</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span># systemctl start nginx</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span># systemctl enable nginx</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span># systemctl start logstash</span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span># systemctl enable logstash</span></p><p style="color:rgb(11, 35, 45);text-align:left;"><span style="color:inherit;"></span></p><p style="color:rgb(11, 35, 45);text-align:left;text-indent:0.5in;"><span><span style="font-weight:bold;">Giờ ta có thể vào ELK thông qua giao diện Kibana qua:</span></span><a href="http://%28ip%29:5601/"><span>http://(IP):5601</span></a></p><p style="color:rgb(11, 35, 45);text-align:left;"><span style="font-weight:bold;">4. Video hướng dẫn</span><br></p></span></h3></div>
</div><div data-element-id="elm_7fiuuY25p5NZectmFrL1wA" data-element-type="video" class="zpelement zpelem-video "><style type="text/css"> [data-element-id="elm_7fiuuY25p5NZectmFrL1wA"].zpelem-video{ border-style:none; border-radius:1px; box-shadow:0px 0px 0px 0px #000000; } </style><div class="zpvideo-container zpiframe-align-center zpiframe-mobile-align- zpiframe-tablet-align-"><iframe class="zpvideo " width="560" height="315" src="//www.youtube.com/embed/MYaygdxi9J8" frameborder="0" allowfullscreen></iframe></div>
</div><div data-element-id="elm_99v5wOqajB7897KWF7uSEQ" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_99v5wOqajB7897KWF7uSEQ"].zpelem-text { text-transform:none; border-style:none; border-radius:1px; box-shadow:0px 0px 0px 0px #000000; } [data-element-id="elm_99v5wOqajB7897KWF7uSEQ"].zpelem-text :is(h1,h2,h3,h4,h5,h6){ text-transform:none; } </style><div class="zptext zptext-align-left " data-editor="true"><p><br></p><p><span style="color:inherit;">-----&amp;-----&amp;-----</span><br></p></div>
</div></div></div></div></div></div> ]]></content:encoded><pubDate>Sun, 19 May 2019 13:14:45 +0700</pubDate></item><item><title><![CDATA[Giới thiệu một số công cụ giám sát]]></title><link>https://www.daihockhonggiay.com/blogs/post/gioi-thieu-mot-so-cong-cu-giam-sat</link><description><![CDATA[<img align="left" hspace="5" src="https://www.daihockhonggiay.com/ELK/5.jpg"/>Giới thiệu cho các bạn một số công cụ giám sát tốt nhất]]></description><content:encoded><![CDATA[<div class="zpcontent-container blogpost-container "><div data-element-id="elm_VeL8WPSHQeO30uwUcShK4Q" data-element-type="section" class="zpsection "><style type="text/css"></style><div class="zpcontainer-fluid zpcontainer"><div data-element-id="elm_O5mDcz8WSFWGd_A7-SQ7Eg" data-element-type="row" class="zprow zprow-container zpalign-items- zpjustify-content- " data-equal-column=""><style type="text/css"></style><div data-element-id="elm_rJixgqbEQaia7IQ9SMNXMg" data-element-type="column" class="zpelem-col zpcol-12 zpcol-md-12 zpcol-sm-12 zpalign-self- "><style type="text/css"></style><div data-element-id="elm_LoIYVe8hQVmEg5dTgr7i_g" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_LoIYVe8hQVmEg5dTgr7i_g"].zpelem-text { border-style:none; } </style><div class="zptext zptext-align-left " data-editor="true"><p><span style="font-size:14px;color:rgb(11, 35, 45);"><b>1. Splunk</b><b></b></span></p><p style="text-align:justify;"><span style="color:rgb(11, 35, 45);font-size:14px;"><b><i>&nbsp; &nbsp; </i></b>Splunk là một phần mềm giám dựa trên việc phân tích Log. Splunk thực hiện các công việc tìm kiếm, giám sát và phân tích các dữ liệu lớn được sinh ra từ các ứng dụng, các hệ thống và các thiết bị hạ tầng mạng. Splunk được xây dựng dựa trên nền tảng Lucene và MongoDB với một giao diện web hết sức trực quan.&nbsp;</span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; Tính năng: </span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; - Hỗ trợ hầu như tất cả các loại log của hệ thống, thiết bị hạ tầng mạng, phần mềm, Firewall, IDS/IPS, Log Event, Register của các máy trạm …</span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; - Có thể thực hiện việc thu thập log từ rất nhiều nguồn khác nhau.</span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; - Cập nhật dữ liệu liên tục khi có thay đổi trong thời gian thực. Giúp cho việc phát hiện và cảnh báo trong thời gian thực.</span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; - Có thể đánh chỉ mục dữ liệu với một khối lượng dữ liệu rất lớn trong một khoảng thời gian ngắn.</span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; - Làm việc rất tốt với dữ liệu lớn và cập nhật liên tục.</span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; - Cung cấp cho người dùng một cơ chế cảnh báo dựa trên việc tìm kiếm các thông tin do chính người sử dụng đặt ra.</span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; - Cung cấp một cơ chế hiển thị rất trực quan giúp người sử dụng có thể dễ dàng hình dung về tình trạng của hệ thống, đưa ra các đánh giá về hệ thống.</span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; Nhược điểm:</span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; - Là phần mềm trả phí, cần phải chi trả một khoản kinh phí lớn.</span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; - Có phiên bản miễn phí, nhưng chỉ đáp ứng một số chức năng nhất định.</span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; - Cần đầu tư xây dựng hệ thống riêng, tốn kém.</span></p><h3 style="text-align:justify;"><span style="color:rgb(11, 35, 45);font-size:14px;"><b>2</b><b>.</b><b> Zabbix</b><b></b></span></h3><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; Zabbix là một phần mềm doanh nghiệp mã nguồn mở giám sát mạng và ứng dụng, được tạo ra bởi Alexei Vladishev và được công bố lần đầu tiên vào năm 2001. Nó được thiết kế để giúp quản trị mạng giám sát và theo dõi tình trạng của các dịch vụ mạng, máy chủ và phần cứng mạng khác một cách thông minh nhằm đảm bảo hệ thống luôn luôn được ổn định.&nbsp;</span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; Tính năng:</span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; - Giám sát cả Server và thiết bị mạng</span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; - Dễ dàng thao tác và cấu hình</span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; - Đáng tin cậy trong việc chứng thực người dùng vàphân quyền người dùng</span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; - Giao diện web đẹp mắt, cung cấp biểu đổ theo dõi và báo cáo</span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; - Mã nguồn mở và chi phí thấp</span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; Nhược điểm:</span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; - Hiệu suất còn thấp, chỉ có thể đáp ứng hiệu quả khi số lượng node dưới 1000.</span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; - Chỉ mạnh trong giám sát hiệu năng của hệ thống, khó tùy chỉnh.&nbsp; </span></p><h3 style="text-align:justify;"><span style="color:rgb(11, 35, 45);font-size:14px;"><b>3</b><b>.</b><b> Nagios</b><b></b></span></h3><p style="text-align:justify;"><span style="color:rgb(11, 35, 45);font-size:14px;"><b><i>&nbsp; &nbsp; </i></b>Nagios là 1 công cụ giám sát nguồn mở giúp giám sát hạ tầng mạng. Phần mềm ra mắt vào năm 1999, được bảo trợ bởi Nagios Enterprises. Nagios có thể đưa ra cảnh báo tới người dùng khi hệ thống gặp sự cố.&nbsp;</span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">Phần mềm được thiết kế với khả năng mở rộng và tính linh hoạt cao. Một số sản phẩm của Nagios như: Nagios XI, Nagios log server, Nagios Network Analyzer, Nagios Fusion</span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp;Tính năng:</span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp;- Giám sát các dịch vụ mạng và các host .</span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp;- Các plugin đơn giản, dễ dàng phát triển và kiểm tra dịch vụ</span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp;- Phát hiện và phân biệt các host bị down và host không thể truy cập được</span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp;- Hỗ trợ giám sát dự phòng</span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp;- Có giao diện web </span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp;- Cung cấp lịch sử ghi lại các cảnh báo, thông báo, sự cố...</span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp;Nhược điểm: </span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp;- Chỉ mạnh về giám sát được hiệu năng hệ thống và một số dịch vụ mạng, khó tùy chỉnh.</span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp;- Khả năng tối ưu hóa chưa cao.</span></p><h3 style="text-align:justify;"><span style="color:rgb(11, 35, 45);font-size:14px;"><b>4</b><b>.</b><b> HP ArcSight Logger</b><b></b></span></h3><p style="text-align:justify;"><span style="color:rgb(11, 35, 45);font-size:14px;"><b><i>&nbsp; &nbsp; </i></b>HP ArcSight Logger là một sản phẩm trong bộ sản phẩm ArcSight của Hp. Nó cung cấp một giải pháp hiệu quả về trong việc quản lý log. Nó có khả năng thu thập, phân tích và lưu trữ với một khối lượng Log lớn với nhiều loại định dạng khác nhau. Nó hỗ trợ việc triển khai hệ thống dưới nhiều hình thức như thiết bị, phần mềm, máy ảo hoặc các dịch vụ đám mây.&nbsp;</span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp;Ưu điểm:</span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp;- Hỗ trợ nhiều loại định dạng Log: Syslog, Eventlog, Device Log …</span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp;- Phân tích toàn diện dữ liệu.</span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp;- Cảnh báo và giám sát hệ thống trong thời gian thực.</span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp;- Đánh chỉ mục dữ liệu, tìm kiếm và kết xuất báo cáo.</span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp;- Giải quyết được một số bài toán nhất định.</span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp;Nhược điểm:</span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp;- Hiệu năng xử lý phụ thuộc vào thiết bị, muốn nâng cấp phải mua thiết bị mới.</span></p><p style="text-align:justify;"><span style="font-size:14px;color:rgb(11, 35, 45);">&nbsp; &nbsp;- Chi phí đầu tư tốn kém, đắt đỏ.</span></p><p><span style="font-size:14px;color:rgb(11, 35, 45);"></span></p><h3 style="text-align:justify;"><span style="font-size:14px;"><span style="color:rgb(11, 35, 45);"><b>5</b><b>.</b><b> PRTG Network Monitor</b><b></b></span><p><span style="color:rgb(11, 35, 45);">&nbsp; &nbsp;PRTG Network Monitor là 1 sản phẩm của tập đoàn công nghệ phần mềm Paessler, thành lập từ năm 1997. Hiện nay PRTG đang có mặt trên thị trường quốc tế tại nhiều thị trường, hỗ trợ các đối tác và khách hàng trên toàn cầu. PRTG Network Monitor là hệ thống giám sát mạng, server nói chung &amp; lưu lượng băng thông nói riêng nổi tiếng trên thế giới thuộc công ty Paessler AG, có trụ sở đặt tại thành phố Nuremberg, Đức. Có hai phiên bản của PRTG đó là Network Monitor và Traffic Grapher. Cả hai sản phẩm này đều có các phiên bản miễn phí và phiên bản thương mại.&nbsp;</span></p><p><span style="color:rgb(11, 35, 45);">&nbsp; &nbsp;Ưu điểm: </span></p><p><span style="color:rgb(11, 35, 45);">&nbsp; &nbsp;- Sử dụng nhiều loại cảm biến để giám sát.</span></p><p><span style="color:rgb(11, 35, 45);">&nbsp; &nbsp;- Thông qua SNMP để giám sát băng thông mạng.</span></p><p><span style="color:rgb(11, 35, 45);">&nbsp; &nbsp;- Giám sát được một số dịch vụ đơn giản, máy chủ, Qos,…</span></p><p><span style="color:rgb(11, 35, 45);">&nbsp; &nbsp;Nhược điểm:</span></p><p><span style="color:rgb(11, 35, 45);">&nbsp; &nbsp;- Là phần mềm trả phí, cần phải chi trả một khoản kinh phí lớn.</span></p><p><span style="color:rgb(11, 35, 45);">&nbsp; &nbsp;- Có phiên bản miễn phí nhưng vẫn chỉ cung cấp một số chức năng nhất định.</span></p><p><span style="color:rgb(11, 35, 45);"><br></span></p><p style="text-align:left;"><span style="color:rgb(11, 35, 45);font-weight:bold;">6. ELK Stack</span></p><p style="text-indent:0px;text-align:left;"><span style="color:rgb(11, 35, 45);text-indent:0.5in;">&nbsp; &nbsp;ELK là viết tắt của tập hợp 3 phần mềm cốt lõi đi kèm với nhau, phục vụ cho công việc giám sát hệ thống. Ba phần mềm này lần lượt là Elasticsearch, Logstash và Kibana. ELK được phát triển từ đầu những năm 2000 và cho đến nay đã hơn 250 triệu lượt tải xuống và sử dụng. Đây là bộ công cụ giám sát tập trung mã nguồn mở rất mạnh, có thể xử lý rất nhiều bài toán quản lý hệ thống mạng nên rất được các công ty, tổ chức tin dùng.</span></p><p style="text-indent:0px;text-align:left;"><span style="text-indent:0.5in;"><span style="color:rgb(11, 35, 45);">&nbsp; &nbsp;<span style="font-weight:bold;">Ưu điểm phần mềm ELK stack:</span></span></span></p><p style="text-indent:0px;text-align:left;"><span style="color:rgb(11, 35, 45);text-indent:0.5in;"><span style="font-weight:700;">&nbsp; &nbsp;</span>- ELK stack là phần mềm mã nguồn mở, không tốn nhiều chi phí khi triển khai.</span></p><p style="text-indent:0px;text-align:left;"><span style="color:rgb(11, 35, 45);text-indent:0.5in;">&nbsp; &nbsp;- ELK mới được phát triển mạnh gần đây, nên cộng đồng hỗ trợ rất đông đúc và mạnh mẽ.</span></p><p style="text-indent:0px;text-align:left;"><span style="color:rgb(11, 35, 45);text-indent:0.5in;">&nbsp; &nbsp;- Thu thập được log từ rất nhiều nguồn khác nhau: log hệ thống, log ứng dụng, log thiết bị mạng, log snmp, log từ các hệ thống API (Application Programming Interface)…</span></p><p style="text-indent:0px;text-align:left;"><span style="color:rgb(11, 35, 45);text-indent:0.5in;">&nbsp; &nbsp;- Khả năng tương thích cao, dễ dàng tích hợp với các hệ thống khác mà không gặp khó khăn.</span></p><p style="text-indent:0px;text-align:left;"><span style="color:rgb(11, 35, 45);text-indent:0.5in;">&nbsp; &nbsp;- Giao diện Kibana trực quan, sinh động.</span></p><p style="text-indent:0px;text-align:left;"><span style="color:rgb(11, 35, 45);text-indent:0.5in;">&nbsp; &nbsp;- Phương tiện cảnh báo đa dạng, tích hợp với email, sms, slack, các ứng dụng OTP (One Time Password) như Telegram, Whatsapp,...</span></p><p style="text-indent:0px;text-align:left;"><span style="color:rgb(11, 35, 45);text-indent:0.5in;">&nbsp; &nbsp;- Hiệu năng xử lý cao, có thể chịu tải được một lượng lớn dữ liệu (log) đẩy về mà không phải quá phụ thuộc vào khả năng xử lý của phần cứng.</span></p><p style="text-indent:0px;text-align:left;"><span style="color:rgb(11, 35, 45);text-indent:0.5in;">&nbsp; &nbsp;- Giải quyết được hầu hết các bài toán trong giám sát hệ thống mạng: giám sát hạ tầng, giám sát dịch vụ, giám sát an ninh, giám sát người dùng,... Đây là đặc điểm chính giúp cho ELK trong tương lai sẽ được các công ty và tổ chức sử dụng để triển khai hệ thống giám sát tập trung bên trong hệ thống mạng của họ.</span></p><p style="text-indent:0px;text-align:left;"><span style="text-indent:0.5in;"><span style="color:rgb(11, 35, 45);">&nbsp; &nbsp;<span style="font-weight:bold;">Các thành phần chính trong ELK stack gồm 4 thành phần:</span></span></span></p><p style="text-indent:0px;text-align:left;"><b style="color:rgb(11, 35, 45);text-indent:0.5in;">&nbsp; &nbsp;- Elasticsearch</b><b style="color:rgb(11, 35, 45);text-indent:0.5in;">:</b><span style="color:rgb(11, 35, 45);text-indent:0.5in;"> Dùng để tìm kiếm và query log</span></p><p style="text-indent:0px;text-align:left;"><span style="color:rgb(11, 35, 45);text-indent:0.5in;">&nbsp; &nbsp;</span><b style="color:rgb(11, 35, 45);text-indent:0.5in;">- Logstash</b><b style="color:rgb(11, 35, 45);text-indent:0.5in;">:</b><span style="color:rgb(11, 35, 45);text-indent:0.5in;"> Tiếp nhận log từ nhiều nguồn, sau đó xử lý log và ghi vào cơ sở dữ liệu.</span></p><p style="text-indent:0px;text-align:left;"><span style="color:rgb(11, 35, 45);text-indent:0.5in;">&nbsp; &nbsp;</span><b style="color:rgb(11, 35, 45);text-indent:0.5in;">- Kibana</b><b style="color:rgb(11, 35, 45);text-indent:0.5in;">:</b><span style="color:rgb(11, 35, 45);text-indent:0.5in;"> Giao diện để quản lý, thống kê log. Đọc thông tin từ Elasticsearch.</span></p><p style="text-indent:0px;text-align:left;"><span style="color:rgb(11, 35, 45);text-indent:0.5in;">&nbsp; &nbsp;</span><b style="color:rgb(11, 35, 45);text-indent:0.5in;">- Beats:</b><span style="color:rgb(11, 35, 45);text-indent:0.5in;"> Một tập các công cụ chuyên dùng để thu thập dữ liệu cực mạnh.</span></p><p style="text-indent:0px;text-align:left;"><span style="color:rgb(11, 35, 45);text-indent:0.5in;"><br></span></p><p style="text-indent:0px;text-align:left;"><span style="color:rgb(11, 35, 45);">-----&amp;-----&amp;-----</span><span style="color:rgb(11, 35, 45);text-indent:0.5in;"><br></span></p></span></h3></div>
</div></div></div></div></div></div> ]]></content:encoded><pubDate>Sun, 19 May 2019 11:52:37 +0700</pubDate></item><item><title><![CDATA[Các yêu cầu giám sát hệ thống mạng]]></title><link>https://www.daihockhonggiay.com/blogs/post/cac-yeu-cau-giam-sat-he-thong-mang</link><description><![CDATA[<img align="left" hspace="5" src="https://www.daihockhonggiay.com/ELK/bia.jpg"/>Giám sát hệ thống mạng là việc sử dụng một hệ thống để liên tục theo dõi một thành phần trong mạng máy tính, xem xét tình trạng hoạt động của thành phần đó bên trong mạng, thông báo lại cho quản trị viên khi thành phần đang được giám sát phát sinh vấn đề.]]></description><content:encoded><![CDATA[<div class="zpcontent-container blogpost-container "><div data-element-id="elm_J5BM-ujPSG-ofYHGhy3v4Q" data-element-type="section" class="zpsection "><style type="text/css"></style><div class="zpcontainer-fluid zpcontainer"><div data-element-id="elm_gTQdaKIpRSezubq9nojnag" data-element-type="row" class="zprow zprow-container zpalign-items- zpjustify-content- " data-equal-column=""><style type="text/css"></style><div data-element-id="elm_gDiT6dP1T2W263o2elzmlQ" data-element-type="column" class="zpelem-col zpcol-12 zpcol-md-12 zpcol-sm-12 zpalign-self- "><style type="text/css"> [data-element-id="elm_gDiT6dP1T2W263o2elzmlQ"].zpelem-col{ border-style:none; } </style><div data-element-id="elm_yKJddscSShWpRA_056sUTA" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_yKJddscSShWpRA_056sUTA"].zpelem-text { border-style:none; } </style><div class="zptext zptext-align-left " data-editor="true"><p><span style="color:inherit;font-size:14px;"><b>1. Giới thiệu chung</b><b></b></span></p><p style="text-align:justify;text-indent:0.5in;"><span style="font-size:14px;">Giám sát hệ thống mạng là việc sử dụng một hệ thống để liên tục theo dõi một thành phần trong mạng máy tính, xem xét tình trạng hoạt động của thành phần đó bên trong mạng, thông báo lại cho quản trị viên khi thành phần đang được giám sát phát sinh vấn đề. Có rất nhiều các thành phần cần được giám sát khi hệ thống hoạt động như: Người dùng, Hạ tầng, Dịch vụ,... Giám sát hệ thống mạng là cần thiết vì nó sẽ giúp quản trị viên nhanh chóng biết được những sự cố đang xảy ra trên thành phần đang được giám sát, từ đó đề ra phương án giải quyết. </span></p><p style="text-align:justify;text-indent:0.5in;"><span style="font-size:14px;">Thông thường một mạng máy tính tối thiểu cần có máy chủ (Server), đường truyền, các thiết bị kết nối (Repeater, Hub, Switch, Bridge,...), máy tính người dùng (Client), card mạng (Network Interface Card – NIC) để kết nối các máy tính lại với nhau. Do hệ thống mạng có rất nhiều các thiết bị kết nối nên công tác giám sát càng đóng vai trò quan trọng để có thể duy trì hệ thống mạng hoạt động một cách ổn định, trơn tru và hiệu quả.</span></p><p style="text-align:justify;text-indent:0.5in;"><span style="font-size:14px;">Một hệ thống giám sát gồm có nhiều thành phần: Máy trinh sát (Sensor), Máy thu thập (Collector), Cơ sở dữ liệu trung tâm và Công cụ phân tích (Analysis tool). Mỗi một thành phần bao gồm các chức năng riêng, cùng các phương pháp thu thập, phân tích và liệt kê nhằm đảm bảo đánh giá và phản hồi sự kiện xảy ra trong hệ thống mạng một cách nhanh chóng và chính xác nhất:</span></p><p style="text-align:justify;text-indent:0.5in;"><span style="font-size:14px;">- Máy trinh sát (Sensor): là những máy trạm làm nhiệm vụ trinh sát. Thành phần này sẽ tiếp cận, tương tác với các hệ thống và dịch vụ cần giám sát để nhận biết trạng thái của những dịch vụ đó. Trong quá trình triển khai hệ&nbsp; thống, thành phần này sẽ được phân tán nằm rải rác nhiều nơi trên mạng để thu thập thông tin từ những nguồn khác nhau như: Tường lửa, Bộ định tuyến, File nhật ký…</span></p><p style="text-align:justify;text-indent:0.5in;"><span style="font-size:14px;">- Máy thu thập (Collector): Một điều đáng chú ý trong hệ thống giám sát mạng là các hệ thống, các dịch vụ cần giám sát có thể khác nhau. Điều này đồng nghĩa với việc thông tin thu được cũng có nhiều dạng khác nhau. Để có được thông tin một cách đồng nhất nhằm mục đích xử lý và thống kê, cần có một thành phần làm nhiệm vụ chuẩn hóa thông tin. Máy thu thập sẽ đọc những thông tin thu được từ các máy trinh sát và chuẩn hóa thông tin dựa trên những quy tắc chuẩn hóa biết trước. Thông tin đầu ra sẽ có định dạng giống nhau và được lưu vào cơ sở dữ liệu trung tâm.</span></p><p style="text-align:justify;text-indent:0.5in;"><span style="font-size:14px;">- Cơ sở dữ liệu trung tâm: là nơi lưu trữ dữ liệu của toàn bộ hệ thống giám sát. Các dữ liệu ở đây đã được chuẩn hóa nên có thể sử dụng để tính toán các số liệu thống kê trên toàn hệ thống</span></p><p style="text-align:justify;text-indent:0.5in;"><span style="font-size:14px;">- Công cụ phân tích (Analysis tool): Thành phần này sẽ đọc các dữ liệu từ cơ sở dữ liệu trung tâm và tính toán để tạo ra bản báo cáo số liệu thống kê trên toàn hệ thống.</span></p><p style="text-align:justify;text-indent:0.5in;"><span style="font-size:14px;">Về cơ chế hoạt động, mỗi máy trinh sát sẽ có một danh sách những đối tượng mà máy trinh sát đó cần giám sát. Những đối tượng này có thể là file nhật ký hoạt động trên một máy tính, có thể là một dịch vụ trên hệ thống khác, cũng có thể là thành phần báo cáo trạng thái của Tường lửa/Bộ định tuyến… Dựa vào bản danh sách này, Máy trinh sát sẽ gửi truy vấn đến đối tượng để truy vấn thông tin. Thông tin thu thập được sẽ gửi đến Máy thu thập để chuẩn hóa trước khi lưu trữ vào cơ sở dữ liệu trung tâm. Tùy theo thiết kế của hệ thống, nếu những thông tin mà Máy trinh sát thu thập được có định dạng giống nhau thì sẽ không cần đến thành phần Máy thu thập.</span></p><p style="text-align:justify;text-indent:0.5in;"><span style="font-size:14px;">Trong một số trường hợp khác, các Máy trinh sát cũng có thể kiêm luôn vai trò của Máy thu thập thực hiện việc chuẩn hóa dữ liệu trước khi lưu trữ. Tại cơ sở dữ liệu trung tâm, mọi dữ liệu thu dược đã có định dạng rõ ràng. Bộ phân tích sẽ đọc thông tin tại đây để tính toán và đưa ra những số liệu thống kê tạo thành một bản báo cáo hoàn chỉnh. Báo cáo này sẽ được gửi tới người quản trị. Trong một số hệ thống giám sát, để nâng cao mức độ tự động hóa, Bộ phân tích có thể có thêm chức năng phát hiện dấu hiệu xác định trước để phát ra cảnh báo. Ví dụ, sau khi lấy thông tin từ file nhật ký ghi nhận lại những lần đăng nhập không thành công vào hệ thống, nếu phát hiện thấy có 3 lần đăng nhập không thành công liên tiếp trong vòng 5 phút thì Bộ phân tích phát ra cảnh báo tới người quản trị. Cảnh báo này có thể là thư điện tử, tin nhắn SMS gửi tới điện thoại di động…</span></p><p style="text-align:justify;text-indent:0.5in;"><span style="font-size:14px;">Việc thu thập dữ liệu ở đây chính là việc lấy các thông tin liên quan đến tình trạng hoạt động của các thiết bị trong hệ thống mạng. Tuy nhiên, trong những hệ thống mạng lớn thì các dịch vụ hay các thiết bị không đặt tại trên máy, một địa điểm mà nằm trên các máy chủ, các hệ thống con riêng biệt nhau. Các thành phần hệ thống cũng hoạt động trên những nền tảng hoàn toàn khác nhau. Có 2 phương pháp để thu thập dữ liệu:</span></p><p style="text-align:justify;text-indent:0.5in;"><span style="font-size:14px;">- Phương pháp đẩy: Các sự kiện từ các thiết bị, Các máy trạm, Server sẽ được tự động chuyển về các Collector theo thời gian thực hoặc sau mỗi khoảng thời gian phụ thuộc vào việc cấu hình trên các thiết bị tương ứng. Các Collector của Log Server sẽ thực hiện việc nghe và nhận các sự kiện khi chúng xảy ra. </span></p><p style="text-align:justify;text-indent:0.5in;"><span style="font-size:14px;">- Phương pháp kéo: Các Collector thu tập các sự kiện được phát sinh và lưu trữ trên chính các thiết bị và sẽ được lấy về bởi các bộ Collector. </span></p><p style="text-align:justify;text-indent:0.5in;"><span style="font-size:14px;">Khi đã thu thập được những thông tin về hệ thống thì công việc tiếp theo là phân tích thông tin, cụ thể là việc thực hiện chỉ mục hóa dữ liệu, phát hiện những điều bất thường, những mối đe dọa của hệ thống. Dựa trên những thông tin về lưu lượng truy cập, trạng thái truy cập, định dạng request… </span></p><p style="text-align:justify;text-indent:0.5in;"><span style="font-size:14px;">Tiếp theo là phát hiện và phản ứng. Phát hiện và phản ứng là hai thành phần quan trọng trong các yếu tố của tiến trình. Sau khi phân tích các thông tin và phát hiện các sự cố liên quan đến phần cứng, phần mềm hay các cuộc tấn công bên ngoài , ta sẽ cần phải nhanh chóng đưa ta giải pháp xử lý sự cố một cách nhanh và hiệu quả nhất.</span></p><p style="text-align:justify;text-indent:0.5in;"><span style="font-size:14px;">Sau khi đã thực hiện việc phân tích dữ liệu từ các thông tin thu thập được việc tiếp theo là thực hiện việc đánh giá, đưa thông tin cảnh báo tới người quản trị và thực hiện những công tác nhằm chống lại những mỗi đe dọa, khắc phục các sự cố có thể sảy ra.</span></p><p style="text-align:justify;text-indent:0.5in;"><span style="font-size:14px;">Cảnh báo có thể thông qua email, SMS, hoặc thực thi các mã script nhằm hạn chế hậu quả của sự cố. Khi xảy ra sự cố, hệ thống sẽ tự động gửi email, sms cho người quản trị và cũng có thể chạy script để thêm một địa chỉ IP có biểu hiện tấn công và danh sách đen của Firewall. Việc này đòi hỏi người lập trình phải có hiểu biết sâu và kinh nghiệm về hệ thống.</span></p><p style="text-align:justify;text-indent:0.5in;"><span style="font-size:14px;"><br></span></p><p style="text-align:justify;"><span style="font-size:14px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></p><p></p><h3 align="center" style="text-align:center;"><img src="/ELK/1.jpg"><b><span style="font-size:14px;"><br></span></b></h3><h3 align="center" style="text-align:center;"><b><span style="font-size:14px;color:rgb(11, 35, 45);">Cơ chế hoạt động của hệ thống giám sát</span></b><b></b></h3><div><b><span style="font-size:14px;color:rgb(11, 35, 45);"><br></span></b></div>
<p style="text-align:justify;text-indent:0.5in;"><span style="font-size:14px;">Giới thiệu về log</span></p><p style="text-align:left;"><b><i><span style="font-size:14px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span></i></b><span style="font-size:14px;">Log ghi lại liên tục các thông báo về hoạt động của cả hệ thống hoặc của các dịch vụ được triển khai trên hệ thống và file tương ứng. Log file thường là các file văn bản thông thường dưới dạng “clear text”, có thể dễ dàng đọc được bằng các trình soạn thảo văn bản (vi, vim, nano...) hoặc các trình xem văn bản thông thường (cat, tailf, head...) là có thể xem được file log. Các file log có thể cung cấp các thông tin cần biết, để giải quyết các vấn đề với các ứng dụng, tiến trình được ghi vào log.</span></p><p style="text-align:justify;text-indent:0.5in;"><span style="font-size:14px;">Tóm lại:</span></p><p style="text-align:justify;"><span style="font-size:14px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Log = Thời điểm + Dữ liệu.</span></p><p style="text-align:justify;"><span style="font-size:14px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Log ghi lại những hoạt động của hệ thống.</span></p><p style="text-align:justify;"><br></p><p align="center" style="text-align:center;"></p><h3 align="center" style="text-align:center;"><img src="/ELK/2.jpg"><b><span style="font-size:14px;"><br></span></b></h3><h3 align="center" style="text-align:center;"><b><span style="font-size:14px;color:rgb(11, 35, 45);">Vòng đời chung của Log</span></b><b></b></h3><div><b><span style="font-size:14px;color:rgb(11, 35, 45);"><br></span></b></div>
<p style="text-align:justify;text-indent:0.5in;"><span style="font-size:14px;">Một vòng đời của Log bao gồm 5 bước chính được minh họa trong hình 1.2 cụ thể là: </span></p><p style="text-align:justify;text-indent:0.5in;"><span style="font-size:14px;">- Đầu tiên log sẽ được ghi lại tại chính máy local sau đó nó sẽ được vận chuyển sang máy chủ quản lý log. </span></p><p style="text-align:justify;text-indent:0.5in;"><span style="font-size:14px;">- Người quản trị mạng sẽ từ những bản ghi đó mà tiến hành phân tích, từ đó có thể giám sát được hoạt động của các máy client. </span></p><p style="text-align:justify;text-indent:0.5in;"><span style="font-size:14px;">- Qua bước phân tích này mà người quản trị có thể phát hiện các hoạt động, hành vi xâm nhập không được phép. </span></p><p style="text-align:justify;text-indent:0.5in;"><span style="font-size:14px;">- Sau khi phân tích, dữ liệu log sẽ được lưu trữ để sử dụng lại nếu cần. </span></p><p style="text-align:justify;text-indent:0.5in;"><span style="font-size:14px;">- Bước cuối cùng là xóa, thường những tập tin log không cần thiết có thể được xóa bởi người quản trị nhằm giảm bớt lượng thông tin log không cần thiết.</span></p><p style="text-align:justify;"><b><i><span style="font-size:14px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span></i></b><span style="font-size:14px;">Phân tích các log hoặc các chuỗi thống kê là một nghệ thuật của việc trích dẫn đầy đủ ý nghĩa thông tin và đưa ra kết luận về một trạng thái an toàn từ các bản ghi thống kê những sự việc được sản sinh từ các thiết bị. Phân tích log không phải là 1 khoa học, nhưng ngày nay, việc tin tưởng vào kỹ năng phân tích độc lập và trực quan cũng như tính chất may mắn trong việc phân tích log chất lượng cũng là một khái niệm khoa học. </span></p><p style="text-align:justify;text-indent:0.5in;"><span style="font-size:14px;">Định nghĩa việc phân tích log có thể nghe rất khô khan, nhưng quan trọng là rút ra một “Kết luận có ý nghĩa”. Nhìn một cách đơn giản vào các file log không phải là phân tích, bởi vì hiếm có những cái gì ngoài những sự nhàm chán và dường như chẳng liên quan gì đến nhau. Trong trường hợp một thiết bị 1 người sử dụng với rất ít các hoạt động, tất cả những bản ghi log mà chưa được nhìn trước là rất ít nghi ngờ, nhưng trong thực tế lại không dễ dàng như vậy.</span></p><p style="text-align:justify;"><span style="font-size:14px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Công dụng của Log</span></p><p style="text-align:justify;"><span style="font-size:14px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; - Phân tích nguyên nhân khi có sự cố xảy ra.</span></p><p style="text-align:justify;"><span style="font-size:14px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; - Giúp cho việc khắc phục sự cố nhanh hơn khi hệ thống gặp vấn đề.</span></p><p style="text-align:justify;"><span style="font-size:14px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; - Giúp cho việc phát hiện, dự đoán một vấn đề có thể xảy ra đối với hệ thống.</span></p><p style="text-align:justify;text-indent:0.5in;"><span style="font-size:14px;">Khi xử lý log, thường quản trị viên có thể sử dụng 1 trong 2 phương pháp, đó là: xử lý log trên local và xử lý log tập trung.</span></p><p style="text-align:justify;"><span style="font-size:14px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Log trên Local:</span></p><p style="text-align:justify;"><span style="font-size:14px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; - Chỉ lưu lại bản thân Server</span></p><p style="text-align:justify;"><span style="font-size:14px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; - Dùng command find, tail… để xem log.</span></p><p align="center" style="text-align:center;"></p><h3 align="center" style="text-align:center;"><img src="/ELK/3.jpg"><b><span style="font-size:14px;"><br></span></b></h3><h3 align="center" style="text-align:center;"><b><span style="font-size:14px;color:rgb(11, 35, 45);">Mô hình Log local</span></b><b></b></h3><div><b><span style="font-size:14px;color:rgb(11, 35, 45);"><br></span></b></div>
<p style="text-align:justify;text-indent:0.5in;"><span style="font-size:14px;">Log tập trung:</span></p><p style="text-align:justify;text-indent:0.5in;"><span style="font-size:14px;">Log tâp trung là quá trình tập trung, thu thập, phân tích... các log cần thiết từ nhiều nguồn khác nhau về một nơi an toàn để thuận lợi cho việc phân tích, theo dõi hệ thống.</span></p><p style="text-align:justify;text-indent:0.5in;"><span style="font-size:14px;">Lợi ích của log tập trung:</span></p><p style="text-align:justify;text-indent:0.5in;"><span style="font-size:14px;">- Giúp quản trị viên có cái nhìn chi tiết về hệ thống -&gt; có định hướng tốt hơn về hướng giải quyết.</span></p><p style="text-align:justify;text-indent:0.5in;"><span style="font-size:14px;">- Mọi hoạt động của hệ thống được ghi lại và lưu trữ ở một nơi an toàn (log server) -&gt; đảm bảo tính toàn vẹn phục vụ cho quá trình phân tích điều tra các cuộc tấn công vào hệ thống.</span></p><p style="text-align:justify;text-indent:0.5in;"><span style="font-size:14px;">- Log tập trung kết hợp với các ứng dụng thu thập và phân tích log khác nữa giúp cho việc phân tích log trở nên thuận lợi hơn -&gt; giảm thiểu nguồn nhân lực.</span></p><p style="text-align:justify;text-indent:0.5in;"><span style="font-size:14px;">- Log máy local đẩy về máy Log Server.</span></p><p style="text-align:justify;text-indent:0.5in;"><span style="font-size:14px;">- Mỗi ứng dụng có giao thức đẩy Log khác nhau.</span></p><p align="center" style="text-align:center;"></p><h3 align="center" style="text-align:center;"><img src="/ELK/4.jpg"><b><span style="font-size:14px;"><br></span></b></h3><h3 align="center" style="text-align:center;"><b><span style="font-size:14px;color:rgb(11, 35, 45);">Mô hình Log tập trung</span></b><b></b></h3><div><b><span style="font-size:14px;color:rgb(11, 35, 45);"><br></span></b></div>
<h3><span style="color:rgb(11, 35, 45);"><b><span style="font-size:14px;">2</span></b><b><span style="font-size:14px;">.</span></b><b><span style="font-size:14px;"> Các yêu cầu chung khi giám sát hệ thống mạng</span></b></span></h3><p style="text-align:justify;"><b><i><span style="font-size:14px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span></i></b><span style="font-size:14px;">Về yêu cầu khi giám sát hệ thống mạng, ISO (International Organization for Standardization) đã thiết kế một mô hình được gọi là FCAPS nhằm định hướng rõ những việc mà hệ thống giám sát cần phải quản lý. FCAPS là một mô hình quản lý mạng viễn thông và cũng là kiến trúc quản lý mạng. FCAPS sẽ phân nhóm các đối tượng quản lý mạng vào 5 mức (hay mô đun): Fault-management (F), Configuration level (C), Accounting level (A), Performance level (P) và Security level (S).</span></p><p style="text-align:justify;text-indent:0.5in;"><strong><u><span style="font-size:14px;">Fault management (Quản lý lỗi)</span></u></strong><u><span style="font-size:14px;">:</span></u><span style="font-size:14px;"> Các vấn đề mạng được phát hiện và sửa chữa. Các vấn đề tiềm tàng được xác định và có biện pháp để ngăn chặn chúng xảy ra hoặc tái diễn. Với mô đun Fault management, mạng lưới sẽ hoạt động và thời gian chết được giảm tối thiểu.</span></p><p style="text-align:justify;text-indent:0.5in;"><strong><u><span style="font-size:14px;">Configuration management (</span></u></strong><b><u><span style="font-size:14px;">Quản lý cấu hình):</span></u></b><span style="font-size:14px;"> Mô đun này sẽ thực hiện giám sát và kiểm soát hoạt động của mạng lưới. Điều phối các thay đổi về phần cứng và chương trình, bao gồm cả việc bổ sung thiết bị mới và chương trình mới, sửa đổi các hệ thống hiện có, và xóa bỏ các hệ thống chương trình lỗi thời. Ở mức độ C này, thì tài nguyên của các thiết bị và chương trình được lưu giữ và cập nhật thường xuyên.</span></p><p style="text-align:justify;text-indent:0.5in;"><strong><u><span style="font-size:14px;">Accounting management (</span></u></strong><b><u><span style="font-size:14px;">Quản lý tài khoản):</span></u></b><span style="font-size:14px;"> cũng có thể gọi mô đun này là allocation level, được sử dụng để phân phối các tài nguyên một cách tối ưu và công bằng giữa các người dùng mạng. Điều này giúp sử dụng hiệu quả nhất các hệ thống sẵn có, giảm thiểu chi phí vận hành. </span></p><p style="text-align:justify;text-indent:0.5in;"><strong><u><span style="font-size:14px;">Performance management</span></u></strong><u><span style="font-size:14px;"><b>(Quản lý hiệu năng):</b></span></u><span style="font-size:14px;"> liên quan đến việc quản lý toàn bộ hiệu năng của toàn mạng. Thông lượng tối đa, tắc nghẽn mạng và các vấn đề tiềm tàng cần được xác định. Một phần quan trọng khi quản lý hiệu năng là cần mang lại hiệu suất tổng thể lớn nhất.</span></p><p style="text-align:justify;text-indent:0.5in;"><strong><u><span style="font-size:14px;">Security management (</span></u></strong><b><u><span style="font-size:14px;">Quản lý bảo mật):</span></u></b><span style="font-size:14px;"> xử lý và đảm bảo an ninh mạng lưới bởi tin tặc, những người dùng trái phép, hoặc các thiết bị phá hoại. Tính bảo mật thông tin người dùng cần được duy trì được đảm bảo. Hệ thống an ninh cũng cho phép quản trị viện kiểm soát từng cá nhân có thể (và không thể) được làm những gì với hệ thống.</span></p><p><span style="color:inherit;font-size:14px;"></span></p><h2 style="text-align:justify;"><span style="font-size:14px;"><span style="color:rgb(11, 35, 45);"><span style="font-weight:bold;">3. Các yêu cầu chung về hạ tầng cho giám sát hệ thống mạng</span></span><p><span style="color:rgb(11, 35, 45);"><b><i>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </i></b>Do khối lượng dữ liệu được trao đổi giữa các thành phần trong giám sát mạng là vô cùng lớn, vậy nên ngoài vấn đề về việc quản trị viên cần bao quát được hệ thống, đủ khả năng vận hành và sử dụng hệ thống giám sát tập trung, thì hạ tầng triển khai giám sát tập trung cần phải đủ mạnh và đáp ứng được các yêu cầu khi hệ thống giám sát tập trung hoạt động:</span></p><p><span style="color:rgb(11, 35, 45);">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;- Yêu cầu về thiết bị: Cần có cấu hình phù hợp để vận hành và xây dựng hệ thống giám sát tập trung. Đối với Core Switch phải có tốc độ xử lý cao, hỗ trợ cổng có băng thông lớn. Một số dòng đáp ứng nhu cầu như: Switch Cisco 3750, 3850,... Port 1Gbps. Server phân tích thông tin cần quan tâm đến cấu hình của CPU, Memory, Storage tùy theo nhu cầu bài toán đặt ra. Về CPU thì nên chọn CPU có nhiều lõi (từ 2-8 lõi) với tốc độ trung bình từ 3.6GHz đến 3.9GHz (nên chọn số lõi ưu tiên hơn tốc độ xử lý để gia tăng khả năng xử lý). Memory tùy theo nhu cầu, nên từ 16-64GB. Riêng Disk thì ta phải xem xét lượng dữ liệu thu thập sẽ đổ về server. Chẳng hạn trong 1 ngày trung bình khoảng 1GB dữ liệu đổ về và ta cần lưu trữ dữ liệu thu thập được trong ít nhất 30 ngày (trên 30 ngày tự động xóa) thì ít nhất ổ cứng phải có dung lượng 50GB trở lên (gồm dung lượng hệ điều hành, dữ liệu thu thập được và một khoảng dung lượng phát sinh nếu có).</span></p><p><span style="color:rgb(11, 35, 45);">&nbsp; &nbsp; &nbsp; &nbsp; - Yêu cầu về băng thông đường truyền: Lượng thông tin cần truyền qua lại giữa các thiết bị trong hệ thống giám sát tập trung là vô cùng nhiều nên băng thông đường truyền phải đủ lớn để các luồng dữ liệu di chuyển trong hệ thống không bị tắc nghẽn. Tùy theo tình hình thực tế, cần sử dụng những dây có băng thông lớn từ 1 Gbps đến 10 Gbps. Lưu ý khi sử dụng cáp truyền thì băng thông cần phải đồng bộ với cổng trên các thiết bị Switch và Router.</span></p></span></h2></div>
</div><div data-element-id="elm_OMBmNdZHoHjZsyMdIBjo3A" data-element-type="text" class="zpelement zpelem-text "><style> [data-element-id="elm_OMBmNdZHoHjZsyMdIBjo3A"].zpelem-text { text-transform:none; border-style:none; border-radius:1px; box-shadow:0px 0px 0px 0px #000000; } [data-element-id="elm_OMBmNdZHoHjZsyMdIBjo3A"].zpelem-text :is(h1,h2,h3,h4,h5,h6){ text-transform:none; } </style><div class="zptext zptext-align-left " data-editor="true"><span style="color:inherit;">-----&amp;-----&amp;-----</span></div>
</div></div></div></div></div></div> ]]></content:encoded><pubDate>Sun, 19 May 2019 10:27:27 +0700</pubDate></item></channel></rss>