<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Checkmk &#8211; NhanVPH&#039;s Blog</title>
	<atom:link href="https://blntech.io.vn/tag/checkmk/feed/" rel="self" type="application/rss+xml" />
	<link>https://blntech.io.vn</link>
	<description></description>
	<lastBuildDate>Thu, 14 May 2026 09:22:26 +0000</lastBuildDate>
	<language>vi</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>

<image>
	<url>https://blntech.io.vn/wp-content/uploads/2026/04/cropped-cropped-Logo-BLN-32x32.jpg</url>
	<title>Checkmk &#8211; NhanVPH&#039;s Blog</title>
	<link>https://blntech.io.vn</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Checkmk – Phần 10 – Nhận Cảnh Báo Qua Slack</title>
		<link>https://blntech.io.vn/checkmk-phan-10-nhan-canh-bao-qua-slack/</link>
		
		<dc:creator><![CDATA[nhanvph]]></dc:creator>
		<pubDate>Thu, 14 May 2026 09:21:46 +0000</pubDate>
				<category><![CDATA[Monitor]]></category>
		<category><![CDATA[check_mk]]></category>
		<category><![CDATA[Checkmk]]></category>
		<guid isPermaLink="false">https://blntech.io.vn/?p=2029</guid>

					<description><![CDATA[Tạo channel nhận cảnh báo Trước tiên bạn cần đăng nhập workpace trên web sau đó&#160;tạo channel. Khai báo thông [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h4 class="wp-block-heading">Tạo channel nhận cảnh báo</h4>



<p class="wp-block-paragraph">Trước tiên bạn cần đăng nhập workpace trên web sau đó&nbsp;<a rel="noreferrer noopener" href="https://my.slack.com/services/new/incoming-webhook" target="_blank">tạo channel</a>.</p>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2020/04/image-52-1024x791.png" alt="" class="wp-image-6401"/></figure>



<p class="wp-block-paragraph">Khai báo thông tin cho channel</p>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2020/04/image-53.png" alt="" class="wp-image-6402"/></figure>



<p class="wp-block-paragraph">Chọn slack vừa tạo sau đó chọn 2 để add WebHook</p>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2020/04/image-54.png" alt="" class="wp-image-6403"/></figure>



<p class="wp-block-paragraph">Copy URL của Webhook để sử dụng bên dưới</p>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2020/04/image-55-1024x782.png" alt="" class="wp-image-6404"/></figure>



<h3 class="wp-block-heading">Truy cập vào site checkmk để cấu hình</h3>



<p class="wp-block-paragraph">Tạo rule mới</p>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2020/04/image-57-1024x488.png" alt="" class="wp-image-6406"/></figure>



<p class="wp-block-paragraph">Chọn method là&nbsp;<code>Slack</code>&nbsp;và paste URL Webhook vừa copy ở bên trên vào 2</p>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2020/04/image-58-1024x570.png" alt="" class="wp-image-6407"/></figure>



<p class="wp-block-paragraph">Điều kiện cảnh báo khi host chuyển từ UP -&gt; DOWN</p>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2020/04/image-59.png" alt="" class="wp-image-6408"/></figure>



<p class="wp-block-paragraph">Lưu lại sau đó cập nhật thay đổi</p>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2020/04/image-60-1024x322.png" alt="" class="wp-image-6409"/></figure>



<p class="wp-block-paragraph">Khi một host bị tắt thì bạn sẽ nhận được cảnh báo như sau</p>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2020/04/image-56-1024x475.png" alt="" class="wp-image-6405"/></figure>



<p class="wp-block-paragraph">Đến đây việc cấu hình gửi cảnh báo qua slack đã thành công</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p class="wp-block-paragraph">Nguồn: Tổng hợp</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Checkmk – Phần 9 – Nhận Cảnh Báo Qua telegram</title>
		<link>https://blntech.io.vn/checkmk-phan-9-nhan-canh-bao-qua-telegram/</link>
		
		<dc:creator><![CDATA[nhanvph]]></dc:creator>
		<pubDate>Thu, 14 May 2026 08:49:37 +0000</pubDate>
				<category><![CDATA[Monitor]]></category>
		<category><![CDATA[Checkmk]]></category>
		<guid isPermaLink="false">https://blntech.io.vn/?p=2066</guid>

					<description><![CDATA[Cảnh báo qua mail cùng với check_mk cũng là một cách. Nhưng có nhiều người lại thích dùng với telegram. [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph"><em>Cảnh báo qua mail cùng với check_mk cũng là một cách. Nhưng có nhiều người lại thích dùng với telegram. Ở bài này tôi sẽ hướng dẫn các bạn làm sao để có thể nhận cảnh báo của check_mk cùng với telegram</em></p>



<h2 class="wp-block-heading">I. Tìm ID chat của telegram</h2>



<h5 class="wp-block-heading">1. Tạo bot chat</h5>



<pre class="wp-block-code"><code>https:&#47;&#47;telegram.me/botfather</code></pre>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2019/09/image-34-1024x546.png" alt="" class="wp-image-2233"/><figcaption class="wp-element-caption">Vào link bên trên với trình duyệt để có thể tạo ra bot chat. Chọn open telegram</figcaption></figure>



<p class="wp-block-paragraph">Đây là bot hướng dẫn và tạo một bot theo ý của chúng ta. Chọn&nbsp;<strong>newbot</strong>&nbsp;để tạo ra bot mới.</p>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2019/09/image-35.png" alt="" class="wp-image-2234"/></figure>



<h5 class="wp-block-heading">2. Mỗi bot đều có tên hãy đặt tên cho nó</h5>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2019/09/image-36.png" alt="" class="wp-image-2235"/></figure>



<h5 class="wp-block-heading">3. Tiếp theo ta sẽ phải chọn ra một username cho bot này.</h5>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2019/09/image-37.png" alt="" class="wp-image-2236"/><figcaption class="wp-element-caption">Username của bot phải được kết thúc bằng “bot”. Sau khi có được username hãy nhắn tin với bot đó nhé. Chúng ta hãy để ý token của HTTP API nhé sẽ phải dùng nó đấy</figcaption></figure>



<h5 class="wp-block-heading">4. Chat với bot</h5>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2019/09/image-38.png" alt="" class="wp-image-2237"/><figcaption class="wp-element-caption">Chúng ta có thể tìm nó với tên mà chúng ta đã đặt ở trên và rồi vào chat với nó</figcaption></figure>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2019/09/image-39.png" alt="" class="wp-image-2238"/><figcaption class="wp-element-caption">Các bạn chat gì cũng được nhé!</figcaption></figure>



<h5 class="wp-block-heading">5. Tìm ID chat bằng HTTP API</h5>



<p class="wp-block-paragraph">Cú pháp</p>



<pre class="wp-block-code"><code>https:&#47;&#47;api.telegram.org/botToken/getUpdates</code></pre>



<p class="wp-block-paragraph">Các bạn hãy thay token tìm được ở bên trên của mình nhé</p>



<pre class="wp-block-code"><code>https:&#47;&#47;api.telegram.org/bot908652940:AAGYGskRFhRr42cy4or1FynDMtfKKzTIs6w/getUpdates</code></pre>



<figure class="wp-block-image"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2019/09/image-40-1024x149.png" alt="" class="wp-image-2239"/><figcaption class="wp-element-caption">Sau đó chúng ta sẽ thấy được ID như vậy đó! hãy lưu trữ nó lại nhé!</figcaption></figure>



<h2 class="wp-block-heading">II. Cấu hình trên checkmk</h2>



<h5 class="wp-block-heading">1.Tạo ra file&nbsp;<strong>telegram.py</strong></h5>



<pre class="wp-block-code"><code>vi /omd/sites/monitoring/share/check_mk/notifications/telegram.py</code></pre>



<p class="wp-block-paragraph">Nội dung file&nbsp;&nbsp;<strong>telegram.py</strong>&nbsp;có cú pháp &nbsp;như sau:</p>



<pre class="wp-block-code"><code>#!/usr/bin/env python
# Telegram V2

# Copyright Mathias Kettner  2013  mk@mathias-kettner.de
#           Stefan Gehn      2016  stefan+cmk@srcxbox.net

# check_mk is free software;  you can redistribute it and/or modify it
# under the  terms of the  GNU General Public License  as published by
# the Free Software Foundation in version 2.  check_mk is  distributed
# in the hope that it will be useful, but WITHOUT ANY WARRANTY;  with-
# out even the implied warranty of  MERCHANTABILITY  or  FITNESS FOR A
# PARTICULAR PURPOSE. See the  GNU General Public License for more de-
# ails.  You should have  received  a copy of the  GNU  General Public
# License along with GNU Make; see the file  COPYING.  If  not,  write
# to the Free Software Foundation, Inc., 51 Franklin St,  Fifth Floor,
# Boston, MA 02110-1301 USA.

# Telegram notification based on asciimail notification from
# check_mk 1.2.6p16.

import os
import re
import sys
reload(sys)
sys.setdefaultencoding('utf8')
import urllib
import urllib2
### CHANGE THESE ###
telegram_bot_token = 'TOKEN-HERE'
####################

tmpl_host_text = """*Check_MK: $HOSTNAME$ - $EVENT_TXT$*
```
Host:     $HOSTNAME$
Alias:    $HOSTALIAS$
Address:  $HOSTADDRESS$
Event:    $EVENT_TXT$
Output:   $HOSTOUTPUT$

$LONGHOSTOUTPUT$```"""

tmpl_service_text = """*Check_MK: $HOSTNAME$/$SERVICEDESC$ $EVENT_TXT$*
```
Host:     $HOSTNAME$
Alias:    $HOSTALIAS$
Address:  $HOSTADDRESS$
Service:  $SERVICEDESC$
Event:    $EVENT_TXT$
Output:   $SERVICEOUTPUT$

$LONGSERVICEOUTPUT$```"""

def substitute_context(template, context):
    # First replace all known variables
    for varname, value in context.items():
        template = template.replace('$'+varname+'$', value)

    # Remove the rest of the variables and make them empty
    template = re.sub("\$&#91;A-Z_]&#91;A-Z_0-9]*\$", "", template)
    return template

def construct_message_text(context):
    notification_type = context&#91;"NOTIFICATIONTYPE"]
    if notification_type in &#91; "PROBLEM", "RECOVERY" ]:
        txt_info = "$PREVIOUS@HARDSHORTSTATE$ -&gt; $@SHORTSTATE$"
    elif notification_type.startswith("FLAP"):
        if "START" in notification_type:
            txt_info = "Started Flapping"
        else:
            txt_info = "Stopped Flapping ($@SHORTSTATE$)"
    elif notification_type.startswith("DOWNTIME"):
        what = notification_type&#91;8:].title()
        txt_info = "Downtime " + what + " ($@SHORTSTATE$)"
    elif notification_type == "ACKNOWLEDGEMENT":
        txt_info = "Acknowledged ($@SHORTSTATE$)"
    elif notification_type == "CUSTOM":
        txt_info = "Custom Notification ($@SHORTSTATE$)"
    else:
        txt_info = notification_type # Should neven happen

    txt_info = substitute_context(txt_info.replace("@", context&#91;"WHAT"]), context)

    context&#91;"EVENT_TXT"] = txt_info

    if context&#91;'WHAT'] == 'HOST':
        tmpl_text = tmpl_host_text
    else:
        tmpl_text = tmpl_service_text

    return substitute_context(tmpl_text, context)

def fetch_notification_context():
    context = {}
    for (var, value) in os.environ.items():
        if var.startswith("NOTIFY_"):
            context&#91;var&#91;7:]] = value.decode("utf-8")
    return context

def send_telegram_message(token, chat_id, text):
    url = 'https://api.telegram.org/bot%s/sendMessage' % (token)
    data = urllib.urlencode({'chat_id':chat_id, 'text':text, 'parse_mode':'Markdown'})
    #print("sending telegram message, url '%s', chat id '%s', text '%s'" % (url, chat_id, text))
    try:
        urllib2.urlopen(url, data).read()
    except urllib2.URLError, e:
        sys.stdout.write('Cannot send Telegram message: HTTP-Error %s %s\n' % (e.code, e))

def main():
    context = fetch_notification_context()
    telegram_chatid = context.get('CONTACT_TELEGRAM_CHAT_ID')
    if not telegram_chatid: # e.g. empty field in user database
        sys.stdout.write("Cannot send Telegram message: Empty destination chat id")
        sys.exit(2)
    text = construct_message_text(context)
    send_telegram_message(telegram_bot_token, telegram_chatid, text)

main()</code></pre>



<p class="wp-block-paragraph">Bên trên là bản Scrip mẫu. Các bạn hãy thay token của mình vào đó. Ví dụ tôi thay vào sẽ thành.</p>



<pre class="wp-block-code"><code>#!/usr/bin/env python
# Telegram V2

# Copyright Mathias Kettner  2013  mk@mathias-kettner.de
#           Stefan Gehn      2016  stefan+cmk@srcxbox.net

# check_mk is free software;  you can redistribute it and/or modify it
# under the  terms of the  GNU General Public License  as published by
# the Free Software Foundation in version 2.  check_mk is  distributed
# in the hope that it will be useful, but WITHOUT ANY WARRANTY;  with-
# out even the implied warranty of  MERCHANTABILITY  or  FITNESS FOR A
# PARTICULAR PURPOSE. See the  GNU General Public License for more de-
# ails.  You should have  received  a copy of the  GNU  General Public
# License along with GNU Make; see the file  COPYING.  If  not,  write
# to the Free Software Foundation, Inc., 51 Franklin St,  Fifth Floor,
# Boston, MA 02110-1301 USA.

# Telegram notification based on asciimail notification from
# check_mk 1.2.6p16.

import os
import re
import sys
reload(sys)
sys.setdefaultencoding('utf8')
import urllib
import urllib2
### CHANGE THESE ###
telegram_bot_token = '908652940:AAGYGskRFhRr42cy4or1FynDMtfKKzTIs6w'
####################

tmpl_host_text = """*Check_MK: $HOSTNAME$ - $EVENT_TXT$*
```
Host:     $HOSTNAME$
Alias:    $HOSTALIAS$
Address:  $HOSTADDRESS$
Event:    $EVENT_TXT$
Output:   $HOSTOUTPUT$

$LONGHOSTOUTPUT$```"""

tmpl_service_text = """*Check_MK: $HOSTNAME$/$SERVICEDESC$ $EVENT_TXT$*
```
Host:     $HOSTNAME$
Alias:    $HOSTALIAS$
Address:  $HOSTADDRESS$
Service:  $SERVICEDESC$
Event:    $EVENT_TXT$
Output:   $SERVICEOUTPUT$

$LONGSERVICEOUTPUT$```"""

def substitute_context(template, context):
    # First replace all known variables
    for varname, value in context.items():
        template = template.replace('$'+varname+'$', value)

    # Remove the rest of the variables and make them empty
    template = re.sub("\$&#91;A-Z_]&#91;A-Z_0-9]*\$", "", template)
    return template

def construct_message_text(context):
    notification_type = context&#91;"NOTIFICATIONTYPE"]
    if notification_type in &#91; "PROBLEM", "RECOVERY" ]:
        txt_info = "$PREVIOUS@HARDSHORTSTATE$ -&gt; $@SHORTSTATE$"
    elif notification_type.startswith("FLAP"):
        if "START" in notification_type:
            txt_info = "Started Flapping"
        else:
            txt_info = "Stopped Flapping ($@SHORTSTATE$)"
    elif notification_type.startswith("DOWNTIME"):
        what = notification_type&#91;8:].title()
        txt_info = "Downtime " + what + " ($@SHORTSTATE$)"
    elif notification_type == "ACKNOWLEDGEMENT":
        txt_info = "Acknowledged ($@SHORTSTATE$)"
    elif notification_type == "CUSTOM":
        txt_info = "Custom Notification ($@SHORTSTATE$)"
    else:
        txt_info = notification_type # Should neven happen

    txt_info = substitute_context(txt_info.replace("@", context&#91;"WHAT"]), context)

    context&#91;"EVENT_TXT"] = txt_info

    if context&#91;'WHAT'] == 'HOST':
        tmpl_text = tmpl_host_text
    else:
        tmpl_text = tmpl_service_text

    return substitute_context(tmpl_text, context)

def fetch_notification_context():
    context = {}
    for (var, value) in os.environ.items():
        if var.startswith("NOTIFY_"):
            context&#91;var&#91;7:]] = value.decode("utf-8")
    return context

def send_telegram_message(token, chat_id, text):
    url = 'https://api.telegram.org/bot%s/sendMessage' % (token)
    data = urllib.urlencode({'chat_id':chat_id, 'text':text, 'parse_mode':'Markdown'})
    #print("sending telegram message, url '%s', chat id '%s', text '%s'" % (url, chat_id, text))
    try:
        urllib2.urlopen(url, data).read()
    except urllib2.URLError, e:
        sys.stdout.write('Cannot send Telegram message: HTTP-Error %s %s\n' % (e.code, e))

def main():
    context = fetch_notification_context()
    telegram_chatid = context.get('CONTACT_TELEGRAM_CHAT_ID')
    if not telegram_chatid: # e.g. empty field in user database
        sys.stdout.write("Cannot send Telegram message: Empty destination chat id")
        sys.exit(2)
    text = construct_message_text(context)
    send_telegram_message(telegram_bot_token, telegram_chatid, text)

main()</code></pre>



<p class="wp-block-paragraph">Thay TOKEN bằng TOKEN chúng ta lấy được qua chat box @BotFather</p>



<h5 class="wp-block-heading">2. Cấp quyền cho file&nbsp;<code>telegram.py</code></h5>



<pre class="wp-block-code"><code>chmod +x /omd/sites/monitoring/share/check_mk/notifications/telegram.py</code></pre>



<h5 class="wp-block-heading">3. Restart lại omd server :</h5>



<pre class="wp-block-code"><code>omd restart</code></pre>



<h5 class="wp-block-heading">4. &nbsp;Cấu hình trên WATO</h5>



<p class="wp-block-paragraph">Trên WATO các bạn thực hiện các bước bên dưới như mình nhé!</p>



<p class="wp-block-paragraph">Đâu tiền ta sẽ tạo thêm &nbsp;Attributes User. Sau đó save và cập nhật thay đổi</p>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2019/09/image-41.png" alt="" class="wp-image-2240"/></figure>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2019/09/image-42.png" alt="" class="wp-image-2241"/></figure>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2019/09/image-43.png" alt="" class="wp-image-2242"/><figcaption class="wp-element-caption">Chúng ta sẽ điền thông tin của bot này. Lưu ý tên của trường được add thêm này sẽ được sử dụng để lấy giá trị trong plugin nên để tên giống để có thể sử dụng được plugin bên trên</figcaption></figure>



<p class="wp-block-paragraph"><strong>NOTE</strong>&nbsp;: Theo mặc định thì sẽ mỗi user sẽ không có trường ID của telegram. Mặc định nó chỉ có trường&nbsp;<strong>Email và Pager</strong>&nbsp;nên ta có thể tạo thêm trường tại&nbsp;<strong>New attribute</strong></p>



<ul class="wp-block-list">
<li>Show in WATO host table : Hiển thị trực tiếp trong bảng user hay là không</li>



<li>Editable by Users : Cho phép user thường chỉnh sửa trường đó hay không</li>



<li>Add to monitoring configuration : Giá trị này có được sử dụng trong cảnh báo hay là không</li>
</ul>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2019/09/image-65-1024x465.png" alt="" class="wp-image-2312"/><figcaption class="wp-element-caption">Sau đó ta sẽ tạo ra một user để có thể gửi thông tin cảnh báo</figcaption></figure>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2019/09/image-64-1024x449.png" alt="" class="wp-image-2311"/><figcaption class="wp-element-caption">Ta cần lưu ý và nhập vào mục username và Telegram ID để có thể gửi thông báo tới tele qua ID</figcaption></figure>



<p class="wp-block-paragraph"><strong>NOTE :&nbsp;</strong>Ta có thể cảnh báo vào một bot; một channel; hay là một group trong telegram. Ở trên tôi đã ghi ID của một bot. Vì thế nó sẽ cảnh báo về bot đã được tạo. Để có thể cảnh báo về Group thì ta thay thế ID đó bằng ID của group mà ta muốn.</p>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2020/03/image-167.png" alt="" class="wp-image-6157"/><figcaption class="wp-element-caption">Nếu muốn cảnh báo về group ta tạo thêm group mới trong telegram.</figcaption></figure>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2020/03/image-168.png" alt="" class="wp-image-6158"/><figcaption class="wp-element-caption">Sau đó ta add bot mà ta đã tạo vào trong group</figcaption></figure>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2020/03/image-169.png" alt="" class="wp-image-6159"/><figcaption class="wp-element-caption">Ta chat trong group đó.</figcaption></figure>



<p class="wp-block-paragraph">Sau đó ta Sử dụng HTTP API token để lấy ID của group chat với cú pháp</p>



<pre class="wp-block-code"><code>
https:&#47;&#47;api.telegram.org/bot$token/getUpdates
ví dụ:
https://api.telegram.org/bot908652940:AAGYGskRFhRr42cy4or1FynDMtfKKzTIs6w/getUpdates</code></pre>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2020/03/image-171-1024x340.png" alt="" class="wp-image-6161"/><figcaption class="wp-element-caption">Và ID có dấu trừ đằng trước chính là ID của group.</figcaption></figure>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2020/03/image-176-1024x431.png" alt="" class="wp-image-6187"/><figcaption class="wp-element-caption">Sau đó ta thay giá trị ID của group vào đây. Vậy&nbsp;<em>là có thể cảnh báo về group rồi nhé.</em></figcaption></figure>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2020/03/image-178-1024x478.png" alt="" class="wp-image-6189"/><figcaption class="wp-element-caption">1: Có thể tắt hoặc không tắt chức năng đăng nhập vào site<br>2: xác định đây là một user thường</figcaption></figure>



<p class="wp-block-paragraph">Sau đó ta tạo ra cảnh báo với telegram</p>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2019/09/image-46.png" alt="" class="wp-image-2245"/><figcaption class="wp-element-caption">Tạo ra các rules thông báo mới cho telegram</figcaption></figure>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2019/09/image-47.png" alt="" class="wp-image-2246"/><figcaption class="wp-element-caption">Chúng ta tạo rules hãy chọn đúng tên như bên trên đã điền vào nhé</figcaption></figure>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2019/09/image-48.png" alt="" class="wp-image-2247"/><figcaption class="wp-element-caption">Đến đây là xong hãy lưu lại cập nhật để chúng bắt đầu hoạt động</figcaption></figure>



<p class="wp-block-paragraph">Cuối cùng chúng ta hãy kiểm tra xem bot đã hoạt động chưa bằng cách tắt máy mà chúng ta theo dõi với telegram</p>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2019/09/image-49.png" alt="" class="wp-image-2248"/></figure>



<p class="wp-block-paragraph"><em>Vậy là mọi thứ đã hoạt động bình thường, chúc các bạn thành công!</em></p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p class="wp-block-paragraph">Nguồn: Tổng hợp</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Checkmk – Phần 8 – Nhận Cảnh Báo Qua Gmail</title>
		<link>https://blntech.io.vn/checkmk-phan-8-nhan-canh-bao-qua-gmail/</link>
		
		<dc:creator><![CDATA[nhanvph]]></dc:creator>
		<pubDate>Thu, 14 May 2026 08:11:53 +0000</pubDate>
				<category><![CDATA[Monitor]]></category>
		<category><![CDATA[Checkmk]]></category>
		<guid isPermaLink="false">https://blntech.io.vn/?p=2068</guid>

					<description><![CDATA[Thời gian mỗi ngày đều có 24h. Chúng ta không thể lúc nào cũng vào check_mk xem các thiết bị [&#8230;]]]></description>
										<content:encoded><![CDATA[
<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph"><em>Thời gian mỗi ngày đều có 24h. Chúng ta không thể lúc nào cũng vào check_mk xem các thiết bị có hoạt động ở trạng thái tốt nhất hay không. Ở đây tôi sẽ hướng dẫn mọi người cách thêm những cảnh báo cho những host mà ta giám sát chúng</em></p>
</blockquote>



<h2 class="wp-block-heading">I. Cấu hình relay gmail</h2>



<h5 class="wp-block-heading">1. Cài đặt gói&nbsp;<strong>postfix</strong>&nbsp;để relay gmail</h5>



<pre class="wp-block-code"><code>yum -y install postfix cyrus-sasl-plain mailx</code></pre>



<h5 class="wp-block-heading">2. Cấu hình xác thực cho gmail</h5>



<p class="wp-block-paragraph">Các thông tin cấu hình của postfix được lưu trữ trong folder <code><strong>/etc/postfix</strong></code>. Vậy chúng ta sẽ tạo luôn thông tin của Gmail ở đây</p>



<pre class="wp-block-code"><code>vi /etc/postfix/sasl_passwd</code></pre>



<p class="wp-block-paragraph">Thêm vào đó nội dung có cú pháp như sau</p>



<pre class="wp-block-code"><code>&#91;smtp.gmail.com]:587    username@gmail.com:password</code></pre>



<p class="wp-block-paragraph">Ví dụ</p>



<pre class="wp-block-code"><code>&#91;smtp.gmail.com]:587 <mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-info-color">test01@gmail.com</mark>:<mark style="background-color:rgba(0, 0, 0, 0);color:#cf2e2e" class="has-inline-color">Test123</mark></code></pre>



<h5 class="wp-block-heading">3. Khai báo địa chỉ lưu trữ thông tin của gmail trong file cấu hình của nó&nbsp;<strong>/etc/postfix/main.cf</strong></h5>



<pre class="wp-block-code"><code>relayhost = &#91;smtp.gmail.com]:587
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_security_options =
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_tls_CAfile = /etc/ssl/certs/ca-bundle.</code></pre>



<p class="wp-block-paragraph">Trong gmail có một chức năng chặn một số truy cập kém an toàn ta cần phải bật chức năng cho phép tất cả các truy cập đều có thể vào được và ta làm điều đó tại link bên dưới</p>



<pre class="wp-block-code"><code>https:&#47;&#47;myaccount.google.com/lesssecureapps?pli=1</code></pre>



<h5 class="wp-block-heading">4. Cấp quyền sử dụng và đọc file lưu trữ thông tin của Gmai</h5>



<pre class="wp-block-code"><code>chown root:postfix /etc/postfix/sasl_passwd*
chmod 600 /etc/postfix/sasl_passwd
postmap /etc/postfix/sasl_passwd</code></pre>



<h5 class="wp-block-heading">5. Khởi động dịch vụ postfix</h5>



<pre class="wp-block-code"><code>systemctl start postfix
systemctl enable postfix</code></pre>



<h5 class="wp-block-heading">6. Kiểm tra xem dịch vụ đó đã được hoạt động hay chưa</h5>



<pre class="wp-block-code"><code>echo "This is a test." | mail -s "test message" test02@gmail.com</code></pre>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2019/09/image-12.png" alt="" class="wp-image-2188"/><figcaption class="wp-element-caption">Sau đó vào mail để kiểm tra lại xem nó đã hoạt động được hay chưa</figcaption></figure>



<h2 class="wp-block-heading">II. Cấu hình gửi mail trong check_mk</h2>



<ul class="wp-block-list">
<li>Các bước cài đặt trên giúp cho OMD server có thể gửi mail thông báo đi đến các mail của người nào cần nhận thông báo để giải quyết vấn đề.</li>



<li>Bây giờ chúng ta sẽ đi vào các bước để OMD server sẽ tự động gửi thông báo</li>



<li>Có thể gửi thông báo đến một hoặc nhiều gmail khác nhau. Ở đây tôi sẽ hướng dẫn tạo ra một group nhận cảnh báo có thể add thêm user để có thêm nhiều mail nhận cùng một cảnh báo</li>
</ul>



<h5 class="wp-block-heading">1. Tạo ra một group những người có thể nhận thông báo</h5>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2019/09/image-13.png" alt="" class="wp-image-2189"/></figure>



<p class="wp-block-paragraph">Đầu tiên ta sẽ vào contact groups sau đó ta nhấn vào new contact group để tạo ra một group mới</p>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2019/09/image-14.png" alt="" class="wp-image-2190"/><figcaption class="wp-element-caption">Sau khi tạo xong các bạn nhớ cập nhật thay đổi luôn nhé !</figcaption></figure>



<h5 class="wp-block-heading">2. Tạo ra user thuộc contact để nhận thông báo</h5>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2019/09/image-15.png" alt="" class="wp-image-2191"/><figcaption class="wp-element-caption">Sau khi ta nhấn tạo thêm rules thì các bạn hãy điền thông tin user của mình. Bên dưới là thông tin về user của tôi</figcaption></figure>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2019/09/image-16.png" alt="" class="wp-image-2192"/></figure>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2019/09/image-17.png" alt="" class="wp-image-2193"/><figcaption class="wp-element-caption">Một lần nữa chúng ta lại tiếp tục cập nhật thay đổi này để bắt đầu cài đặt cảnh báo !</figcaption></figure>



<h5 class="wp-block-heading">3. Sau khi cập nhật thay đổi ta bắt đầu tạo thông tin nhận thông báo của các host</h5>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2019/09/image-18.png" alt="" class="wp-image-2194"/><figcaption class="wp-element-caption">Sau khi bấm vào đây các bạn có thể tạo được cảnh báo theo cách mà mình muốn. Bên dưới là cách mà tôi muốn cảnh báo check_mk của tôi</figcaption></figure>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2019/09/image-19.png" alt="" class="wp-image-2196"/></figure>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2019/09/image-20.png" alt="" class="wp-image-2197"/><figcaption class="wp-element-caption">Chúng ta hãy chọn group để nhận cảnh báo</figcaption></figure>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2019/09/image-21.png" alt="" class="wp-image-2198"/><figcaption class="wp-element-caption">Có rất nhiều cách để mà cảnh báo này có thể match(cảnh báo theo ). Có thể là cảnh báo với 1 service nào đó nhưng ở đây tôi chọn match theo host. Có rất nhiều option để chúng ta lựa chọn !</figcaption></figure>



<h5 class="wp-block-heading">4. Thử tắt máy và nhận cảnh báo nào . Và hãy kiểm tra nội dung của nó</h5>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2019/09/image-22.png" alt="" class="wp-image-2200"/><figcaption class="wp-element-caption">Vậy là khi host bị tắt thì chúng ta đã nhận được một cảnh báo !</figcaption></figure>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2019/09/image-23.png" alt="" class="wp-image-2201"/><figcaption class="wp-element-caption">Đây là nội dung cảnh báo của nó. Nó sẽ cảnh báo theo nội dung mặc định được cài đặt</figcaption></figure>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2019/09/image-24.png" alt="" class="wp-image-2202"/><figcaption class="wp-element-caption">Thử bật máy lại và nhận thông báo từ OMD server. Và đây là nội dung khi host được quay trở lại hoạt động bình thường!</figcaption></figure>



<h5 class="wp-block-heading">5. Chỉnh sửa form mail cảnh báo</h5>



<p class="wp-block-paragraph">Nếu như bạn thấy thông tin của mail mặc định kia quá dài và bạn chỉ cần nhận thông tin như là địa chỉ IP và tên host. Bạn muốn thay đổi nó? Chúng ta có thể thay đổi như các bước dưới đây</p>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2019/09/image-25.png" alt="" class="wp-image-2203"/></figure>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2019/09/image-26.png" alt="" class="wp-image-2204"/></figure>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2019/09/image-27.png" alt="" class="wp-image-2205"/></figure>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2019/09/image-28.png" alt="" class="wp-image-2206"/><figcaption class="wp-element-caption">Đây là bước chọn form của mail được gửi đi để cảnh báo, Bạn cần thêm gì và bớt gì có thể làm việc đó tại nơi này</figcaption></figure>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2019/09/image-29.png" alt="" class="wp-image-2207"/><figcaption class="wp-element-caption">Các bạn hãy nhớ cập nhật thay đổi nhé! và hãy kiểm tra lại mail một lần nữa</figcaption></figure>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2019/09/image-30.png" alt="" class="wp-image-2208"/><figcaption class="wp-element-caption">Nội dung mail của chúng ta đã được thay đổi ngắn hơn mail ở bên trên rồi! Các bạn có thể thay đổi nó theo ý mình thích được rồi đó</figcaption></figure>



<p class="wp-block-paragraph">Cảnh báo qua mail là một cách. Nhưng check_mk không chỉ có thê cảnh báo được qua mail mà nó còn có thể cảnh báo được qua telegram nữa. Tiếp theo đây tôi sẽ là bài Hướng dẫn cảnh báo check_mk qua telegram</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p class="wp-block-paragraph">Nguồn: Tổng hợp</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Checkmk – Phần 7 &#8211; Giám Sát MySQL</title>
		<link>https://blntech.io.vn/checkmk-phan-7-giam-sat-mysql/</link>
		
		<dc:creator><![CDATA[nhanvph]]></dc:creator>
		<pubDate>Thu, 14 May 2026 08:00:14 +0000</pubDate>
				<category><![CDATA[Monitor]]></category>
		<category><![CDATA[check_mk]]></category>
		<category><![CDATA[Checkmk]]></category>
		<guid isPermaLink="false">https://blntech.io.vn/?p=2021</guid>

					<description><![CDATA[MySQL là một hệ quản trị cơ sở dữ liệu mã nguồn mở được rất nhiều đơn vị sử dụng. [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">MySQL là một hệ quản trị cơ sở dữ liệu mã nguồn mở được rất nhiều đơn vị sử dụng. Nó vô cùng quan trọng phục vụ việc đọc ghi dữ liệu cho các ứng dụng khác. Chính vì vậy giám sát MySQL là một việc làm vô cùng cần thiết. Trong bài viết này mình sẽ hướng dẫn bạn cách để giám sát MySQL trên hệ thống giám sát Checkmk.</p>



<h2 class="wp-block-heading">Cài đặt</h2>



<h4 class="wp-block-heading">1. Cài đặt checkmk agent</h4>



<p class="wp-block-paragraph">Trước tiên bạn cần cài đặt checkmk agent trên máy chủ đang chạy dịch vụ MySQL. Nếu chưa biết cách cài đặt bạn có thể tham khảo <a href="https://blntech.io.vn/checkmk-phan-2-cai-dat-agent/" data-type="link" data-id="https://blntech.io.vn/checkmk-phan-2-cai-dat-agent/" target="_blank" rel="noreferrer noopener"><strong>tại đây</strong></a>.</p>



<h4 class="wp-block-heading">2. Cấu hình MySQL</h4>



<p class="wp-block-paragraph">Bạn cần tạo một user mysql dùng cho việc giám sát</p>



<pre class="wp-block-code"><code>MariaDB &#91;(none)]&gt; GRANT SELECT, SHOW DATABASES ON *.* TO 'mysqlmonitor'@'localhost' IDENTIFIED BY 'mysqlmonitor';</code></pre>



<p class="wp-block-paragraph">Khai báo thông tin của user dùng để giám sát vào file&nbsp;<em>mysql.cfg</em></p>



<pre class="wp-block-code"><code>cat &lt;&lt;EOF > /etc/check_mk/mysql.cfg
&#91;client]
user=mysqlmonitor
password=mysqlmonitor
EOF</code></pre>



<p class="wp-block-paragraph">Thay đổi quyền cho file vừa tạo để chắc chắn rằng nếu không phải user&nbsp;<em>root</em>&nbsp;thì sẽ không được phép sửa file này</p>



<pre class="wp-block-code"><code>chmod 400 /etc/check_mk/mysql.cfg</code></pre>



<h4 class="wp-block-heading">3. Copy file plugin từ checkmk server sang máy chủ mysql</h4>



<p class="wp-block-paragraph">Truy cập vào checkmk server để copy file plugin giám sát mysql sang bên máy đang chạy mysql</p>



<pre class="wp-block-code"><code>scp /opt/omd/versions/1.6.0p10.cre/share/check_mk/agents/plugins/mk_mysql root@10.10.35.196:/usr/lib/check_mk_agent/plugins</code></pre>



<p class="wp-block-paragraph">Trong đó <code><strong>10.10.35.196</strong></code> là địa chỉ của máy chạy mysql</p>



<h4 class="wp-block-heading">4. Thực hiện thêm service trên WATO</h4>



<p class="wp-block-paragraph">Bây giờ truy cập vào Web UI để thực hiện discovery các dịch vụ</p>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2020/05/2020-05-08_22-20-1024x474.png" alt="" class="wp-image-6772"/></figure>



<p class="wp-block-paragraph">Thực hiện discovery để thêm các dịch vụ mới được thêm vào giám sát</p>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2020/05/image-5-1024x460.png" alt="" class="wp-image-6774"/></figure>



<p class="wp-block-paragraph">Ta thấy có 6 dịch vụ mới đã được thêm</p>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2020/05/image-7-1024x536.png" alt="" class="wp-image-6776"/></figure>



<p class="wp-block-paragraph">Cập nhật thay đổi</p>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2020/05/image-9-1024x361.png" alt="" class="wp-image-6778"/></figure>



<p class="wp-block-paragraph">Ta đã có thể giám sát MySQL trên checkmk</p>



<figure class="wp-block-image aligncenter"><img decoding="async" src="https://news.cloud365.vn/wp-content/uploads/2020/05/image-12-1024x580.png" alt="" class="wp-image-6781"/></figure>



<p class="wp-block-paragraph">Đến đây bạn đã có thể giám sát dịch vụ MySQL trên hệ thống giám sát Checkmk</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p class="wp-block-paragraph">Nguồn: Tổng hợp</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Checkmk – Phần 6 – Giám Sát Port TCP</title>
		<link>https://blntech.io.vn/checkmk-phan-6-giam-sat-port-tcp/</link>
		
		<dc:creator><![CDATA[nhanvph]]></dc:creator>
		<pubDate>Thu, 14 May 2026 07:43:38 +0000</pubDate>
				<category><![CDATA[Monitor]]></category>
		<category><![CDATA[Checkmk]]></category>
		<guid isPermaLink="false">https://blntech.io.vn/?p=2017</guid>

					<description><![CDATA[“Port” là một thuật ngữ chuyên ngành được sử dụng phổ thông trong network, system nói riêng và hệ thống [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">“<strong>Port</strong>” là một thuật ngữ chuyên ngành được sử dụng phổ thông trong network, system nói riêng và hệ thống nói chung. Đối với một dịch vụ được thiết kế chạy trên một port có số hiệu khác nhau. Phân loại port thành 2 loại phổ dựa trên giao thức mà port đó sử dụng là TCP port hay UDP port.</p>



<p class="wp-block-paragraph">Mỗi dịch vụ sẽ chạy trên một port khác nhau. Chính vì vậy muốn biết dịch vụ có chạy ổn định hay không, có đang hoạt động chính xác cho phép mở kết nối tới client hay không đơn giản là giám sát trạng thái của các port. Bài viết này sẽ hướng dẫn bạn các bước để thiết lập giám sát TCP port sử dụng checkmk.</p>



<h3 class="wp-block-heading">Cài Đặt</h3>



<p class="wp-block-paragraph">Trước tiên bạn cần cài agent trên máy muốn giám sát port. Bạn có thể tham khảo các cài đặt agent <a href="https://blntech.io.vn/checkmk-phan-2-cai-dat-agent/" data-type="link" data-id="https://blntech.io.vn/checkmk-phan-2-cai-dat-agent/" target="_blank" rel="noreferrer noopener"><strong>tại đây</strong></a>.</p>



<p class="wp-block-paragraph">Truy cập vào Web UI để thực hiện các bước tiếp theo trên WATO</p>



<ul class="wp-block-list">
<li>Chọn 1 để vào mục <code><strong>Host &amp; Service Parameters</strong></code></li>



<li>Chọn 2 để vào cấu hình <code><strong>Active checks</strong></code></li>
</ul>



<figure class="wp-block-image aligncenter size-full"><img fetchpriority="high" decoding="async" width="1024" height="496" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-513.png" alt="" class="wp-image-6028" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-513.png 1024w, https://blntech.io.vn/wp-content/uploads/2025/07/image-513-300x145.png 300w, https://blntech.io.vn/wp-content/uploads/2025/07/image-513-768x372.png 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph"></p>



<figure class="wp-block-image aligncenter size-full"><img decoding="async" width="1024" height="329" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-514.png" alt="" class="wp-image-6029" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-514.png 1024w, https://blntech.io.vn/wp-content/uploads/2025/07/image-514-300x96.png 300w, https://blntech.io.vn/wp-content/uploads/2025/07/image-514-768x247.png 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Tạo rule cho thư mục có chứa host và bạn muốn giám sát port.</p>



<figure class="wp-block-image aligncenter size-full"><img decoding="async" width="906" height="330" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-515.png" alt="" class="wp-image-6030" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-515.png 906w, https://blntech.io.vn/wp-content/uploads/2025/07/image-515-300x109.png 300w, https://blntech.io.vn/wp-content/uploads/2025/07/image-515-768x280.png 768w" sizes="(max-width: 906px) 100vw, 906px" /></figure>



<ul class="wp-block-list">
<li>Mục 1: Mô tả rule</li>



<li>Mục 2: Comment</li>



<li>Mục 3: Port muốn check (ở đây tôi check port của mysql 3306)</li>



<li>Mục 4: Một số tham số tùy chọn bổ sung</li>



<li>Mục 5: Điều kiện áp dụng rule. Bạn có thể xác định rule này được áp dùng cho thư mục nào, những host có tag xác định, những host xác định hoặc áp dụng cho thư mục nhưng bỏ qua một số host xác định. Ở đây tôi để rule này chỉ áp dụng cho <code>Host_01</code></li>



<li>Sau đó chọn <em>6</em> để lưu</li>
</ul>



<p class="wp-block-paragraph">Một số tham số tùy chọn bổ sung ở mục 4 như sau:</p>



<ul class="wp-block-list">
<li><em>Service description</em>: mô tả dịch vụ của port này</li>



<li><em>DNS hostname</em>: sử dụng domain thay vì IP theo mặc định</li>



<li><em>Expected response time</em>: xác đinh thời gian response để xác ddingj trạng thái OK hay Warning hoặc Critical</li>



<li><em>Seconds before connection times out</em>: Xác định thời gian trước khi kết nối times out.</li>



<li><em>State for connection refusal</em>: Trạng thái nếu kết nối bị từ chối</li>



<li><em>Strings to expect in response</em>: Chuỗi mong muốn trong kết quả trả về</li>



<li><em>Maximum number of bytes to receive</em>: Số byte lớn nhất có thể nhận</li>



<li><em>Use SSL for the connection</em>: Sử dụng SSL cho kết nối</li>
</ul>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1024" height="966" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-516.png" alt="" class="wp-image-6031" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-516.png 1024w, https://blntech.io.vn/wp-content/uploads/2025/07/image-516-300x283.png 300w, https://blntech.io.vn/wp-content/uploads/2025/07/image-516-768x725.png 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Cập nhật thay đổi</p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1024" height="315" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-517.png" alt="" class="wp-image-6032" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-517.png 1024w, https://blntech.io.vn/wp-content/uploads/2025/07/image-517-300x92.png 300w, https://blntech.io.vn/wp-content/uploads/2025/07/image-517-768x236.png 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph"></p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1024" height="321" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-518.png" alt="" class="wp-image-6033" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-518.png 1024w, https://blntech.io.vn/wp-content/uploads/2025/07/image-518-300x94.png 300w, https://blntech.io.vn/wp-content/uploads/2025/07/image-518-768x241.png 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Quay trở lại <code><strong>Host_01</strong></code> ta thấy port <code><strong>3306</strong></code> đã được thêm vào giám sát</p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1024" height="578" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-519.png" alt="" class="wp-image-6034" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-519.png 1024w, https://blntech.io.vn/wp-content/uploads/2025/07/image-519-300x169.png 300w, https://blntech.io.vn/wp-content/uploads/2025/07/image-519-768x434.png 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Tương tự vậy bạn có thể thêm các port khác vào giám sát.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p class="wp-block-paragraph">Nguồn: Tổng hợp</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Checkmk – Phần 5 – Hướng Dẫn Thêm Plugin</title>
		<link>https://blntech.io.vn/checkmk-phan-5-huong-dan-them-plugin/</link>
		
		<dc:creator><![CDATA[nhanvph]]></dc:creator>
		<pubDate>Thu, 14 May 2026 07:30:35 +0000</pubDate>
				<category><![CDATA[Monitor]]></category>
		<category><![CDATA[check_mk]]></category>
		<category><![CDATA[Checkmk]]></category>
		<guid isPermaLink="false">https://blntech.io.vn/?p=2062</guid>

					<description><![CDATA[Checkmk chỉ có thể giám sát những dịch vụ có sẵn thôi sao? Vậy SSH và APACHE thì sao? Nếu [&#8230;]]]></description>
										<content:encoded><![CDATA[
<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph"><em>Checkmk chỉ có thể giám sát những dịch vụ có sẵn thôi sao? Vậy SSH và APACHE thì sao? Nếu như tôi muốn sử dụng một plugin khác tôi phải làm gì? sẽ có rất nhiều bạn hỏi như vậy. Ở đây tôi sẽ hướng dẫn các bạn add thêm plugin vào checkmk nhé</em></p>
</blockquote>



<h4 class="wp-block-heading"><strong>Chuẩn</strong> <strong>bị</strong></h4>



<h5 class="wp-block-heading">1. Có thể tự viết hoặc download từ trên mạng về</h5>



<pre class="wp-block-code"><code>cd ~/local/lib/nagios/plugins

wget https://github.com/NhanVPH2802/Docs-Nagios/blob/master/scripts/Plugin-nagios/check%20http/check_http</code></pre>



<h5 class="wp-block-heading">2. Phần quyền cho file vừa download</h5>



<pre class="wp-block-code"><code>chmod 755 check_http</code></pre>



<h5 class="wp-block-heading">3. Chạy thử plugins</h5>



<pre class="wp-block-code"><code>OMD&#91;monitoring]:~/local/lib/nagios/plugins$ ./check_http 192.168.80.225
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0   136    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
Success: HTTP/1.1 200 OK</code></pre>



<p class="wp-block-paragraph"><strong>Các bước thực hiện trên WATO</strong></p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1024" height="506" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-508.png" alt="" class="wp-image-6019" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-508.png 1024w, https://blntech.io.vn/wp-content/uploads/2025/07/image-508-300x148.png 300w, https://blntech.io.vn/wp-content/uploads/2025/07/image-508-768x380.png 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph"></p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1024" height="502" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-509.png" alt="" class="wp-image-6020" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-509.png 1024w, https://blntech.io.vn/wp-content/uploads/2025/07/image-509-300x147.png 300w, https://blntech.io.vn/wp-content/uploads/2025/07/image-509-768x377.png 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph"></p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1024" height="501" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-510.png" alt="" class="wp-image-6021" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-510.png 1024w, https://blntech.io.vn/wp-content/uploads/2025/07/image-510-300x147.png 300w, https://blntech.io.vn/wp-content/uploads/2025/07/image-510-768x376.png 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="has-text-align-center wp-block-paragraph"><em>Chúng ta vào đây để tạo thêm rule để có thể add thêm plugin</em></p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1024" height="526" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-511.png" alt="" class="wp-image-6022" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-511.png 1024w, https://blntech.io.vn/wp-content/uploads/2025/07/image-511-300x154.png 300w, https://blntech.io.vn/wp-content/uploads/2025/07/image-511-768x395.png 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="has-text-align-center wp-block-paragraph"><em>Hãy chọn tên để hiển thị và câu lệnh để plugin đó thực hiện</em><br><em>Sau đó lưu và cập nhật thay đổi !</em></p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1024" height="523" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-512.png" alt="" class="wp-image-6023" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-512.png 1024w, https://blntech.io.vn/wp-content/uploads/2025/07/image-512-300x153.png 300w, https://blntech.io.vn/wp-content/uploads/2025/07/image-512-768x392.png 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="has-text-align-center wp-block-paragraph"><em>Sau đó discovery đã phát hiện ra được service và tự động add thêm vào cho chúng ta mà không phải làm gì cả. Chúc các bạn thành công nhé!</em></p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p class="wp-block-paragraph">Nguồn: tổng hợp</p>



<p class="wp-block-paragraph"></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Checkmk – Phần 4 – Hướng Dẫn Sử Dụng Dịch Vụ Discovery</title>
		<link>https://blntech.io.vn/checkmk-phan-4-huong-dan-su-dung-dich-vu-discovery/</link>
		
		<dc:creator><![CDATA[nhanvph]]></dc:creator>
		<pubDate>Thu, 14 May 2026 07:05:27 +0000</pubDate>
				<category><![CDATA[Monitor]]></category>
		<category><![CDATA[check_mk]]></category>
		<category><![CDATA[Checkmk]]></category>
		<guid isPermaLink="false">https://blntech.io.vn/?p=2064</guid>

					<description><![CDATA[Dịch vụ discovery trong checkmk Ví dụ để hiểu về discovery Kịch bản :&#160;Dịch vụ discovery sẽ phát hiện ra [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Dịch vụ discovery trong checkmk</h2>



<ul class="wp-block-list">
<li>Đây là một loại dịch vụ được giám sát bởi check_mk mỗi khi giám sát một máy</li>



<li>Service này có khả năng tự động phát hiện ra</li>



<li>Nó sẽ cảnh báo nếu có dịch vụ nào mà nó mặc định phát hiện không được giám sát</li>



<li>Có thể tự động thêm bớt được dịch vụ mới được phát hiện thêm để giám sát hoặc mới phát hiện là nó mất đi sẽ remove nó đi</li>
</ul>



<h2 class="wp-block-heading">Ví dụ để hiểu về discovery</h2>



<p class="wp-block-paragraph"><strong>Kịch bản :&nbsp;</strong>Dịch vụ discovery sẽ phát hiện ra các port mạng nào đang được chạy. Thì ở đây tôi sẽ add thêm một port mạng để cho discovery phát hiện và tự động giám sát nó</p>



<h5 class="wp-block-heading">1.Với discovery thì chúng ta sẽ phải cài đặt để nó tự động phát hiện và thêm dịch vụ</h5>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1024" height="503" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-502.png" alt="" class="wp-image-6010" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-502.png 1024w, https://blntech.io.vn/wp-content/uploads/2025/07/image-502-300x147.png 300w, https://blntech.io.vn/wp-content/uploads/2025/07/image-502-768x377.png 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph"></p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1024" height="521" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-503.png" alt="" class="wp-image-6011" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-503.png 1024w, https://blntech.io.vn/wp-content/uploads/2025/07/image-503-300x153.png 300w, https://blntech.io.vn/wp-content/uploads/2025/07/image-503-768x391.png 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="has-text-align-center wp-block-paragraph"><em>Chọn vào mục này để thiết lập cài đặt cho discovery của host này</em></p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1024" height="522" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-504.png" alt="" class="wp-image-6012" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-504.png 1024w, https://blntech.io.vn/wp-content/uploads/2025/07/image-504-300x153.png 300w, https://blntech.io.vn/wp-content/uploads/2025/07/image-504-768x392.png 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="has-text-align-center wp-block-paragraph">Ta có thể chọn tạo rule cho một folder hay là một host riêng biệt</p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1024" height="525" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-505.png" alt="" class="wp-image-6013" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-505.png 1024w, https://blntech.io.vn/wp-content/uploads/2025/07/image-505-300x154.png 300w, https://blntech.io.vn/wp-content/uploads/2025/07/image-505-768x394.png 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="has-text-align-center wp-block-paragraph"><em>Chúng ta thiết lập cho các option để discovery tự động cập nhật service. Nhớ chọn option automatically update nhé vì thế mới tự động cập nhật!</em><br><em>Trong đó có giá trị sau bao lâu thì discovery sẽ tự động thêm dịch vụ vào hãy cài thấp xuống để thấy kết quả ngay nhé! Tôi cài đặt nó 2 phút</em></p>



<p class="wp-block-paragraph">Sau bước đó ta sẽ lưu lại và cập nhật thay đổi để có thể có thể áp dụng nó cho server của mình nhớ</p>



<h5 class="wp-block-heading">2. Add thêm card mạng vào host của mình để kiểm tra</h5>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1024" height="523" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-506.png" alt="" class="wp-image-6014" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-506.png 1024w, https://blntech.io.vn/wp-content/uploads/2025/07/image-506-300x153.png 300w, https://blntech.io.vn/wp-content/uploads/2025/07/image-506-768x392.png 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="has-text-align-center wp-block-paragraph"><em>Sau khi add thêm card mạng cho một host mà tôi đã giám sát. Chúng ta đã thấy rằng service discovery nó đã phát hiện thêm một dịch vụ nữa nhưng mà nó chưa lập tức giám sát. Vì sẽ có khoảng thời gian được cài đặt để nó cập nhật vào danh sách như ở trên!</em></p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1024" height="527" src="https://blntech.io.vn/wp-content/uploads/2025/07/image-507.png" alt="" class="wp-image-6015" srcset="https://blntech.io.vn/wp-content/uploads/2025/07/image-507.png 1024w, https://blntech.io.vn/wp-content/uploads/2025/07/image-507-300x154.png 300w, https://blntech.io.vn/wp-content/uploads/2025/07/image-507-768x395.png 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="has-text-align-center wp-block-paragraph"><em>Sau 2 phút chờ đợi thì chúng ta đã có thể thấy được nó đã tự động thêm port mạng!</em><br><em>Chúc các bạn thành công nha!!!</em></p>



<p class="wp-block-paragraph">Ta có thể add được thêm plugin vào cho checkmk! và dịch vụ discovery này có thể cho chúng ta phát hiện được thêm dịch vụ đã được thêm plugins để giám sát. </p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p class="wp-block-paragraph">Nguồn: Tổng hợp</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Checkmk &#8211; Phần 3 &#8211; Hướng Dẫn Add Host Giám Sát</title>
		<link>https://blntech.io.vn/checkmk-phan-3-huong-dan-add-host-giam-sat/</link>
		
		<dc:creator><![CDATA[nhanvph]]></dc:creator>
		<pubDate>Wed, 13 May 2026 10:00:27 +0000</pubDate>
				<category><![CDATA[Monitor]]></category>
		<category><![CDATA[check_mk]]></category>
		<category><![CDATA[Checkmk]]></category>
		<guid isPermaLink="false">https://blntech.io.vn/?p=2070</guid>

					<description><![CDATA[Sau khi đăng nhập vào web của check_mk thì bạn hãy làm theo các hướng dẫn bên dưới này nha! [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Sau khi đăng nhập vào web của check_mk thì bạn hãy làm theo các hướng dẫn bên dưới này nha!</p>



<p class="wp-block-paragraph">Bước 1: Bấm vào host ở mục WATO và chọn newhost</p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="878" height="492" src="https://blntech.io.vn/wp-content/uploads/2026/05/image-48.png" alt="" class="wp-image-6000" srcset="https://blntech.io.vn/wp-content/uploads/2026/05/image-48.png 878w, https://blntech.io.vn/wp-content/uploads/2026/05/image-48-300x168.png 300w, https://blntech.io.vn/wp-content/uploads/2026/05/image-48-768x430.png 768w" sizes="auto, (max-width: 878px) 100vw, 878px" /></figure>



<p class="wp-block-paragraph">Bước 2: Tiếp theo hãy điền thông tin của host mà bạn muốn giám sát bao gồm tên và địa chỉ IP của chúng. Sau đó lưu và đi đến service</p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="878" height="399" src="https://blntech.io.vn/wp-content/uploads/2026/05/image-49.png" alt="" class="wp-image-6001" srcset="https://blntech.io.vn/wp-content/uploads/2026/05/image-49.png 878w, https://blntech.io.vn/wp-content/uploads/2026/05/image-49-300x136.png 300w, https://blntech.io.vn/wp-content/uploads/2026/05/image-49-768x349.png 768w" sizes="auto, (max-width: 878px) 100vw, 878px" /></figure>



<p class="wp-block-paragraph"></p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="875" height="426" src="https://blntech.io.vn/wp-content/uploads/2026/05/image-50.png" alt="" class="wp-image-6002" srcset="https://blntech.io.vn/wp-content/uploads/2026/05/image-50.png 875w, https://blntech.io.vn/wp-content/uploads/2026/05/image-50-300x146.png 300w, https://blntech.io.vn/wp-content/uploads/2026/05/image-50-768x374.png 768w" sizes="auto, (max-width: 875px) 100vw, 875px" /></figure>



<p class="wp-block-paragraph">Bước 3: Chúng ta sẽ đi vào việc quyết định giám sát những service nào. Nếu muốn giám sát tất cả những service mà check_mk phát hiện được hãy chọn&nbsp;<strong>monitor</strong>&nbsp;không thì hãy chọn&nbsp;<strong>disable</strong>. Còn nếu bạn muốn loại bỏ hay giám sát 1 service riêng lẻ nào đó hãy chọn dấu x hoặc tích nhé</p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="873" height="418" src="https://blntech.io.vn/wp-content/uploads/2026/05/image-51.png" alt="" class="wp-image-6003" srcset="https://blntech.io.vn/wp-content/uploads/2026/05/image-51.png 873w, https://blntech.io.vn/wp-content/uploads/2026/05/image-51-300x144.png 300w, https://blntech.io.vn/wp-content/uploads/2026/05/image-51-768x368.png 768w" sizes="auto, (max-width: 873px) 100vw, 873px" /></figure>



<p class="wp-block-paragraph">Bước 4: Sau khi bước 3 kết thúc chúng ta sẽ thấy những thay đổi ở mục changes. Hãy bấm vào đó để bắt đầu cập nhật thông tin nhé</p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="879" height="426" src="https://blntech.io.vn/wp-content/uploads/2026/05/image-52.png" alt="" class="wp-image-6004" srcset="https://blntech.io.vn/wp-content/uploads/2026/05/image-52.png 879w, https://blntech.io.vn/wp-content/uploads/2026/05/image-52-300x145.png 300w, https://blntech.io.vn/wp-content/uploads/2026/05/image-52-768x372.png 768w" sizes="auto, (max-width: 879px) 100vw, 879px" /></figure>



<p class="wp-block-paragraph">Ở đây chúng ta hãy comment lại để đánh dấu sự thay đổi và được ghi vào log. Rồi chúng ta chọn site của thay đổi và chọn cập nhật thay đổi nhé.</p>



<p class="wp-block-paragraph"><em>Sau khi thêm host xong thì check_mk server đã có thể giám sát </em>host <em>mà bạn đã thêm. Đây mới chỉ là những host mà do check_mk tự phát hiện ra. </em></p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p class="wp-block-paragraph">Nguồn: tổng hợp</p>



<p class="wp-block-paragraph"></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Checkmk &#8211; Phần 2 &#8211; Cài Đặt Agent</title>
		<link>https://blntech.io.vn/checkmk-phan-2-cai-dat-agent/</link>
		
		<dc:creator><![CDATA[nhanvph]]></dc:creator>
		<pubDate>Wed, 13 May 2026 10:00:24 +0000</pubDate>
				<category><![CDATA[Monitor]]></category>
		<category><![CDATA[check_mk]]></category>
		<category><![CDATA[Checkmk]]></category>
		<guid isPermaLink="false">https://blntech.io.vn/?p=2073</guid>

					<description><![CDATA[Hướng dẫn này sẽ giúp bạn có thể tìm được agent phù hợp với máy tính của mình để có [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Hướng dẫn này sẽ giúp bạn có thể tìm được agent phù hợp với máy tính của mình để có thể giúp check_mk server bắt đầu giám sát hệ thống</p>



<h2 class="wp-block-heading">Mô hình</h2>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="808" height="335" src="https://blntech.io.vn/wp-content/uploads/2026/05/image-44.png" alt="" class="wp-image-5993" srcset="https://blntech.io.vn/wp-content/uploads/2026/05/image-44.png 808w, https://blntech.io.vn/wp-content/uploads/2026/05/image-44-300x124.png 300w, https://blntech.io.vn/wp-content/uploads/2026/05/image-44-768x318.png 768w" sizes="auto, (max-width: 808px) 100vw, 808px" /></figure>



<p class="wp-block-paragraph">Thông số VM</p>



<figure class="wp-block-table aligncenter"><table><thead><tr><th class="has-text-align-center" data-align="center">Host name</th><th class="has-text-align-center" data-align="center">IP</th><th class="has-text-align-center" data-align="center">RAM</th><th class="has-text-align-center" data-align="center">CPU</th><th class="has-text-align-center" data-align="center">DISK</th></tr></thead><tbody><tr><td class="has-text-align-center" data-align="center">check_mk</td><td class="has-text-align-center" data-align="center">192.168.80.222</td><td class="has-text-align-center" data-align="center">1G</td><td class="has-text-align-center" data-align="center">1</td><td class="has-text-align-center" data-align="center">20G</td></tr><tr><td class="has-text-align-center" data-align="center">client</td><td class="has-text-align-center" data-align="center">192.168.80.225</td><td class="has-text-align-center" data-align="center">1G</td><td class="has-text-align-center" data-align="center">1</td><td class="has-text-align-center" data-align="center">20G</td></tr></tbody></table></figure>



<h2 class="wp-block-heading">Các bước thực hiện với client centos 7</h2>



<h5 class="wp-block-heading">1. Tìm agent phù hợp</h5>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="873" height="411" src="https://blntech.io.vn/wp-content/uploads/2026/05/image-45.png" alt="" class="wp-image-5994" srcset="https://blntech.io.vn/wp-content/uploads/2026/05/image-45.png 873w, https://blntech.io.vn/wp-content/uploads/2026/05/image-45-300x141.png 300w, https://blntech.io.vn/wp-content/uploads/2026/05/image-45-768x362.png 768w" sizes="auto, (max-width: 873px) 100vw, 873px" /></figure>



<p class="wp-block-paragraph">Trên các website của check_mk server khi bạn cài đặt và đăng nhập vào nó sẽ hỗ trợ và hiển thị cho bạn các agent 3 loại agent. Việc của bạn là chọn agent phù hợp với hệ điều hành của mình. Ở đây mình cài đặt agent trên centos 7 nên tôi sẽ chọn agent có đuôi là<strong> .rpm</strong> để tiến hành cài đặt</p>



<p class="wp-block-paragraph"><em>NOTE: Các bước dưới đây tất cả đều được thực hiện trên client mà bạn muốn được giám sát. Và các command line được chạy dưới quyền user sudo hoặc user roo</em>t</p>



<h5 class="wp-block-heading">2. Cài đặt gói wget</h5>



<pre class="wp-block-code"><code>yum install wget -y </code></pre>



<h5 class="wp-block-heading">3. Dùng gói wget download agent đã chọn ở bước trên</h5>



<pre class="wp-block-code"><code>wget http://&lt;IP Server>/monitoring/check_mk/agents/check-mk-agent-1.5.0p12-1.noarch.rpm</code></pre>



<h5 class="wp-block-heading">4. Cấp quyền thực thi cho file vừa download về</h5>



<pre class="wp-block-code"><code>chmod +x check-mk-agent-1.5.0p12-1.noarch.rpm</code></pre>



<h5 class="wp-block-heading">5. Cài đặt agent</h5>



<pre class="wp-block-code"><code>rpm -ivh check-mk-agent-1.5.0p12-1.noarch.rpm</code></pre>



<h5 class="wp-block-heading">6. Cài đặt xinetd</h5>



<pre class="wp-block-code"><code>yum install xinetd -y</code></pre>



<h5 class="wp-block-heading">7. Khởi động xinetd</h5>



<pre class="wp-block-code"><code>systemctl start xinetd
systemctl enable xinetd</code></pre>



<h5 class="wp-block-heading">8. Cài đặt gói net-tools để kiểm tra dễ dàng hơn</h5>



<pre class="wp-block-code"><code>yum install net-tools -y</code></pre>



<h5 class="wp-block-heading">9. Mở port trên client để có thể giao tiếp với check_mk server</h5>



<pre class="wp-block-code"><code>vi /etc/xinetd.d/check_mk</code></pre>



<p class="wp-block-paragraph">Sửa các thông số sau</p>



<pre class="wp-block-code"><code>only_from      = 192.168.80.222
disable        = 0
port           = 6556</code></pre>



<h5 class="wp-block-heading">10. Kiểm tra port mặc định của check_mk sử dụng để giám sát được chưa</h5>



<pre class="wp-block-code"><code>&#91;root@client ~]# netstat -npl | grep 6556
tcp6       0      0 :::6556                 :::*               LISTEN       1/systemd</code></pre>



<h5 class="wp-block-heading">11. Mở port trên firewall</h5>



<pre class="wp-block-code"><code> firewall-cmd --add-port=6556/tcp --permanent
 firewall-cmd --reload</code></pre>



<h5 class="wp-block-heading">12. Tắt selinux</h5>



<pre class="wp-block-code"><code>setenforce 0</code></pre>



<h2 class="wp-block-heading">Các bước thực hiện với client ubuntu server 14.04</h2>



<p class="wp-block-paragraph"><em>NOTE: Các bước dưới đây tất cả đều được thực hiện trên client mà bạn muốn được giám sát. Và các command line được chạy dưới quyền user sudo hoặc user roo</em>t</p>



<h5 class="wp-block-heading">1. Bước đầu tiên này ta sẽ đi tìm agent phù hợp giống như với centos 7 và tôi sẽ chọn agent có đuôi <strong>.deb</strong> đối với máy có hệ đều hành ubuntu</h5>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="676" height="340" src="https://blntech.io.vn/wp-content/uploads/2026/05/image-46.png" alt="" class="wp-image-5995" srcset="https://blntech.io.vn/wp-content/uploads/2026/05/image-46.png 676w, https://blntech.io.vn/wp-content/uploads/2026/05/image-46-300x151.png 300w" sizes="auto, (max-width: 676px) 100vw, 676px" /></figure>



<h5 class="wp-block-heading">2. Sử dụng wget để download agent</h5>



<pre class="wp-block-code"><code>wget http://&lt;IP Server>/monitoring/check_mk/agents/check-mk-agent_1.5.0p12-1_all.deb</code></pre>



<h5 class="wp-block-heading">3. Cấp quyền thực thi cho file vừa download</h5>



<pre class="wp-block-code"><code> chmod +x check-mk-agent_1.5.0p12-1_all.deb</code></pre>



<h5 class="wp-block-heading">4. Cài đặt agent bằng command line</h5>



<pre class="wp-block-code"><code> sudo dpkg -i check-mk-agent_1.5.0p12-1_all.deb</code></pre>



<h5 class="wp-block-heading">5. Cài đặt xinetd</h5>



<pre class="wp-block-code"><code>sudo apt-get install xinetd</code></pre>



<h5 class="wp-block-heading">6. Chỉnh sửa file</h5>



<pre class="wp-block-code"><code>sudo vi /etc/xinetd.d/check_mk</code></pre>



<p class="wp-block-paragraph">Sửa các thông số như sau</p>



<pre class="wp-block-code"><code>only_from      = 192.168.80.222
disable        = 0
port           = 6556</code></pre>



<h5 class="wp-block-heading">7. Khởi động lại dịch vụ xinetd</h5>



<pre class="wp-block-code"><code>/etc/init.d/xinetd restart</code></pre>



<h5 class="wp-block-heading">8. Kiểm tra port đã hoạt động hay chưa</h5>



<pre class="wp-block-code"><code>anhduc@ubuntu:~$ netstat -npl | grep 6556
tcp        0      0 0.0.0.0:6556            0.0.0.0:*               LISTEN      </code></pre>



<h5 class="wp-block-heading">9. Mở port trên firewall</h5>



<pre class="wp-block-code"><code>ufw allow 6556/tcp
ufw reload</code></pre>



<p class="wp-block-paragraph">Vậy là xong</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p class="wp-block-paragraph">Nguồn: tổng hợp</p>



<p class="wp-block-paragraph"></p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
