導航:首頁 > 文檔加密 > nagios系統監控pdf

nagios系統監控pdf

發布時間:2023-11-09 11:46:43

A. 怎麼用Nagios監測Windows伺服器

監控主機配置:redhat linux as4,nagios3
被監控主機:Windows Server 2008 R2 Enterprise,nsclient++0.4.4.172
Nagios是一款開源的免費網路監視工具,其功能強大,靈活性強。能有效監控Windows、Linux和Unix的主機狀態,交換機路由器等網路設置,列印機等。nagios監控windows系統有三種實現方式:SNMP、NSClient++、NRPE。
下面介紹使用NSClient++方式來監控Windows:
首先在windows下安裝nsclient++,運行NSCP-0.4.0.172-x64.msi安裝文件,一步一步往下走,其中需要設置nagios監控主機IP和NSClient密碼(值當使用check_nt時使用),如圖1所示:
Allowed hosts:填寫nagios監控主機IP
NSClient Password:當使用命令check_nt時需要設置密碼,根據自己情況設置
Mole to load:根據自己的需要選擇相應的模塊

安裝完畢以後,打開windows服務管理器,查看nsclient服務是否啟動,如圖2所示:

然後在nagios監控主機上面進行相關的配置,主要涉及兩個配置文件nagios.cfg和windows.cfg
(1) 因為nagios是模塊化調用,先到配置文件打開windows相關模塊,編輯nagios.cfg文件
[root@localhost etc]# ls
cgi.cfg htpasswd nagios.cfg nrpe.cfg objects objects.bak objects.tar resource.cfg
[root@localhost etc]# pwd
/usr/local/nagios/etc
[root@localhost etc]# vi nagios.cfg
將#cfg_file=/usr/local/nagios/etc/objects/windows.cfg該行前面的#注釋去掉即可.

(1) 修改windows.cfg配置文件,需要修改define host和define service兩部分
# Define a host for the Windows machine we'll be monitoring
# Change the host_name, alias, and address to fit your situation
define host{
use windows-server ; Inherit default values from a template
host_name video4-beijing ; The name we're giving to this host 被監控主機的主機名
alias video4-beijing ; A longer name associated with the host
contact_groups sa ;
address 10.12.4.169 ; IP address of the host 被監控主機的IP
}

# Create a service for monitoring CPU load
# Change the host_name to match the name of the host you defined above
define service{
use generic-service
host_name video4-beijing
service_description CPU Load
check_command check_nt!CPULOAD!-l 5,80,90
contact_groups sa
}

# Create a service for monitoring
# Change the host_name to match the name of the host you defined above
define service{
use generic-service
host_name video4-beijing
service_description Memory Usage
check_command check_nt!MEMUSE!-w 80 -c 90
contact_groups sa
}

# Create a service for monitoring C:\ disk usage
# Change the host_name to match the name of the host you defined above

define service{
use generic-service
host_name video4-beijing
service_description C:\ Drive Space
check_command check_nt!USEDDISKSPACE!-l c -w 80 -c 90
contact_groups sa
}
修改完相關的配置文件以後,執行如下命令檢查配置文件是否正確:
[root@localhost objects]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

遇到的問題,在檢查配置文件時錯誤信息如下:
Checking services...
Error: Contact group 'admins' specified in service 'C:\ Drive Space' for host 'video4-beijing' is not defined anywhere!
Error: Contact group 'admins' specified in service 'Explorer' for host 'video4-beijing' is not defined anywhere!
Error: Contact group 'admins' specified in service 'Memory Usage' for host 'video4-beijing' is not defined anywhere!
Checked 14 services.
Checking hosts...
Error: Contact group 'admins' specified in host 'video4-beijing' is not defined anywhere!
Checked 7 hosts.
Checking host groups...
Checked 2 host groups.
Checking service groups...
Checked 0 service groups.
Checking contacts...
Checked 1 contacts.
Checking contact groups...
Checked 1 contact groups.
Checking service escalations...
Checked 0 service escalations.
Checking service dependencies...
Checked 0 service dependencies.
Checking host escalations...
Checked 0 host escalations.
Checking host dependencies...
Checked 0 host dependencies.
Checking commands...
Checked 25 commands.
Checking time periods...
Checked 5 time periods.
Checking for circular paths between hosts...
Checking for circular host and service dependencies...
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors: 4

***> One or more problems was encountered while running the pre-flight check...

Check your configuration file(s) to ensure that they contain valid
directives and data defintions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
'Whats New' section to find out what has changed.

以上問題的原因是因為一開始在windows.cfg文件中定義host和service時沒有增加contact_groups sa這個欄位,host和service默認所在的contact_group為admins,而我的nagios監控主機contacts.cfg文件中配置的contactgroup為sa。

閱讀全文

與nagios系統監控pdf相關的資料

熱點內容
wps怎麼把pdf轉jpg 瀏覽:217
自拍用什麼app做的藝術照 瀏覽:169
h3c無線配置命令 瀏覽:515
linux代碼閱讀工具 瀏覽:160
能夠畫出對稱圖形的是什麼app 瀏覽:424
單片機投票器 瀏覽:467
程序員那麼可愛唱嗎 瀏覽:830
手機誤刪的app怎麼恢復 瀏覽:700
java第三方加密庫 瀏覽:660
編譯代碼軟體哪個好 瀏覽:997
編譯器軟體圖片 瀏覽:880
美團專送app怎麼不接受遠單 瀏覽:833
伺服器mgmt口如何連接電腦 瀏覽:798
做程序員至少要精通幾種 瀏覽:673
個人用雲伺服器價格對比 瀏覽:257
如何遠程刪除伺服器文件夾 瀏覽:779
a9賬號如何移植到安卓 瀏覽:340
gpib介面編程 瀏覽:468
索尼recovery編譯 瀏覽:878
app後端php 瀏覽:625