nagios centos6 install

Linux 2015. 9. 16. 17:10


 

전반적인 IT장비 모니터링 가능,
상세한 Alert 및 Notification 기능제공, map 기능 제공,
장애 이력 관리 및 리포트 제공.. 무료 모니터링 툴 중에선 매우 괜찮은듯 합니다.

 

nagios 설치 작업

centos6.6 , APM 설치

1. nagios core, plugin source 파일 다운로드

wget http://sourceforge.net/projects/nagios/files/nagios-4.x/nagios-4.1.1/nagios-4.1.1.tar.gz

wget http://www.nagios-plugins.org/download/nagios-plugins-2.1.1.tar.gz

 

2. 압축 해제

tar xvf nagios-4.1.1.tar.gz

tar xvf nagios-plugins-2.1.1.tar.gz

 

3. core 설치

cd nagios-4.1.1

./configure --prefix=/usr/local/nagios --with-nagios-user=root --with-nagios-group=root --with-command-user=root --with-command-group=root

make all

make install

make install-init

make install-commandmode

make install-config

make install-webconf

cp /etc/httpd/conf.d/nagios.conf /usr/local/apache/conf/ -> apache install directory

make install-exfoliation

 

 

4. plugin 설치

cd nagios-plugins-2.1.1

./configure --with-nagios-user=root --with-nagios-group=root

make all

make install

 

5. nagios cfg 파일 설정

vim /usr/local/nagios/etc/cgi.cfg

#default_user_name=guest  -> default_user_name=root
authorized_for_system_information=nagiosadmin  ->  authorized_for_system_information=*

authorized_for_configuration_information=nagiosadmin  ->  authorized_for_configuration_information=*

authorized_for_system_commands=nagiosadmin  ->  authorized_for_system_commands=*

authorized_for_all_services=nagiosadmin  ->  authorized_for_all_services=*

authorized_for_all_hosts=nagiosadmin  ->  authorized_for_all_hosts=*

authorized_for_all_service_commands=nagiosadmin  ->  authorized_for_all_service_commands=*

authorized_for_all_host_commands=nagiosadmin  ->  authorized_for_all_host_commands=*

 

 

6. apache 연동

vim /usr/local/apache/conf/nagios.conf

여기서 IfVersion 이런식으로 버전에 따라 설정값이 다른데, 아파치 버전에 맞게 사용하면된다. 아래처럼 사용함.

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.users

      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.users

      Require valid-user

</Directory>

 

 

이제 수정한 nagios.conf 파일을 apache httpd.conf 파일에 추가해야함.

 

vim /usr/local/apache/conf/httpd.conf 내용중 적당한곳에 추가.

 

NameVirtualHost 192.168.0.233:80

<VirtualHost 192.168.0.233:80>

        ServerAdmin pysany@asdf.com

        ServerName 192.168.0.233

        ServerAlias 192.168.0.233

        DocumentRoot /www

        include conf/nagios.conf

        CBandPeriod 1D

        Transferlog '|/usr/local/cronlog/sbin/cronolog /usr/local/apache/logs/transferlog/access_%Y%m%d_transfer_log'

</VirtualHost>

 

 

7. nagios 사용자 비밀번호 설정

htpasswd -c /usr/local/nagios/etc/htpasswd.users pandasuper

 

8. 서비스 재시작

/usr/local/apache/bin/httpd -t

/usr/local/apache/bin/httpd -k restart

/etc/init.d/nagios restart

 

9. http://192.168.0.233/nagios 로 접속되는지 확인(본인 웹서버)

 

'Linux' 카테고리의 다른 글

php-fpm status 확인 페이지 설정방법  (0) 2015.10.13
apache geoip 설정  (0) 2015.09.30
nginx modsecurity install  (2) 2015.09.12
nginx ssl setup  (0) 2015.09.10
How to get the client IP when using CloudFront and nginx  (0) 2015.09.10
Posted by pysany
,