วิธีติดตั้ง Azure Monitor Agent

Azure Monitor Agent หรือ AMA เป็น Agent รุ่นใหม่ของ Microsoft ที่ใช้รวบรวมข้อมูลจาก Windows Server 2025 และส่งข้อมูลไปยัง Azure Monitor และ Log Analytics Workspace โดย AMA ถูกออกแบบมาให้มาแทน Agent รุ่นเก่า และรองรับการทำงานร่วมกับ Azure Arc ได้อย่างเต็มรูปแบบ

สำหรับองค์กรที่ต้องการตรวจสอบ Performance, Event Log, Security Event และสร้าง Alert จาก Azure Monitor การติดตั้ง Azure Monitor Agent ถือเป็นขั้นตอนสำคัญที่ต้องทำก่อนใช้งานระบบ Monitoring อย่างสมบูรณ์

① Azure Monitor Agent คืออะไร

Azure Monitor Agent (AMA)

คือ Agent ที่ทำหน้าที่

  • เก็บข้อมูล Performance
  • เก็บ Event Log
  • เก็บ Security Log
  • เก็บ Metrics
  • ส่งข้อมูลไป Azure Monitor

AMA เป็น Agent มาตรฐานที่ Microsoft แนะนำสำหรับ Windows Server 2025

② Azure Monitor Agent ใช้ทำอะไร

หลังติดตั้งแล้ว

สามารถใช้งาน

  • Azure Monitor
  • Log Analytics
  • Microsoft Sentinel
  • Azure Policy
  • Microsoft Defender for Cloud

ได้อย่างมีประสิทธิภาพ

ถือเป็นองค์ประกอบสำคัญของระบบ Hybrid Cloud

③ สิ่งที่ต้องเตรียม

ก่อนติดตั้ง

ต้องมี

  • Azure Subscription
  • Windows Server 2025
  • Azure Arc
  • Log Analytics Workspace
  • Internet Connection

Server ต้องเชื่อม Azure Arc เรียบร้อยแล้ว

④ ตรวจสอบ Azure Arc

บน Windows Server

ตรวจสอบ

azcmagent show

ผลลัพธ์ควรเป็น

Connected

หากยังไม่ Connected

ต้องแก้ไข Azure Arc ก่อน

⑤ สร้าง Log Analytics Workspace

Azure Monitor Agent ต้องส่งข้อมูลไปยัง Workspace

สร้างได้จาก

Azure Portal
→ Log Analytics Workspace
→ Create

กำหนด

  • Subscription
  • Resource Group
  • Region
  • Workspace Name

ให้เรียบร้อย

⑥ เปิด Azure Arc Server

เข้าสู่ Azure Portal

เลือก

Azure Arc
→ Servers

เลือก Windows Server 2025 ที่ต้องการ

จากนั้นเปิดหน้ารายละเอียดของเครื่อง

⑦ ไปที่ Extensions

ภายในหน้าของ Server

เลือก

Settings
→ Extensions

Azure Arc รองรับการติดตั้ง Agent หลายประเภท

รวมถึง Azure Monitor Agent

⑧ ติดตั้ง Azure Monitor Agent

กด

Add Extension

ค้นหา

Azure Monitor Agent

เลือก

Install

จากนั้นเลือก

Next

จนเสร็จสิ้น

⑨ ตรวจสอบสถานะการติดตั้ง

หลังติดตั้ง

Azure Portal จะแสดง

Succeeded

หากพบ

Failed

ควรตรวจสอบ

  • Network
  • Azure Arc
  • Permission

ทันที

⑩ ตรวจสอบผ่าน PowerShell

ตรวจสอบ Service

Get-Service

หรือดู Process

Get-Process

เพื่อยืนยันว่า Agent ทำงานอยู่

⑪ สร้าง Data Collection Rule

Azure Monitor Agent ใช้

Data Collection Rule
(DCR)

ในการกำหนดว่าต้องเก็บข้อมูลอะไร

เช่น

  • CPU
  • Memory
  • Event Log
  • Security Log

ผู้ดูแลระบบสามารถปรับแต่งได้ตามต้องการ

⑫ สร้าง Data Collection Rule

