Munin Monitoring - Server/Client 구축

cloud·2024년 11월 11일

Munin 서버 구축

1. Munin 설치

1.1 EPEL 저장소와 PowerTools 활성화

sudo dnf install epel-release -y
sudo dnf config-manager --set-enabled powertools

1.2 Munin 설치

sudo dnf install munin -y

2. Apache 설정

2.1 Apache 설치 및 활성화

sudo dnf install httpd -y
sudo systemctl enable --now httpd

2.2 Munin의 Apache 설정 파일을 확인하고 활성화

sudo ln -s /etc/munin/httpd/munin.conf /etc/httpd/conf.d/munin.conf

2.3 Apache 재시작

sudo systemctl restart httpd

3. Munin 설정파일 수정

sudo vim /etc/munin/munin.conf

모니터링할 클라이언트 정보 입력

[client01]
    address 192.168.1.101
    use_node_name yes

4. 그래프 Zoom 관련 권한 설정

4.1 apache & munin conf 파일 생성

vim /etc/httpd/conf.d/munin.conf

다음 내용 추가

alias /munin /var/www/html/munin
ScriptAlias   /munin-cgi/munin-cgi-graph /var/www/html/munin/cgi/munin-cgi-graph

#ScriptAlias /munin-cgi/ /var/www/html/munin/cgi/

# FastCGI
<Directory "/var/www/html/munin/cgi">
    Options +ExecCGI
    <IfModule mod_fcgid.c>
        SetHandler fcgid-script
    </IfModule>
    <IfModule !mod_fcgid.c>
        SetHandler cgi-script
    </IfModule>
</Directory>

<directory /var/www/html/munin>
    Satisfy Any
</directory>

4.2 권한 설정

sudo chown -R munin:apache /var/log/munin/

5. cron 설정

vi /etc/cron.d/munin

MAILTO=root
* * * * * munin test -x /usr/bin/munin-cron && /usr/bin/munin-cron # 1분마다

6. 서비스 시작

sudo systemctl start munin

7. 로그 확인

tail -f /var/log/munin/munin-update.log

Client 설정을 마치면 1분마다 업데이트된다

Munin Client 구축

1. Munin 설치

1.1 EPEL 저장소와 PowerTools 활성화

sudo dnf install epel-release -y
sudo dnf config-manager --set-enabled powertools

1.2 Munin-node설치(클라이언트)

sudo dnf install munin-node -y

2. Munin-Node 설정 수정

sudo vim /etc/munin/munin-node.conf

# allow 옵션에 서버의 IP 주소를 추가

allow ^192\.168\.1\.100$

3. Munin-Node 서비스 시작

sudo systemctl enable --now munin-node
sudo systemctl restart munin-node

0개의 댓글