centos系統安裝nagios、pnp4nagios步驟

來源:互聯網
上載者:User


一、簡介

Nagios是一款開源的電腦系統和網路監視工具,能有效監控Windows、Linux和Unix的主機狀態,交換器路由器等網路設定,印表機等。是營運利器,不會nagios怎麼好意思說你是營運呢?

二、安裝nagios

1、下載nagios:下載地址:http://sourceforge.net/projects/nagios-cn/?source=typ_redirect

2、安裝nagios

(前提安裝httpd和php)

建立使用者解壓編譯安裝


useradd nagios -G nagcmd
tar jxvf nagios-cn-3.2.3.tar.bz2
cd nagios-cn-3.2.3
./configure --prefix=/nagios --with-command-group=nagcmd

安裝nagios及其設定檔


make all
make install
make install-init
make install-commandmode
make install-config
cp sample-config/httpd.conf /etc/httpd/conf.d/nagios.conf

建立登入密碼:

htpasswd -c /nagios/etc/htpasswd.users nagios

啟動測試:


service nagios start
service httpd start


預設應該能啟動啦:


我的沒問題,如果有報錯的話多半是少了什麼包,網上查查吧。

到這裡的話,成功了一大半了。

下面安裝nagios-plugins和nrpe

下載nagios-plugins:http://nagios-plugins.org/download/nagios-plugins-2.0.3.tar.gz

下載nrpe:http://sourceforge.net/projects/nagios/files/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz/download

安裝就很簡單啦,然後就是配置,下面就不贅述了。

然後說說pnp4nagios的安裝:

1、下載https://sourceforge.net/projects/pnp4nagios/files/latest

2、編譯安裝:

tar zxvf pnp4nagios-0.6.14.tar.gz
cd pnp4nagios-0.6.14
./configure && make all && make install
開啟nagios.cfg配置:
host_perfdata_command=process-host-perfdata
service_perfdata_command=process-service-perfdat

修改 commands.cfg配置:


define command{
        command_name    process-host-perfdata
        command_line    /pnp4nagios/libexec/process_perfdata.pl -d HOSTPERFDATA
        }
 
 
# 'process-service-perfdata' command definition
define command{
        command_name    process-service-perfdata
        command_line    /pnp4nagios/libexec/process_perfdata.pl
        }


在templates.cfg添加相應的action_url:


主機模版

        action_url                      /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=_HOST_

服務模版
        action_url                      /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$


好了,小太陽也出來了。

相關文章

聯繫我們

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