CentOS 6.3_Nagios配置筆記

來源:互聯網
上載者:User

一、Nagios監控主機配置(IP:192.168.7.249)

1、安裝nrpe服務

解壓縮

[root@nagios ~]# tar -zxvf nrpe-2.14.tar.gz

[root@nagios ~]# cd nrpe-2.14

編譯

[[root@nagios nrpe-2.14]#./configure

root@nagios nrpe-2.14]# make all

[root@nagios nrpe-2.14]# make install-plugin

只運行這一步就行了,因為只需要check_nrpe外掛程式

2、編輯commands.cfg檔案定義nrpe對的使用

[root@nagios ~]# vim /usr/local/nagios/etc/objects/commands.cfg

在最後面增加如下內容:

# 'check_nrpe ' command definition

define command{

        command_name check_nrpe

       command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$

       }

說明:

command_name check_nrpe

定義命令名稱為check_nrpe,在services.cfg中要使用這個名稱.

command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$

這是定義實際啟動並執行外掛程式程式.這個命令列的書寫要完全按照check_nrpe這個命令的用法.不知道用法的就用check_nrpe –h查看

-c後面帶的$ARG1$參數是傳給nrpe daemon執行的檢測命令,之前說過了它必須是nrpe.cfg中所定義的那5條命令中的其中一條.在services.cfg中使用check_nrpe的時候要用!帶上這個參數

3、配置監控對象(工作站及其服務等)

[root@nagios ~]# vim /usr/local/nagios/etc/nagios.cfg

在cfg_file=/usr/local/nagios/etc/objects/localhost.cfg下添加:

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

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.