1. ubuntu 22.04 의존성 라이브러리 설치
#apt install build-essential apache2 php openssl perl make php-gd libgd-dev libapache2-mod-php libperl-dev libssl-dev daemon wget apache2-utils unzip
2. nagios 유저 생성 및 그룹 설정
# useradd nagios
# groupadd nagcmd
# usermod -a -G nagcmd nagios
# usermod -a -G nagcmd www-data
3. nagios 설치
# cd /usr/local/src
# wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.4.6.tar.gz
# tar -zxvf nagios-4.4.6.tar.gz
# cd nagios-4.4.6
# ./configure --with-nagios-group=nagios --with-command-group=nagcmd --with-httpd_conf=/etc/apache2/sites-enabled
# make all
# make install
# make install-init
# make install-config
# make install-commandmode
# make install-webconf
4. 패스워드 인증 설정 후 아파치 재구동
# htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
# a2enmod cgi
# systemctl restart apache2
5. nagios 이메일 수정
# vim /usr/local/nagios/etc/objects/contacts.cfg
me@yeonghoon.kim
6. nagios plugin 설치
# cd /usr/local/src
# wget https://nagios-plugins.org/download/nagios-plugins-2.3.3.tar.gz
# tar -zxvf nagios-plugins-2.3.3.tar.gz
# cd nagios-plugins-2.3.3
# ./configure --with-nagios-user=nagios --with-nagios-group=nagios
# make
# make install
7. nagios 재구동 및 부팅시 자동으로 시작되도록 설정
# systemctl enable --now nagios