ใน Azure Portal

เลือก

Azure Monitor
→ Data Collection Rules

จากนั้น

Create

กำหนด

  • ชื่อ DCR
  • Region
  • Target Resource

ให้ตรงกับ Server ที่ต้องการ

⑬ กำหนด Metrics ที่ต้องการเก็บ

ตัวอย่างข้อมูลยอดนิยม

CPU

Processor(_Total)\% Processor Time

Memory

Memory\Available MBytes

Disk

LogicalDisk(_Total)\% Free Space

Network

Network Interface

ข้อมูลเหล่านี้ช่วยวิเคราะห์ประสิทธิภาพของ Server

⑭ เก็บ Windows Event Log

AMA สามารถเก็บ

  • System Log
  • Application Log
  • Security Log

ส่งไปยัง Azure

ทำให้สามารถค้นหาเหตุการณ์ย้อนหลังได้ง่าย

⑮ ตรวจสอบข้อมูลใน Log Analytics

หลังติดตั้งเสร็จ

ไปที่

Log Analytics Workspace
→ Logs

ทดลอง Query

Heartbeat

หากมีข้อมูลแสดง

หมายความว่า AMA ส่งข้อมูลสำเร็จ

⑯ ตรวจสอบ Heartbeat

Query

Heartbeat
| sort by TimeGenerated desc

จะแสดง

  • ชื่อเครื่อง
  • เวลาเชื่อมต่อ
  • Agent Version

ใช้ตรวจสอบสถานะ Agent ได้

⑰ สร้าง Dashboard

Azure Monitor สามารถสร้าง Dashboard

แสดง

  • CPU
  • RAM
  • Disk
  • Network

ของ Server หลายเครื่องได้พร้อมกัน

เหมาะสำหรับ NOC และทีม IT Operations

⑱ สร้าง Alert

ตัวอย่าง Alert

CPU > 90%

Disk Free < 10%

Server Offline

Service Stop

เมื่อเกิดเหตุการณ์

Azure สามารถแจ้งเตือนได้ทันที

⑲ ปัญหาที่พบบ่อย

Extension Failed

ตรวจสอบ

  • Azure Arc
  • Internet
  • DNS

ไม่มีข้อมูลใน Workspace

ตรวจสอบ

  • Data Collection Rule
  • Workspace Association

Heartbeat ไม่มา

ตรวจสอบ

azcmagent show

Log ไม่แสดง

ตรวจสอบ Event Collection Configuration

⑳ Best Practices

แนวทางที่แนะนำ

  • ใช้ AMA แทน Agent รุ่นเก่า
  • สร้าง DCR แยก Production และ Test
  • เก็บ Security Log ทุกเครื่อง
  • เปิด Alert สำคัญ
  • ตรวจสอบ Heartbeat ทุกวัน
  • ใช้ Dashboard กลางสำหรับทีม IT

comsiam แนะนำให้ติดตั้ง Azure Monitor Agent บน Windows Server 2025 ทุกเครื่องที่เชื่อม Azure Arc เพราะจะช่วยให้สามารถมองเห็นสถานะของระบบทั้งหมดได้จากศูนย์กลาง และช่วยลดเวลาการแก้ปัญหาได้อย่างมาก

㉑ สรุป

Azure Monitor Agent เป็น Agent หลักสำหรับการเก็บข้อมูล Monitoring บน Windows Server 2025 โดยทำงานร่วมกับ Azure Arc และ Log Analytics Workspace เพื่อรวบรวม Performance Metrics, Event Log และ Security Data ส่งไปยัง Azure Monitor ช่วยให้องค์กรสามารถสร้าง Dashboard, Alert และวิเคราะห์ระบบได้อย่างมีประสิทธิภาพในสภาพแวดล้อม Hybrid Cloud

㉒ คำถามชวนคิด

หากคุณสามารถเห็นข้อมูล CPU, RAM, Disk, Event Log และ Security Event ของ Server ทุกเครื่องจาก Dashboard เดียว จะช่วยให้ทีม IT ขององค์กรตอบสนองต่อปัญหาได้เร็วขึ้นมากเพียงใด?