2009年10月27日 星期二

安裝Splunk並擷取遠端WMI簡易教學

閱讀完本文後,你將會知道如何安裝設定Splunk,並擷取遠端Server的伺服器的WMI資料,如CPUTime, Memory, LocalNetwork等等。

前言:

假設內網裡有Server A,用作Splunk CenterWindow2k3ServerIP 192.168.2.100Server B用作ClientWindow2k3ServerIP 192.168.2.101.

1. 下載並安裝SplunkA Server上:

a. 安裝成Local System User

b. 安裝完成後檢查80008089是否處於Listen狀態

c. 在瀏覽器上輸入 http://192.168.2.100:8000 是否能顯示Splunk的登入介面。

d. 輸入用戶名:Admin,密碼: changeme

e. 在應用->Search中,搜尋一下本機的Log檢查看看是否已經能找到LogIndex成資料庫。如關鍵字:LogName=Application

f. 修改SplunkAdmin密碼。在Search->管理->使用者

2. 設定擷取遠端Server BWMI資料

a. Server A上新增User,本例使用SplunkAdmin,並配置Administrators權限。設置此使用者的密碼。

b. Server B上新增User,要與點a一樣的User名字與一樣的密碼,本例使用SplunkAdmin,並配置Performance Log UsersPerformance Monitor Users權限。

c. 設置Server BWMI使用權:Computer Management->Services and Applications->WMI Control->Properties->Security,點擊Root->Security->Add User SplunkAdmin並配置Enable AccountRemote 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 LaunchRemote 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. 回到Splunkweb介面。

b. Search->管理->資料滙入->WMI匯集

c. 點擊進入你想要收集資料的類型,裡面有些預設的,如CPUTimeMemory等,並在最下方加入Server BIP位址。

d. 回到Search中,你會發現下方三欄的最右方「主機」欄裡有Server B的資料。

沒有留言:

Google