정보보안아카데미

#25

이야기prog 2025. 9. 9. 11:06
반응형

 

Nagios :  Nagios는 서버, 네트워크, 애플리케이션 등의 IT 인프라를 모니터링하는 오픈 소스 소프트웨어입니다. 시스템 관리자들이 서버가 정상 작동하는지, 네트워크 장비에 문제가 없는지, 서비스가 다운되지 않았는지 등을 실시간으로 감시할 수 있게 해줍니다.

#ubuntu
sudo apt install -y build-essential libgd-dev openssl libssl-dev unzip apache2 php libapache2-mod-php php-gd
sudo apt update -y
sudo useradd nagios
sudo groupadd nagcmd
sudo usermod -a -G nagcmd nagios
sudo usermod -a -G nagcmd www-data
cd /tmp
wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.5.1.tar.gz
tar xzf nagios-4.5.1.tar.gz
cd nagios-4.5.1
./configure --with-nagios-group=nagios --with-command-group=nagcmd
make all

make install
make install-init
make install-commandmode
make install-config
make install-webconf
cd ..

wget https://nagios-plugins.org/download/nagios-plugins-2.3.3.tar.gz
tar xzf 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

a2enmod rewrite
a2enmod cgi
systemctl restart apache2
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

systemctl start nagios
systemctl enable nagios

 

 

 

GoAccess: 웹 로그 분석기

 

#apache download and start

#이 작업은 보통 패키지 서명 키를 등록해서 해당 저장소에서 안전하게 패키지를 받을 수 있게 하는 과정
wget -O - https://deb.goaccess.io/gnugpg.key | gpg--dearmor | sudo tee /usr/share/keyrings/goaccess.gpg >/dev/null

#저장소 설치
echo "deb [signed-by=/usr/share/keyrings/goaccess.gpg arch=$(dpkg --print-architecture)] https://deb.goaccess.io/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/goaccess.list

sudo apt update -y
sudo apt install -y goaccess

#터미널로 확인
goaccess /var/log/apache2/access.log -c

# report.html로 저장
goaccess /var/log/apache2/access.log -o report.html --log-format=COMBINED

# real time
goaccess /var/www/html/report.html --log-format=COMBINED --real-time-html
반응형

'정보보안아카데미' 카테고리의 다른 글

#27  (0) 2025.09.12
#26  (1) 2025.09.10
#24(보안로그 분석)  (0) 2025.09.08
#23  (0) 2025.09.04
#22 (DB보안)  (1) 2025.09.01