Nagios安裝配置

安裝配置Nagios

1、首先下載相關安裝包

nagios-2.9.tar.gz、nagios-plugins-1.4.9.tar.gz、nrpe-2.8.1.tar.gz

NSClient++-0.2.7.zip    該安裝包用於windows客戶端

前三個包下載地址:http://www.nagios.org

後一個包下載地址:http://sourceforge.net/projects/nscplus

2、開始安裝

tar -zxvf nagios-2.9.tar.gz  -C  /usr/src/

cd /usr/src/nagios-2.9

./configure --prefix=/usr/local/nagios

使用make all查看安裝步驟

*** Compile finished ***

If the main program and CGIs compiled without any errors, you

can continue with installing Nagios as follows (type 'make'

without any arguments for a list of all possible options):

make install

This installs the main program, CGIs, and HTML files

使用make install來安裝主程序、CGI和HTML文件

make install-init

This installs the init script in /etc/rc.d/init.d

使用make install-init 來安裝主程序/etc/rc.d/init.d 安裝啓動腳本

make install-commandmode

- This installs and configures permissions on the

directory for holding the external command file

使用make install-commandmode來配置目錄權限

make install-config

- This installs *SAMPLE* config files in /usr/local/nagios/etc

You'll have to modify these sample files before you can

use Nagios. Read the HTML documentation for more info

on doing this. Pay particular attention to the docs on

object configuration files, as they determine what/how

things get monitored!

使用make install-config來安裝示例配置文件,安裝路徑是/usr/local/nagios/etc.

*** Support Notes *******************************************

If you have questions about configuring or running Nagios,

please make sure that you:

- Look at the sample config files

- Read the HTML documentation

- Read the FAQs online at [url]http://www.nagios.org/faqs[/url]

before you post a question to one of the mailing lists.

Also make sure to include pertinent information that could

help others help you. This might include:

- What version of Nagios you are using

- What version of the plugins you are using

- Relevant snippets from your config files

- Relevant error messages from the Nagios log file

For more information on obtaining support for Nagios, visit:

[url]http://www.nagios.org/support/[/url]

*************************************************************

Enjoy.

很多人都不注意安裝過程中輸出的信息、直到make install出錯了纔到處找人求救、而實際上輸出包含很多有價值的信息,例如安裝路徑、版本、每一步做什麼、接下來的步驟等。尤其是輸出的最後一屏信息,建議大家好下

2.1、增加用戶、修改權限 

    useradd nagios

    mkdir /usr/local/nagios

    chown nagios.nagios /usr/local/nagios

2.2、開始執行make install、make install-init、make install-commandmode、make install-config

      驗證程序是否被正確安裝、查看/usr/local/nagios/下面是否有etc、bin、sbin、share、var。如果存在在說明被正確安裝

2.3、安裝插件

       tar -zxvf nagios-plugins-1.4.9.tar.gz  -C  /usr/src/

       cd /usr/src/nagios-plugins-1.4.9

       ./configure --prefix=/usr/local/nagios/   && make  &&  make install

       ls /usr/local/nagios/libexec/ 查看所有安裝的插件都在該目錄下

2.4、將apache運行的用戶添加到nagios這個組裏面去

      grep ^User /usr/local/apache2/conf/httpd.conf 

      我用的是apache用戶,usermod -G nagios apache

2.5、修改apache的配置文、添加如下內容

      vi /usr/local/apache2/conf/httpd.conf

      #setting for nagios 20070707

       ScriptAlias /nagios/cgi-bin /usr/local/nagios/sbin

      <Directory "/usr/local/nagios/sbin">

     Options ExecCGI

      AllowOverride None

      Order allow,deny

     Allow from all

     AuthName "Nagios Access"

     AuthType Basic

      AuthUserFile /usr/local/nagios/etc/htpasswd

   //用於此目錄訪問驗證的密碼

    Require valid-user

     </Directory>

     Alias /nagios /usr/local/nagios/share

     <Directory "/usr/local/nagios/share">

    Options None

     AllowOverride None

     Order allow,deny

    Allow from all

    AuthName "Nagios Access"

    AuthType Basic

     AuthUserFile /usr/local/nagios/etc/htpasswd

    //用於此目錄訪問驗證的密碼

    Require valid-user

    </Directory>

2.6、增加驗證用戶賬號

         /usr/local/apache2/bin/htpasswd -c   /usr/local/nagios/etc/htpasswd test

         基本安裝完成,測試訪問http://192.168.0.111/nagios

3、開始配置

 

 

      

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章