Nagios
yum update && upgrade
-----------------------기본 패키지 설치--------------------
yum –y install httpd php php-mysql mysql mysql-server
----------------------------selinux 해제---------------------------------
# vu /etc/selinux/config
SELINUX=disabled
----------------------------필수 설치 패키지 -----------------------
yum –y install gcc glibc glibc-common wget unzip gd gd-devel xinetd make gettext automake wget openssl-devel epel-release autoconf sendmail perl perl-CGI
yum group install “development tools”
---------------------------계정 생성-----------------------------------
# useradd –m Nagios
# passwd Nagios
# groupadd nagomd
# usermod –a –G nagomd Nagios
# usermod –a –G nagomd apache
-----------------------Nagios core 설치-------------------------
# wget -O nagioscore.tar.gz https://github.com/NagiosEnterprises/nagioscore/releases/download/nagios-4.4.6/nagios-4.4.6.tar.gz
# tar xvfz nagioscore.tar.gz
# cd nagioscore-nagios-4.3.4/
# ./configure --with-command-group=nagcmd
# make all
# make install
# make install-init
# make install-config
# make intall-commandmode
-----------------------------Nagios 설정---------------------------------\
# vi /usr/local/nagios/etc/objects/contacts.cfg
email 부분 수정 Alert mail 수신을 위함
---------------------------------Web Interface 설정--------------------
# make install-webconf
>> 웹 접속자 용 계정 만들기
# htpasswd -c /usr/local/nagios/etc/ htpasswd.users nagiosadmin
service httpd start
systemctl status httpd
--------------------------Nagios plugin 설치(Nagios 서버)---------
cd /tmp
wget http://nagios-plugins.org/download/nagios-plugins-2.3.3.tar.gz
# tar -zxvf /tmp/nagios-plugins-2.3.3.tar.gz
# cd /tmp/nagios-plugins-*/
# ./configure --with-nagios-user=nagios --with-nagios-group=nagios
# make && make install
# make install
// nagios 서비스 실행
# chkconfig nagios on
>> nagios 이상유무를 위한 테스트
# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
>> 서비스 시작
# service nagios start
# systemctl enable nagios.service
# systemctl status nagios
# http://서버IP/nagios/ 접속
※ 업그레이드 할경우 Nagios 실행파일 재실행
systemctl daemon-reload
service nagios checkconfig
service nagios restart
사진 삭제
사진 설명을 입력하세요.
-----------------------------Nagios NRPE 설치------------------------
# wget https://github.com/NagiosEnterprises/nrpe/releases/download/nrpe-4.0.3/nrpe-4.0.3.tar.gz
# tar nrpe-4.0.3.tar.gz
# cd nrpe-nrpe-4.0.3
# ./configure
# make all
# make && make install
# cp -arp sample-config/nrpe.cfg /usr/local/nagios/etc
# make install-xinetd
--------------------------------------포트 개방----------------------------
# vi /etc/services
nrpe 5666/tcp # NRPE
amqps 5671/tcp # amqp protocol over TLS/SSL
# firewall-cmd --add-port=80/tcp
# firewall-cmd --add-port=5666/tcp
# firewall-cmd --add-port=5671/tcp
# firewall-cmd --runtime-to-permanent
>> 포트 확인
# firewall-cmd --list-ports
# vi /usr/local/nagios/etc/objects/commands.cfg
>> 맨 아래에 내용추가
# 'check_nrpe' command definition
define command{
command_name check_nrpe
command_line /usr/local/nagios/libexec/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}
# service xinetd restart
※ 이벤트 로그 확인을 위한 OS 시간 변경
timedatectl set-timezone Asia/Seoul
vi /etc/chrony.conf
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 0.kr.pool.ntp.org
server 1.asia.pool.ntp.org
server 2.asia.pool.ntp.org
server 3.asia.pool.ntp.org
server 4.asia.pool.ntp.org
systemctl restart chronyd
timedatectl >>변경 시간 확인
'OS > Linux' 카테고리의 다른 글
[Centos 8] Nagios Core - 슬랙 연동 (0) | 2021.04.20 |
---|---|
[Centos 8] Nagios Core - 클라이언트편 (0) | 2021.04.20 |
[Centos] Openvpn 설치 및 구성 (0) | 2021.01.29 |
[리눅스 명령어] sar (sysstat) 명령어 (0) | 2020.12.24 |
[리눅스명령어] grep, less, sed (0) | 2020.12.24 |