2013年6月18日火曜日

Nagios インストール

Nagios インストール

参考

http://centossrv.com/nagios.shtml
http://www.nagios.org/
http://www.momo-i.org/chapter5/nagios/3.x.html
http://assets.nagios.com/downloads/nagioscore/docs/Installing_Nagios_Core_From_Source.pdf

# yum -y install gd-devel
# useradd nagios
# passwd nagios

最新版ダウンロード
nagios-3.4.3
http://sourceforge.net/projects/nagios/files/nagios-3.x/nagios-3.4.3/

$wget http://sourceforge.net/projects/nagios/files/nagios-3.x/nagios-3.4.3/nagios-3.4.3.tar.gz

$tar -zxmf nagios-3.4.3.tar.gz
$wget http://ftp.momo-i.org/pub/other/nagios-jp-3.5.0.patch.gz
$gzip -dc nagios-jp-3.5.0.patch.gz | patch -p1
$./configure

*** Configuration summary for nagios 3.5.0 03-15-2013 ***:

 General Options:
 -------------------------
        Nagios executable:  nagios
        Nagios user/group:  nagios,nagios
       Command user/group:  nagios,nagios
            Embedded Perl:  no
             Event Broker:  yes
        Install ${prefix}:  /usr/local/nagios
                Lock file:  ${prefix}/var/nagios.lock
   Check result directory:  ${prefix}/var/spool/checkresults
           Init directory:  /etc/rc.d/init.d
  Apache conf.d directory:  /etc/httpd/conf.d
             Mail program:  /bin/mail
                  Host OS:  linux-gnu

 Web Interface Options:
 ------------------------
                 HTML URL:  http://localhost/nagios/
                  CGI URL:  http://localhost/nagios/cgi-bin/
 Traceroute (used by WAP):  /bin/traceroute


Review the options above for accuracy.  If they look okay,
type 'make all' to compile the main program and CGIs.

$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-init
     - This installs the init script in /etc/rc.d/init.d

  make install-commandmode
     - This installs and configures permissions on the
       directory for holding the external command file

  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-webconf
     - This installs the Apache config file for the Nagios
       web interface

  make install-exfoliation
     - This installs the Exfoliation theme for the Nagios
       web interface

  make install-classicui
     - This installs the classic theme for the Nagios
       web interface


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

If you have questions about configuring or running Nagios,
please make sure that you:

     - Look at the sample config files
     - Read the documentation on the Nagios Library at:
           http://library.nagios.com

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:

       http://support.nagios.com

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

Enjoy.

# make install && make install-init && make install-commandmode && make install-config

#cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/
#chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers/

# pwd
/usr/local/nagios/etc
# diff nagios.cfg nagios.cfg.org
52c52
< cfg_dir=/usr/local/nagios/etc/servers
---
> #cfg_dir=/usr/local/nagios/etc/servers
1115c1115
< date_format=iso8601
---
> date_format=us

#mkdir /usr/local/nagios/etc/servers
#cd /usr/local/nagios/etc/servers

# cat contacts.cfg
define contact{
        contact_name    nagiosadmin
        use             generic-contact
        alias           Nagios Admin

        email           email@example.com
}

# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

エラーがでなかったらOK

0 件のコメント:

コメントを投稿