安裝Splunk並擷取遠端WMI簡易教學
閱讀完本文後,你將會知道如何安裝設定Splunk,並擷取遠端Server的伺服器的WMI資料,如CPUTime, Memory, LocalNetwork等等。
前言:
假設內網裡有Server A,用作Splunk Center,Window2k3Server,IP 192.168.2.100。Server B用作Client,Window2k3Server,IP 192.168.2.101.
1. 下載並安裝Splunk於A Server上:
a. 安裝成Local System User
b. 安裝完成後檢查8000與8089是否處於Listen狀態
c. 在瀏覽器上輸入 http://192.168.2.100:8000 是否能顯示Splunk的登入介面。
d. 輸入用戶名:Admin,密碼: changeme
e. 在應用->Search中,搜尋一下本機的Log檢查看看是否已經能找到Log並Index成資料庫。如關鍵字:LogName=Application
f. 修改Splunk的Admin密碼。在Search->管理->使用者
2. 設定擷取遠端Server B的WMI資料
a. 在Server A上新增User,本例使用SplunkAdmin,並配置Administrators權限。設置此使用者的密碼。
b. 在Server B上新增User,要與點a一樣的User名字與一樣的密碼,本例使用SplunkAdmin,並配置Performance Log Users與Performance Monitor Users權限。
c. 設置Server B的WMI使用權:Computer Management->Services and Applications->WMI Control->Properties->Security,點擊Root->Security->Add User SplunkAdmin並配置Enable Account與Remote Enable權限。Advanced->點擊SplunkAdmin->Edit->設置This namespace and subnamespaces。
d. 加DCOM權限。Control Panel->Administrative Tools->Local Security Policy->Local Policies->Security Options->DCOM:Machine Launch Restriction => Properties->Edit Security => Add User SplunkAdmin-> 將Remote Launch與Remote Activation打勾。
3. 設置Server A的服務使用者
a. 在「Start」-> 「Run」執行services.msc,找出splunkd服務,右鍵打開Properties。
b. 在Log On裡面,將Local System Account改成This Account,並輸入SplunkAdmin的用戶名和密碼。
c. 重啟splunkd服務。
4. 設定Splunk主動讀取Client端的WMI資料
a. 回到Splunk的web介面。
b. Search->管理->資料滙入->WMI匯集
c. 點擊進入你想要收集資料的類型,裡面有些預設的,如CPUTime,Memory等,並在最下方加入Server B的IP位址。
d. 回到Search中,你會發現下方三欄的最右方「主機」欄裡有Server B的資料。
留言