🔍 Assets Discovery — คู่มือการ Setup CMDB
Cloud Data Center บทความนี้ใช้ได้ทั้ง Cloud และ Data Center
Assets Discovery ถูกตั้งค่าให้ สแกน network เป็นรอบ (periodically) เก็บข้อมูลที่สแกนได้ในรูปแบบ XML file จากนั้น transfer ไฟล์ไปที่ Import Folder ซึ่ง Assets จะใช้ import ข้อมูล หรือ upload ขึ้น Assets Cloud โดยตรง
จุดเด่นของ Assets Discovery
- 🔧 เป็น network discovery solution ที่ ผูกกับ Jira platform อย่างแน่น
- 🗃️ เป็น solution เดียวที่มี CMDB จริง (Configuration Management Database) บน Jira platform
- 🔗 ทำ Dependency Mapping และ Impact Analysis ได้บน Jira
- 🤖 มี Automation Framework สำหรับ asset management
- 💰 ราคาคุ้มค่า — เปรียบเทียบกับ solution อื่นในตลาดได้เลย
สถาปัตยกรรม — 3 เครื่องมือในแพ็กเกจเดียว
Assets Discovery ดาวน์โหลดจาก Atlassian Marketplace รันได้บน Windows และ Linux มี 3 เครื่องมือ:
1. Assets Discovery (ตัวหลัก — Agent-less)
Scanner แบบ ไม่ต้องติดตั้ง agent บนเครื่อง target ใช้ค้นหา devices และ configuration items ใน local network ของคุณ
2. Assets Discovery Agents (Agent-ful)
ตัว agent อิสระที่ติดตั้งบนเครื่อง target ใช้สำหรับ:
- เครื่องที่ ไม่ได้เปิดตลอด (offline ตอน scan)
- Windows ที่ไม่อยากเปิด inbound WMI Port และ Dynamic DCOM Ports
3. Assets Discovery Collector
เครื่องมือที่ช่วยให้:
- รัน หลาย instance ของ Discovery พร้อมกัน แล้วรวมผลเป็น data set เดียว
- สแกน network ระยะไกล แล้ว transfer ข้อมูลกลับมา
กระบวนการทำงาน (How Discovery Works)
เมื่อ scan เริ่มต้น Discovery จะทำตามขั้นตอนเหล่านี้:
- โหลด Scan Settings — อ่าน scan settings ที่ต้อง execute และ allocate memory ให้แต่ละ IP address
- ICMP Ping — ส่ง ICMP ping ไปทุก IP address เพื่อดูว่า host ตอบหรือ timeout
- Scan Reachable IPs — สแกน IP ที่ reachable รวมถึง forced IPs (ใช้
~modifier) - Login ด้วย Credentials — พยายาม login ด้วย saved credentials (AES-256 encrypted)
- Execute Pattern Files — pattern files ถูก execute บน host/device ที่ login ได้
- Map Data — ข้อมูลถูก map ไป Memory Object แล้วแปลงเป็น XML
- Export — XML ถูก zip และ transport ตาม Export configuration
📋 System Requirements
Supported Platforms
| OS | Distribution | Requirements |
|---|---|---|
| Windows | Windows 10, 11, Server 2016, 2019 (ต้องติดตั้ง FOD), 2022 | Microsoft .NET Framework 4.7.2 ขึ้นไป |
| Linux | Ubuntu Desktop 18.04, 20.04, 22.04; Debian 11-12 (GNOME & KDE); CentOS Stream 9 (GNOME) | GUI Enabled OS, .NET Core Runtime, Mono 5.2.0+, system utilities |
Minimum Hardware
| Resource | Minimum |
|---|---|
| RAM | 4 GB available |
| CPU | 2+ GHz |
| Disk | 500 MB |
📦 Download & Install
• ต้องมี Jira Admin permissions
• ต้องมี administrator permissions บน Windows/Linux
• ตรวจสอบ System Requirements
ขั้นตอนการติดตั้ง
- 1 ดาวน์โหลด Assets Discovery เวอร์ชันล่าสุดจาก Atlassian Marketplace
- 2 สร้าง directory สำหรับเก็บเครื่องมือ — ต้องมีทั้ง read และ write permissions
- 3 แตกไฟล์ ทั้งหมดจาก Assets Discovery package ไปที่ directory ที่สร้างไว้
# ตัวอย่างบน Windows (run as Admin)
cd "C:\Program Files"
mkdir AssetsDiscovery
# แตกไฟล์ zip ไปที่ C:\Program Files\AssetsDiscovery
# ตัวอย่างบน Linux
sudo mkdir -p /opt/assets-discovery
sudo unzip AssetsDiscovery.zip -d /opt/assets-discovery
🔥 Ports & Firewall
นี่คือส่วนที่สำคัญที่สุด — ถ้า firewall ไม่เปิด Discovery จะ scan ไม่ได้เลย
1. Ports สำหรับ Scan เครื่องเป้าหมาย
| เป้าหมาย | Protocol | Port | ทิศทาง | หมายเหตุ |
|---|---|---|---|---|
| Linux/Unix | SSH | TCP 22 |
Discovery → Target | Configurable — ใช้ : modifier เปลี่ยน port |
| Windows | WMI | TCP 135 |
Discovery → Target | WMI-In — ต้องมี local admin |
| Windows | DCOM Dynamic | TCP 1024-65535 |
Discovery → Target | DCOM-In — WMI ใช้ port สุ่ม |
| Windows | PowerShell/WinRM | TCP 5985 |
Discovery → Target | ใช้ PowerShellExecute pattern |
| Network Devices | SNMP v1/v2/v3 | UDP 161 |
Discovery → Target | Router, Switch, Printer, IP Camera |
| vSphere ESXi | HTTPS Web API | TCP 443 |
Discovery → ESXi | SSL required |
2. Ports สำหรับ Discovery Agent
| Component | Port | ทิศทาง | หมายเหตุ |
|---|---|---|---|
| Discovery | TCP 51337 |
Discovery → Agent | ค่า default — configurable ใน Agent.cfg |
| Discovery Agent | TCP 51337 |
Agent รับ inbound | Firewall ต้องเปิด inbound port นี้ |
การสื่อสารระหว่าง Discovery ↔ Agent เข้ารหัสด้วย AES-128 + session key exchange
3. Ports สำหรับ Export/Transfer Data
| วิธี Export | Protocol | Port | ทิศทาง | หมายเหตุ |
|---|---|---|---|---|
| File Copy (UNC) | SMB | TCP 445 |
Discovery → File Server | ใช้ network path \\server\share |
| SFTP | SSH | TCP 22 |
Discovery → SFTP Server | Default port, configurable |
| Cloud Export | HTTPS | TCP 443 |
Discovery → Atlassian | ต้อง allowlist api.atlassian.com |
4. ICMP (Host Discovery)
| Protocol | ทิศทาง | Default Timeout | หมายเหตุ |
|---|---|---|---|
| ICMP Echo Request | Discovery → All Targets | 300ms, 0 retries | ถ้า ICMP ถูก block ใช้ ~ modifier |
🔥 Firewall Rules — สรุป commands
เปิดที่เครื่องเป้าหมาย Windows (run as Admin):
# 1. WMI (TCP 135)
netsh advfirewall firewall add rule name="Assets Discovery - WMI" ^
dir=in action=allow protocol=tcp localport=135
# 2. DCOM Dynamic Ports (TCP 1024-65535)
netsh advfirewall firewall add rule name="Assets Discovery - DCOM" ^
dir=in action=allow protocol=tcp localport=1024-65535
# 3. WinRM/PowerShell (TCP 5985)
netsh advfirewall firewall add rule name="Assets Discovery - WinRM" ^
dir=in action=allow protocol=tcp localport=5985
เปิดที่เครื่องเป้าหมาย Linux:
# SSH (TCP 22) — ส่วนใหญ่เปิดอยู่แล้ว
sudo ufw allow 22/tcp
เปิดถ้าใช้ Discovery Agent:
# Agent Port (TCP 51337)
netsh advfirewall firewall add rule name="Assets Discovery Agent" ^
dir=in action=allow protocol=tcp localport=51337
เปิดถ้า export ไป Cloud:
# Outbound HTTPS ไป Atlassian
netsh advfirewall firewall add rule name="Assets Discovery Cloud Export" ^
dir=out action=allow protocol=tcp remoteport=443 ^
remoteip=api.atlassian.com,api.media.atlassian.com
51337 port เดียว
⚙️ Common Settings
เปิด settings mode:
# Windows
cd "C:\Program Files\AssetsDiscovery"
Discovery.exe -s
# Linux
cd /opt/assets-discovery
./Discovery -s
ใส่ password ครั้งแรก — ต้องมี ≥8 ตัว, มี A-Z, a-z, 0-9, symbol อย่างละ 1
ตาราง Settings ทั้งหมด
| Setting | ค่า Default | คำอธิบาย |
|---|---|---|
| Number of threads | 4 | จำนวน scan threads ที่รันพร้อมกัน — แนะนำ CPU cores × 2 (เช่น 4 cores = 8 threads, เกินนี้ไม่ช่วย) |
| Instance prefix | - | ตัวอักษรระบุ Discovery instance สำหรับ import เข้า Assets |
| Max scan thread time | - | จำนวนนาทีที่จะยกเลิก scan thread ที่นานเกิน |
| Log level | Normal | Normal = ข้อมูลพื้นฐาน | Debug = ละเอียด (สำหรับ support) |
| Split log per thread | Off | สร้าง log file แยกแต่ละ thread — main thread ลงท้าย 0000 |
| Delete logs after (days) | 7 | ลบ log files/folders หลังจากกำหนดวัน |
| ICMP timeout | 300ms | Timeout สำหรับ ping — เพิ่มถ้า network ช้า |
| ICMP repeats | 0 | จำนวน retry ถ้า ping ไม่ตอบ |
| SSH timeout | 40s | Timeout สำหรับ SSH connection (Linux) |
| WMI timeout | 25s | Timeout สำหรับ WMI connection (Windows) |
| SNMP timeout | 500ms | Timeout สำหรับ SNMP connection |
| vSphere timeout | 25s | Timeout สำหรับ ESXi/vCenter connection |
| Delete unknown hosts | Off | ลบ hosts ที่ ping ได้แต่ไม่มี credential (Windows only) |
| Delete basic hosts | Off | ลบ hosts ที่ได้แค่ hostname จาก DNS (ไม่มี credential) |
| Delete VM guests | Off | ลบ Virtual Guests จาก pattern เพื่อป้องกัน duplicate |
| Delete duplicate device | Off | ลบ SNMP Device object เมื่อมี Host object อยู่แล้ว |
| Use PowerShell | Off | ใช้ PowerShell แทน WMI — ต้องอยู่ใน Domain + มี DNS server |
| Auto add sudo | Off | เพิ่ม sudo ให้ทุก SSH command อัตโนมัติ |
| Try VM guest scan | Off | scan VMs เป็น physical hosts (ใช้ได้เฉพาะ ESXi) |
🔍 Scan Settings
Scan Settings กำหนดว่าจะสแกน IP ไหน, เมื่อไหร่, บ่อยแค่ไหน
ขั้นตอนตั้งค่า
- 1 เปิด
Discovery.exe -s→ ไปที่ tab Scan Settings - 2 กดปุ่ม + เพิ่ม scan setting ใหม่
- 3 ตั้งค่าตามตารางด้านล่าง
- 4 กด Start Evaluation-Report เพื่อทดสอบ
ตาราง Settings
| Setting | คำอธิบาย |
|---|---|
| Disabled | เลือกแล้ว Discovery จะข้าม scan setting นี้ |
| Scan Interval | Daily หรือ Weekly |
| Next Scan Time/Date | ตั้งเวลา/วันที่ scan รอบถัดไป (บันทึกใน Discovery.cfg) |
| Disabled Pattern Files | เลือก pattern ที่จะไม่ทำงาน (ประหยัดเวลาถ้า scan คนละ zone) |
| Description | คำอธิบาย scan setting |
| Lock | ล็อก/ปลดล็อกการแก้ไข (ไอคอนมุมขวาล่าง) |
| IP-Range | กรอก IP ที่จะ scan — ใช้ ; คั่นหลายรายการ |
IP Variations
| รูปแบบ | ตัวอย่าง | คำอธิบาย |
|---|---|---|
| IP เดี่ยว | 192.168.178.10 | Scan host เดียว |
| หลาย IP | 192.168.178.10;192.168.178.22 | คั่นด้วย ; |
| DNS Name | myserver.company.org | ใช้ hostname แทน IP |
| IP Range | 192.168.178.10-20 | Scan 11 hosts |
| CIDR Subnet | 192.168.178.0/24 | Scan 254 hosts ทั้ง subnet |
| IPv6 | [2001:0db8:85a3::7344] | IPv6 เดี่ยว (ไม่รองรับ range) |
| Text File | iprange.txt | ดึง IP จากไฟล์ (อ่านทุกครั้งที่ scan) |
IP Modifiers
| Modifier | ใช้ทำอะไร | ตัวอย่าง |
|---|---|---|
~ |
Force scan แม้ ICMP ถูกปิด | 192.168.178.10~ |
:Port |
เปลี่ยน SSH/SNMP port จาก default | 192.168.178.10:2222 (SSH)192.168.178.10:1161 (SNMP) |
! |
ยกเว้น IP ที่ระบุ | 192.168.178.150-170! |
ตัวอย่าง Combined
# Range + custom port + force scan
172.70.10.18:2256;172.80.10.90-200;192.168.70.99~
# Range with exclusion
177.20.80.2-100;177.20.80.50-90!
# Multiple subnets + files
192.168.178.10-50;172.213.13.100/27;172.20.222.200/29
# IPv6 with custom port
[2001:0db8:85a3:08d3:1319:8a2e:0370:7344]:55221
ทดสอบ Scan Setting
- กด Start Evaluation-Report
- เลือก fast checkbox: ✅ = ping only, ❌ = ลอง connect ทุก port
- กด Start → ผลบันทึกใน
\logs\directory
🔐 Credential Settings
Credentials ใช้สำหรับ login เข้าเครื่อง target — ถ้าไม่มี credential จะได้แค่ IP + MAC address
ขั้นตอนตั้งค่า
- 1 เปิด
Discovery.exe -s→ ไปที่ tab Credentials - 2 กดปุ่ม + เพิ่ม credential
- 3 เลือก Type ตามเครื่องเป้าหมาย
- 4 กรอกข้อมูล → กด Test ทดสอบ
credentialstore เข้ารหัสด้วย <YourPassword> + <PrivateSalt> + <LocalHostInformation> — ไม่สามารถย้าย credentialstore ไปเครื่องอื่นได้
ตาราง Credential Types
| Type | ใช้กับ | ต้องกรอก | ตัวอย่าง |
|---|---|---|---|
| Windows | WMI (Windows) | Login, Password | DOMAIN\Administrator |
| SSH | Linux (password) | Login, Password | discovery-user |
| SSH_RSA | Linux (key-based) | Login, sudo Password, Passphrase, RSA File | RSA File: C:\Discovery\keys\id_rsa |
| SNMP_V1_V2 | Network devices (v1/v2) | Password (community string) | public (default) |
| SNMP_V3 | Network devices (v3) | Security user, Auth password+protocol, Privacy password+protocol, Context Name | Auth: SHA1, Privacy: AES256 |
| Application | Database (MySQL, PostgreSQL) | Login, Password, Application name | Application: MySQL |
รายละเอียด SNMP v3
| Field | ตัวเลือก |
|---|---|
| Authentication Protocol | MD5, SHA1 |
| Privacy Protocol | DES, AES128, AES192, AES256, TripleDES |
รายละเอียด Application Credentials
ใช้กับ pattern ที่มี $$login$$ และ $$password$$ — ค่าที่กรอกจะแทนที่ placeholder เหล่านี้ตอน execute
ทดสอบ Credential
- เลือก credential ที่ต้องการทดสอบ
- กดปุ่ม Test
- กรอก IP เครื่องเป้าหมาย → กด Test
- สำเร็จ: Connection successful
- ล้มเหลว: Connection failed + รายงานละเอียดบอก step ไหน fail + แนะนำวิธีแก้
📄 Pattern Settings
Pattern files กำหนดว่า Discovery จะเก็บข้อมูลอะไรจากเครื่อง target
- Pattern เป็นไฟล์ XML ที่กำหนด commands ที่จะ run บน target
- มี patterns ในตัวสำหรับ Windows, Linux, Network devices, VMware
- สามารถ สร้าง custom patterns ได้ตามต้องการ
- สามารถ ปิด pattern ที่ไม่ต้องการ ใน scan setting เพื่อประหยัดเวลา
📤 Export Settings
Export Settings กำหนดว่าผล scan จะส่งไปไหน — ตั้งค่าใน Discovery.exe -s → tab Export
5 Export Types
1. None
เก็บไฟล์ใน /scan folder เฉยๆ ไม่ transfer ไปไหน
2. File Copy
Copy ไป local folder หรือ remote UNC path
| Field | คำอธิบาย | ตัวอย่าง |
|---|---|---|
| Export path | Path ปลายทาง — ต้องใช้ UNC path (mapped drive ใช้ไม่ได้) | D:\MyExportFolder หรือ \\192.168.178.15\import |
| Zip password | ตั้งรหัส ZIP (AES-256) — แนะนำให้ใช้ | MySecurePass123 |
3. SFTP
Transfer ผ่าน SSH File Transfer Protocol
| Field | คำอธิบาย | ตัวอย่าง |
|---|---|---|
| Export path | Path ปลายทาง — port 22 default, เปลี่ยนด้วย : |
192.168.178.15:8899/import |
| Login / Password | User ที่มี write access ไปที่ folder ปลายทาง | - |
| Zip password | Optional AES-256 encryption | - |
4. SFTP RSA
Transfer ผ่าน SSH + RSA private key authentication
| Field | คำอธิบาย | ตัวอย่าง |
|---|---|---|
| Export path | เหมือน SFTP | 192.168.178.15/import |
| Login / Passphrase | Login + passphrase ของ RSA key | - |
| RSA file | Path ไป RSA private key file | C:\Program Files\Discovery\keys\transferuser_id_rsa |
| Zip password | Optional | - |
5. Cloud (JSM Cloud)
ส่งตรงไป Jira Service Management Cloud ผ่าน Assets API
| Field | คำอธิบาย |
|---|---|
| Auth token | Token จาก Assets — generate ได้จาก Import config → cogwheel → Generate token |
มีตัวเลือก Atlassian Government Cloud สำหรับ atlassian-us-gov-mod.com domain ด้วย
🔄 ตั้งค่าเป็น Scheduled Service
บน Windows ตั้ง Discovery เป็น Windows Service ให้ scan อัตโนมัติตาม schedule
ขั้นตอนติดตั้ง Service
- 1 เปิด
Discovery.exe -s→ ไปที่ tab Service - 2 ตั้ง Service Restart Interval — default 24 ชม. (ปล่อย memory, ตั้ง 0 = ปิด)
- 3 เลือก User Account:
| Account Type | คำอธิบาย | แนะนำ? |
|---|---|---|
| Custom User Account | ระบุ DOMAIN\Login + password — user ต้องอยู่ใน Administrator group |
✅ แนะนำ |
| Standard System Account | Run as SYSTEM — สิทธิ์สูงมาก | ❌ ไม่แนะนำ |
- 4 กด Install Service
ติดตั้งผ่าน Command Line
# ติดตั้ง (System Account)
discovery.exe -i
# ติดตั้ง (Custom Account - แนะนำ)
discovery.exe -i -user=DOMAIN\svc-discovery -password=YourPass123
# ถอนการติดตั้ง
discovery.exe -u
📊 Collector Setup
Collector ใช้เมื่อต้องการ:
- รัน multiple Discovery instances พร้อมกัน แล้วรวมผล
- สแกน network จากหลาย location แล้ว transfer กลับ
- รับข้อมูลจาก Discovery Agents แล้ว export ไป Cloud
ขั้นตอน Setup
- 1 เปิด command line (admin) →
collector.exe -s - 2 ตั้ง password (≥8 ตัว, A-Z, a-z, 0-9, symbol)
- 3 ตั้งค่าใน tab Common
Collector Settings
| Setting | คำอธิบาย |
|---|---|
| Instance Prefix | ระบุ Collector instance สำหรับ import เข้า Assets |
| Import Folder | Folder ที่มี data จาก Discovery instances |
| Import ZIP Password | ถ้า data เข้ารหัส ZIP ต้องใส่รหัส |
| Export Interval | ความถี่ transfer data (นาที) |
| Export Type | เลือกวิธี transfer (FileCopy/SFTP/Cloud) |
| Export ZIP Password | ตั้งรหัส ZIP สำหรับ export (แนะนำ AES-256) |
| Log Level | Normal หรือ Debug |
| Delete logs after | ลบ log หลังจากกำหนดวัน (default 7) |
Collector Commands
| Command | คำอธิบาย |
|---|---|
collector.exe | รัน scan ด้วย settings ที่บันทึกไว้ |
collector.exe -s | เปิด settings GUI |
collector.exe -v | แสดง version |
collector.exe -i | ติดตั้งเป็น Windows Service |
collector.exe -i -user= -password= | ติดตั้ง service ด้วย custom account |
collector.exe -u | ถอนการติดตั้ง service |
collector.exe -resetpassword | รีเซ็ต password |
collector.exe -supportexport | สร้าง ZIP logs + config สำหรับ support |
🤖 Agent Setup
Agent ใช้เมื่อต้องการ scan เครื่องที่:
- ไม่ได้เปิดตลอด — Agent จะ cache ข้อมูลไว้ส่งเมื่อ online
- ไม่อยากเปิด WMI/DCOM ports — Agent ใช้แค่ port
51337
ขั้นตอนติดตั้ง Agent
- 1 ดาวน์โหลด
assets-discovery-x.x.x.zipจาก Marketplace → แตกไฟล์ - 2 รัน
Discovery_Agent_Setup.msiบนเครื่อง target - 3 Firewall เปิด inbound TCP 51337
- 4 ตั้ง Agent Token (ดูด้านล่าง)
ติดตั้ง Agent Service ผ่าน CLI
# System Account
Discovery_Agent.exe -i
# Custom Account (แนะนำ)
Discovery_Agent.exe -i -user=DOMAIN\svc-agent -password=YourPass123
Agent Token (Pairing)
Agent ต้อง pair กับ Discovery server ด้วย token:
- สร้าง token ใน Discovery UI → Agent tab
- Copy token ไปที่เครื่อง Agent
- รัน:
Discovery_Agent.exe -token <token> - ตั้งแต่ v7.1.4: ติดตั้ง MSI พร้อม token ได้เลย:
msiexec /i "Discovery_Agent_Setup.msi" /qn AGENTTOKEN="<token>"
SFTP Transfer Setup (Agent → Shared Location)
ถ้า Discovery เข้าถึง Agent ไม่ได้ ให้ Agent ส่งผล scan ไป SFTP:
<!-- เพิ่มใน agent.cfg -->
<AgentSFTP>
<Host>192.168.2.2/discovery/import</Host>
<User>yourUser</User>
<Password>mysecurepassword</Password>
<Port>22</Port>
<Retries>5</Retries>
<RetryTimeout>30</RetryTimeout>
</AgentSFTP>
หรือใช้: Discovery_Agent.exe -setupsftp (interactive config)
Agent.cfg Settings สำคัญ
| Setting | Default | คำอธิบาย |
|---|---|---|
AgentPort | 51337 | Port ที่ Agent รับ connection |
ScanInterval | 24h | ความถี่ scan |
DirectCopyPath | - | UNC path สำหรับ copy ตรง |
DisableTCPListener | false | true = ใช้ direct-copy mode (ไม่รับ connection) |
ScanLogLevel | Normal | Normal / Extended / Debug |
UseAllNetworkInterfaces | true | ใช้ทุก NIC |
AgentToken | - | Token สำหรับ pairing |
Manage Agents (จาก Discovery UI)
| Action | คำอธิบาย |
|---|---|
| Trigger scan | สั่ง Agent เริ่ม scan ทันที |
| Collect results | ดึงผล scan จาก Agent กลับมา Discovery |
| Update Agents | อัพเดต Agent เป็น version ล่าสุด (v7.0.0+) |
| Revoke token | ยกเลิก token — ต้องสร้างใหม่ |
📥 Import Data เข้า JSM
หลัง scan เสร็จ ข้อมูลต้อง import เข้า Assets ใน Jira Service Management
Cloud Import
- 1 สร้าง Object Schema ใน JSM (แนะนำ ITSM template)
- 2 สร้าง Import Configuration → เลือก Discovery Import
- 3 เลือกไฟล์ที่ Discovery สร้าง → auto-create structure
- 4 กด cogwheel → Generate token → copy token
- 5 กลับไป Discovery → Export tab → Type: Cloud → วาง token
- 6 Scan ครั้งถัดไปจะ auto-sync เข้า Assets
Data Center Import
- 1 สร้าง Object Schema (แนะนำ "Create sample IT asset schema")
- 2 Import section → เลือก Discovery import
- 3 Directory: ระบุ folder ที่มี scan results
- 4 Scheduling tab: ✅ Automatically synchronize + Cron expression
- 5 Export type ใน Discovery: SFTP หรือ FileCopy
First Import Tips
- เริ่มจาก empty schema
- exclude applications, application services, virtual guests, patches ก่อน
- import hosts + basic data ก่อน → ค่อยเพิ่มทีละส่วน
📄 Patterns คืออะไร?
Patterns เป็นไฟล์ XML ที่กำหนดว่า Discovery จะ เก็บข้อมูลอะไร จากเครื่อง target
Pattern Process Types
| Type | Command | Result | Platform |
|---|---|---|---|
| SSHExecute | ifconfig -a | String | Linux/Unix |
| WMIQuery | SELECT * FROM Win32_OperatingSystem | ManagementObjectCollection | Windows |
| WMIExecute | netstat -an | String | Windows |
| WMIRegValue | Registry path | Object | Windows |
| PowerShellExecute | Get-WmiObject Win32_Product | String | Windows only |
| SNMP_GET | MIB OIDs | List<ExtendedInformation> | Network devices |
| SNMP_WALK | MIB OIDs | List<ExtendedInformation> | Network devices |
Pattern Types (Object Types)
| Type | ตัวอย่าง Pattern | เก็บข้อมูล |
|---|---|---|
| Host | Windows_Hostinfo_Hostname_Model.pat | ข้อมูลเครื่อง |
| Deviceinfo | SNMP_Deviceinfo_Default.pat | ข้อมูลอุปกรณ์ |
| Network | Windows_NetworkInterfaces.pat | Network interfaces |
| CPU | Windows_CPUs.pat | ข้อมูล CPU |
| OS | Windows_OS.pat | ข้อมูล OS |
| FileSystem | Windows_FileSystem.pat | ข้อมูล disk |
| Application | Windows_Application_Product.pat | Installed software |
| Patch | Windows_Patches.pat | Patches/Hotfixes |
| ApplicationService | Windows_ApplicationServices.pat | Running services |
| User | Windows_User.pat | User accounts |
| Group | Windows_Group.pat | User groups |
| HostinfoList | Windows_VBox_VMs.pat | Virtual machines |
| PostProcessing | - | ทำงานหลัง pattern อื่นเสร็จ |
📊 ข้อมูลที่เก็บรวบรวม
Protocol ที่ใช้
| Protocol | Platform |
|---|---|
| SSH | Linux, Unix, AIX, Mac OS X, BSD, HP-UX, Solaris, Novell Netware |
| WMI | Windows 95+ |
| SNMP | Network printers, IP cameras, Routers, Switches |
| Web API | VMware vSphere ESXi |
Platforms ที่ทดสอบแล้ว
| Linux/Unix | Windows | SNMP |
|---|---|---|
| Ubuntu, CentOS, Debian, Red Hat, OpenSUSE, Mac OS X, Solaris, Oracle Linux, Xen, Docker | Windows XP-11, Server 2003-2022, Docker | Axis IP Camera, Samsung IP Camera |
🔢 Object Hash Settings
Object hash คือ unique identifier สำหรับ objects ใน Assets — คำนวณจาก MD5 ของ attribute values ที่กำหนดใน ObjectHashSettings.xml
วิธีคำนวณ
- Concatenate attribute values ที่ตั้ง
true - เติม
InternalObjectHashข้างหน้า - คำนวณ MD5 hash
<!-- ตัวอย่าง ObjectHashSettings.xml -->
<CPUInfo>
<Attribute name="Cores" value="true" />
<Attribute name="MaxClockSpeed" value="true" />
<Attribute name="Name" value="true" />
</CPUInfo>
📋 Commands ที่ Discovery ใช้
Discovery ใช้ commands เหล่านี้เก็บข้อมูล — สำคัญสำหรับ security review
Windows (ตัวอย่าง)
| Command | Type | Pattern |
|---|---|---|
SELECT * FROM Win32_Product | WMIQuery | Applications |
SELECT * FROM Win32_Service | WMIQuery | Services |
SELECT * FROM Win32_Processor | WMIQuery | CPUs |
SELECT * FROM Win32_OperatingSystem | WMIQuery | OS + Uptime |
SELECT * FROM Win32_QuickFixEngineering | WMIQuery | Patches |
SELECT * FROM Win32_ComputerSystem | WMIQuery | Hostname, Model |
SELECT * FROM Win32_PhysicalMemory | WMIQuery | RAM |
SELECT * FROM Win32_BIOS | WMIQuery | Serial Number |
SELECT * FROM Win32_NetworkAdapterConfiguration | WMIQuery | Network |
netstat -n | WMIExecute | Referenced Hosts |
Linux (ตัวอย่าง)
| Command | Pattern |
|---|---|
hostname | Hostname |
uname -a | OS |
cat /proc/cpuinfo | CPUs |
cat /proc/meminfo | RAM |
ifconfig -a / ip addr show | Network |
df -BMB | FileSystem |
rpm -qa / dpkg -l | Applications |
dmidecode -t system | Model, Serial, UUID, Vendor |
netstat -tun | Referenced Hosts |
🧠 การจัดการ Memory
| IP Range | จำนวน Hosts | Memory Impact |
|---|---|---|
/24 | 254 | 🟢 ต่ำ |
/20 | 4,094 | 🟡 ปานกลาง |
/16 | ~65,000 | 🔴 สูงมาก |
Scan Time Estimates
| System Type | Average Time |
|---|---|
| Windows Client (~20 apps) | ~85 วินาที |
| Windows Server | ~45 วินาที |
| Linux | ~20 วินาที |
| Mac OS | ~100 วินาที |
| SNMP Devices | ~2 วินาที |
🔐 หมายเหตุเรื่อง Credentials
- Credentials ถูกเข้ารหัส AES-256 เก็บใน
credentialstore - เข้ารหัสด้วย password + salt จาก system info
- ไม่สามารถย้าย credentialstore ไปเครื่องอื่นได้ — ต้องสร้างใหม่
- แนะนำใช้ LDAP/Active Directory account เดียวสำหรับทุกเครื่อง
- สร้าง user เฉพาะสำหรับ Discovery — ไม่ใช้ admin account หลัก
🔧 Troubleshooting
FIPS Error
"This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms"
# แก้ไข: ปิด FIPS policy
# 1. Local Security Policy → Security Options
# → "System cryptography: Use FIPS compliant algorithms" → Disabled
# 2. Registry
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v fipsalgorithmpolicy /t REG_DWORD /d 0 /f
"The interface is unknown" (0x800706B5)
# รันบนเครื่อง target ที่มีปัญหา
repairwmi.cmd
Winmgmt.exe /standalonehost
Winmgmt.exe /resetrepository
Scan ช้า / Timeout
- ตรวจสอบว่า ICMP เปิดอยู่ — ถ้าปิด scan จะช้ามาก
- ลด IP range ลง
- เพิ่ม threads (2 × CPU cores)
- ตรวจสอบ Credentials ว่าถูกต้อง
Memory ไม่พอ
- ลด IP range → แยกเป็นหลาย scan jobs
- เพิ่ม RAM บน Discovery server
- ปิด pattern ที่ไม่ต้องการ
Service Instance ID เปลี่ยน
sc stop Discovery-Service-<ID>
sc delete Discovery-Service-<ID>
# แล้ว reinstall service
✅ Best Practices
- เริ่มเล็ก ค่อยขยาย — เริ่มจาก
/24range ก่อน - กระจาย scan ตลอดวัน — ไม่ scan พร้อมกันทั้งหมด
- ใช้ Collector สำหรับ multi-site
- ใช้ Agent สำหรับเครื่องที่ offline บ่อย หรือไม่อยากเปิด DCOM ports
- สร้าง Discovery user เฉพาะ — ไม่ใช้ admin account หลัก
- ใช้ LDAP/AD สำหรับ credential management
- เริ่มจาก Object Types พื้นฐาน — Computer, Server, Network Device
- Monitor memory ของ Discovery server
- Backup config สม่ำเสมอ (credentialstore ย้ายไม่ได้!)
- ตั้ง Zip password สำหรับ export เสมอ
✅ Go-Live Checklist
- Firewall เปิดแล้ว:
- ☐ TCP 135 (WMI) ที่เครื่อง Windows เป้าหมาย
- ☐ TCP 1024-65535 (DCOM) ที่เครื่อง Windows เป้าหมาย
- ☐ TCP 5985 (WinRM) ที่เครื่อง Windows เป้าหมาย
- ☐ TCP 22 (SSH) ที่เครื่อง Linux เป้าหมาย
- ☐ UDP 161 (SNMP) ที่ network devices
- ☐ TCP 51337 (Agent) ถ้าใช้ Agent
- ☐ TCP 443 (HTTPS) ถ้า export ไป Cloud
- Credentials พร้อม:
- ☐ Windows credential (domain admin)
- ☐ SSH credential (Linux)
- ☐ SNMP community string (network devices)
- ☐ ทดสอบ credential ทุกชุดผ่านแล้ว
- Scan Settings ตั้งแล้ว:
- ☐ IP range ถูกต้อง
- ☐ Scan time นอกเวลาทำงาน
- ☐ Thread count เหมาะสม (CPU × 2)
- Export ตั้งแล้ว:
- ☐ เลือก export type (FileCopy/SFTP/Cloud)
- ☐ Test export path ผ่านแล้ว
- Service ติดตั้งแล้ว:
- ☐ Custom account (ไม่ใช่ System)
- ☐ Password ถูกต้อง
- ☐ Service running
- Import ตั้งแล้ว:
- ☐ Object Schema สร้างแล้ว
- ☐ Import config ตั้งแล้ว
- ☐ Token สร้างแล้ว (Cloud) / Directory ระบุแล้ว (DC)
📎 ลิงค์ที่เกี่ยวข้อง
| หัวข้อ | ลิงค์ |
|---|---|
| ดาวน์โหลด Assets Discovery | Atlassian Marketplace |
| System Requirements | Atlassian Docs |
| Configure Scan Settings | Atlassian Docs |
| Configure Credential Settings | Atlassian Docs |
| Configure Export Settings | Atlassian Docs |
| Set up Discovery Service | Atlassian Docs |
| Set up Discovery Agent | Atlassian Docs |
| Best Practices and FAQs | Atlassian Docs |
| Commands Executed by Discovery | Atlassian Docs |
| Non-GUI Linux Setup | support.atlassian.com |
1. Firewall → 2. Download & Install → 3. Common Settings → 4. Credentials → 5. Scan Settings → 6. Export → 7. Service → 8. Import เข้า JSM
Assets Discovery Manual — สร้างจาก Atlassian Official Documentation
Last updated: สิงหาคม 2026 | Source: Atlassian Docs