Linux & Bash CentOS + Nagios 센트OS 에서 나기오스 설치하기
2019.01.31 21:31
chcon -R -t httpd_sys_content_t /usr/local/nagios
원문 : http://gentooboy.tistory.com/191
1. rpmforge를 repository에 추가
# wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
# rpm -Uvh rpmforge-release-0.5.2-2.el6.rf.i686.rpm
or
# wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
# rpm -Uvh rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
* 운영체제에 맞춰서 설치
x86(32bit) -> i686
amd64(64bit) -> x86_64
2. 설치
# yum install nagios nagios-plugins nagios-plugins-nrpe
3. apache에 nagios설정
# vi /etc/httpd/conf/httpd.conf
파일의 끝부분 Include 부분 주석 해제 (# 제거)
# Include /etc/httpd/conf.d/nagios.conf => Include /etc/httpd/conf.d/nagios.conf
4. apache의 nagios인증 설정
# htpasswd -c /etc/nagios/htpasswd.users nagiosadmin
5. nagios 설정 검사
# nagios -v /etc/nagios/nagios.cfg
6. nagios 시작, apache 재시작
# service nagios start
# service apache restart
7. 웹페이지 접속
http://localhost/nagios
-- trouble shooting --
+ service nagios start 했을 때 아래와 같은 문제가 발생할 경우 +
nagios is stopped
Configuration validation failed [FAILED]
A. selinux를 disable or permissive로 설정해야 한다.
일시적으로 바꾸기
# setenforce 0
or
# setenforce permissive
잘 바뀌었는지 확인하기
# getenforce
재부팅해도 selinux 끄는 설정 적용되게 하기
# vi /etc/sysconfig/selinux
SELINUX=disabled
or
SELINUX=permissive
# reboot
-----
또 다른 게시글
원문 : http://koeiking11.tistory.com/302
Nagios Core 설치 하기
--사용자 계정 만들기
useradd nagios
passwd nagios
--sudo 권한 부여
/etc/sudoers
whatap ALL=(ALL) NOPASSWD: ALL
--그룹 만들기
/usr/sbin/groupadd nagcmd
/usr/sbin/usermod -a -G nagcmd nagios
/usr/sbin/usermod -a -G nagcmd apache
-- 필수 유틸 설치 (apache, php, gcc compiler, GD development libraries)
sudo yum install httpd php
sudo yum install gcc glibc glibc-common sudo yum install gd gd-devel
-- 다운로드 폴더 생성
mkdir /home/nagios/core
cd /home/nagios/core
-- 소스 다운로드
wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-4.1.1.tar.gz
wget http://www.nagios-plugins.org/download/nagios-plugins-2.1.1.tar.gz
-- 압축 풀기
cd /home/nagios/core
tar xzf nagios-4.1.1.tar.gz
cd /home/nagios/core/nagios-4.1.1
-- 컴파일
./configure --with-command-group=nagcmd
-- make
make all
make install
make install-init
make install-config
make install-commandmode
-- 구성 정의
vi /usr/local/nagios/etc/objects/contacts.cfg
-- Apache nagios.conf 파일 만들기
make install-webconf
-- 사용자 인증 추가
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
-- Apache 재시작
service httpd restart
-- 플러그 인 설치
cd /home/nagios/core
tar xzf nagios-plugins-2.1.1.tar.gz
cd nagios-plugins-2.1.1
-- 플러그 인 컴파일
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install
-- 부팅시 시작되도록 설정
chkconfig --add nagios
chkconfig nagios on
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
-- nagios 재시작
service nagios restart
-- SELinux 설정
getenforce
setenforce 0
chcon -R -t httpd_sys_content_t /usr/local/nagios/sbin/
chcon -R -t httpd_sys_content_t /usr/local/nagios/share/
-- 사이트 확인
http://localhost/nagios/
********* 기타 *****************
**************************************
-- 아파치 위치
/etc/httpd
-- 아파치 로그
/var/log/httpd
-- Nagios core 파일 위치
/usr/local/nagios/share
출처: https://marasong.tistory.com/60 [날아라 MaraSong]
댓글 0
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
25 |
라즈베리파이 - OS 설치후 확인해야 하는 사항
![]() | MaraSong | 2019.02.04 | 580 |
24 | Bash - 자주 쓰는 함수 | MaraSong | 2019.02.01 | 693 |
» | CentOS + Nagios 센트OS 에서 나기오스 설치하기 | MaraSong | 2019.01.31 | 918 |
22 | apache + letsencrypt (무료 SSL 인증기관 인증서) 설치 및 설정 | MaraSong | 2019.01.31 | 943 |
21 | 배치 batch - 오래된 로그파일 정리하기 | MaraSong | 2019.01.29 | 1652 |
20 | 네트워크 - 와이어샤크 WireShark 유용한 필터식 [3] | MaraSong | 2019.01.28 | 31725 |
19 |
백업시 에러 : The backup of full-text catalog 'DB' is not permitted because it is not online.
[9] ![]() | MaraSong | 2019.01.28 | 1200 |
18 | 윈도 네트워크 비정상 동작시 오류 수정 | MaraSong | 2019.01.28 | 761 |
17 |
컬럼 수정시 Saving changes is not permitted 에러
![]() | MaraSong | 2019.01.25 | 765 |
16 | 테이블별 용량 및 로우수 확인하기 [19] | MaraSong | 2019.01.25 | 845 |
* 쿠팡 파트너스 활동을 통해 일정액의 수수료를 제공받을 수 있습니다.