nagios用戶端安裝與配置windows篇

來源:互聯網
上載者:User

標籤:restart   預設   img   machine   開機   nsclient   drive   不用   screen   

一、被監控的windows xp用戶端的配置

1、安裝NSClient++並安裝
: http://sourceforge.net/projects/nscplus
NSClient++-0.3.8-Win32.msi  
NSClient++-0.3.8-x64.msi

2、安裝NSClient++
雙擊安裝 -> next -> 同意 -> next  -> next -> next -> 設定允許IP,設定密碼(這裡密碼一般可以不設定),Modules to load (選前三個模組就可以了,第2個為chect_nt用於監控windows,第3個為checp_nrpe用於監控linux) -> next  -> install  -> finish

3、啟動NSClientpp服務,並允許服務互動式

4、如果windows開啟了內建的防火牆,那麼必須設定讓該程式通過




二、監控端主機的設定(Nagios伺服器)

1、檢查Nagios目錄下的libexec子目錄,一定要存在check_nt(例如:/usr/local/nagios/libexec/check_nt)



2、配置command.cfg檔案(例如:/usr/local/nagios/etc/objects/command.cfg),增加如下幾行(預設應該已經有了)

 

#/usr/local/nagios/etc/objects/command.cfg

 

# ‘check_nt‘ command definition


define command{
command_name    check_nt
command_line    $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v $ARG1$ $ARG2$
}

3、編譯nagios.cfg檔案

 

#/usr/local/nagios/etc/nagios.cfg,開啟下面這一行

 

# Definitions for monitoring a Windows machine

 

cfg_file=/usr/local/nagios/etc/objects/windows.cfg



#vi  /usr/local/nagios/etc/objects/windows.cfg,下面為配置主要的監控項目



#定義要被監控的windows主機名稱與主機的IP地址

define host{

 

use             windows-server 

 

host_name       ruanxi         

 

alias           My Windows Server

 

address         192.168.0.5    

 

}



#定義一個主機名稱組(可以不用管它)

define hostgroup{

 

hostgroup_name  windows-servers

 

alias           Windows Servers

 

}



#檢查windows主機是否已經安裝了NSClient++,及它的版本號碼

define service{

 

use                     generic-service

 

host_name               ruanxi

 

service_description     NSClient++ Version

 

check_command           check_nt!CLIENTVERSION

 

}



#監控 windows 主機的開機運作時間

define service{

 

use                     generic-service

 

host_name               ruanxi

 

service_description     Uptime

 

check_command           check_nt!UPTIME

 

}



#監控 windows 主機的 CPU 負載

define service{

 

use                     generic-service

 

host_name               ruanxi

 

service_description     CPU Load

 

check_command           check_nt!CPULOAD!-l 5,80,90    #CPU如果到達80%則警示,到達90%則警笛

 

}



#監控 windows 主機的記憶體使用量狀況 

define service{

 

use                     generic-service

 

host_name               ruanxi

 

service_description     Memory Usage

 

check_command           check_nt!MEMUSE!-w 80 -c 90  #記憶體使用量到達80%則warn,到達90%則Critical

 

}



#監控 windows 主機的 C:\ 的空間使用量 

define service{

 

use                     generic-service

 

host_name               ruanxi

 

service_description     C:\ Drive Space

 

check_command           check_nt!USEDDISKSPACE!-l c -w 80 -c 90

 

}



#監控 windows主機的W3SVC設定的動作狀況

                         ------>此服務為WEB伺服器有關日誌的服務程式

 

define service{

 

use                     generic-service

 

host_name               ruanxi

 

service_description     W3SVC

 

check_command           check_nt!SERVICESTATE!-d SHOWALL -l W3SVC

 

}



#監控 windows 主機的 Explorer.exe 執行程式的運作狀況,如程式終止了,則會發 CRITICA

define service{

 

use                     generic-service

 

host_name               ruanxi

 

service_description     Explorer

 

check_command           check_nt!PROCSTATE!-d SHOWALL -l Explorer.exe

 

}



#監控 windows 主機的 MSSQLSERVER 服務的運作狀況,如服務終止了,則會發 CRITICAL 

define service{

 

use                     generic-service

 

host_name               ruanxi

 

service_description     MSSQL

 

check_command           check_nt!SERVICESTATE!-d SHOWALL -l MSSQLSERVER

 

}



說明:如果有多台的windows xp用戶端要監控,那麼就以上述這樣寫多個就可以了

3、檢查nagios.cfg檔案有沒有錯誤

 

#nagios -c  nagios.cfg



4、重新啟動一下nagios服務

 

#service nagios restart



5、訪問頁面進行查看

 

#elinks http://localhost/nagios/

nagios用戶端安裝與配置windows篇

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.