시스템 모니터링 · 3 min read · Oct 16, 2025
munin으로 여러 시스템 모니터링하기 (Debian Etch)
이 기사에서는 munin으로 여러 시스템을 모니터링하는 방법을 설명하겠습니다. munin은 서버의 거의 모든 측면(부하 평균, 메모리 사용량, CPU 사용량, MySQL 처리량, eth0 트래픽 등)에 대한 멋진 그래픽을 생성하며, 많은 구성 없이도 가능합니다. 모니터링할 모든 시스템(여기에는 munin 서버 자체도 포함됨)에 munin 클라이언트를 설치할 것이며, munin 클라이언트는 munin 서버에 보고합니다.
이 튜토리얼은 Debian Etch를 위해 작성되었지만, 구성은 다른 배포판에도 약간의 변경으로 적용될 수 있습니다.
먼저 말씀드리고 싶은 것은, 이러한 시스템을 설정하는 유일한 방법이 아니라는 것입니다. 이 목표를 달성하는 방법은 여러 가지가 있지만, 제가 선택한 방법입니다. 이 방법이 여러분에게도 작동할 것이라는 보장은 하지 않습니다!
1 사전 참고
우리의 munin 서버의 호스트 이름은 server1.example.com(아이피 주소: 192.168.0.100)이며, 그 위에 www.example.com이라는 웹사이트가 있고 문서 루트는 /var/www/www.example.com/web입니다.
여기에서는 하나의 munin 클라이언트인 server2.example.com(아이피 주소: 192.168.0.101)을 사용하고 있습니다. 물론 원하는 만큼 많은 클라이언트 시스템을 추가할 수 있습니다.
2 서버에 munin 설치 및 구성
munin 서버 (server1.example.com):
Debian Etch에 munin 클라이언트와 서버를 설치하려면 다음과 같이 합니다:
apt-get install munin munin-node다음으로, munin 구성 파일 /etc/munin/munin.conf를 편집해야 합니다. munin의 출력을 /var/www/www.example.com/web/monitoring 디렉토리에 저장하도록 하려면 htmldir의 값을 변경해야 하며, HTML 출력에서 localhost.localdomain 대신 server1.example.com이라는 이름을 사용하도록 하려면 localhost.localdomain을 server1.example.com으로 교체해야 합니다. 이 구성으로 munin 서버는 자신을 모니터링할 수 있습니다. 주석을 제외한 변경된 파일은 다음과 같습니다:
vi /etc/munin/munin.conf| dbdir /var/lib/munin htmldir /var/www/www.example.com/web/monitoring logdir /var/log/munin rundir /var/run/munin tmpldir /etc/munin/templates [server1.example.com] address 127.0.0.1 use_node_name yes |
다음으로, /var/www/www.example.com/web/monitoring 디렉토리를 생성하고 소유권을 munin 사용자 및 그룹으로 변경해야 합니다. 그렇지 않으면 munin이 해당 디렉토리에 출력을 저장할 수 없습니다. 그런 다음 munin을 재시작합니다:
mkdir -p /var/www/www.example.com/web/monitoring
chown munin:munin /var/www/www.example.com/web/monitoring
/etc/init.d/munin-node restart이제 munin이 첫 번째 출력을 생성할 수 있도록 몇 분 정도 기다린 후, 브라우저에서 http://www.example.com/monitoring/로 이동하면 첫 번째 통계를 볼 수 있습니다. 며칠 후에는 다음과 같이 보일 수 있습니다:

(이는 munin이 생성하는 많은 그래픽 중 일부에 불과합니다…)
3 munin 서버의 munin 출력 디렉토리에 비밀번호 보호 추가 (선택 사항)
munin 서버 (server1.example.com):
이제 모든 사람이 서버에 대한 모든 작은 통계를 볼 수 있도록 하려면 /var/www/www.example.com/web/monitoring 디렉토리를 비밀번호로 보호하는 것이 좋습니다.
이를 위해 /var/www/www.example.com/web/monitoring에 .htaccess 파일을 생성합니다:
vi /var/www/www.example.com/web/monitoring/.htaccess| AuthType Basic AuthName "Members Only" AuthUserFile /var/www/www.example.com/.htpasswd |
그런 다음 비밀번호 파일 /var/www/www.example.com/.htpasswd를 생성해야 합니다. 우리는 사용자 이름 admin으로 로그인하고 싶으므로 다음과 같이 합니다:
htpasswd -c /var/www/www.example.com/.htpasswd adminadmin의 비밀번호를 입력하면 완료됩니다!
4 클라이언트에 munin 설치 및 구성
munin 클라이언트 (server2.example.com):
클라이언트 시스템에서는 munin-node라는 munin 클라이언트 패키지만 설치하면 됩니다:
apt-get install munin-node다음으로, munin 클라이언트에게 IP 주소 192.168.0.100인 munin 서버 server1.example.com이 클라이언트에서 세부 정보를 가져올 수 있도록 허용해야 합니다. 이를 위해 /etc/munin/munin-node.conf를 열고 맨 아래에 allow ^192.168.0.100$라는 줄을 추가합니다. 이후 파일은 다음과 같아야 합니다:
vi /etc/munin/munin-node.conf| # # Example config-file for munin-node # log_level 4 log_file /var/log/munin/munin-node.log port 4949 pid_file /var/run/munin/munin-node.pid background 1 setseid 1 # Which port to bind to; host * user root group root setsid yes # Regexps for files to ignore ignore_file ~$ ignore_file \.bak$ ignore_file %$ ignore_file \.dpkg-(tmp|new|old|dist)$ ignore_file \.rpm(save|new)$ # Set this if the client doesn't report the correct hostname when # telnetting to localhost, port 4949 # #host_name localhost.localdomain # A list of addresses that are allowed to connect. This must be a # regular expression, due to brain damage in Net::Server, which # doesn't understand CIDR-style network notation. You may repeat # the allow line as many times as you'd like allow ^127\.0\.0\.1$ allow ^192\.168\.0\.100$ |
마지막으로, munin 클라이언트를 재시작합니다:
/etc/init.d/munin-node restart5 munin 서버 구성 업데이트
munin 서버 (server1.example.com):
이제 munin 서버에게 모니터링할 다른 시스템(server2.example.com, 아이피 주소 192.168.0.101)이 있음을 알려야 합니다. 이를 위해 /etc/munin/munin.conf를 열고 server2.example.com에 대한 항목을 추가하여 파일이 다음과 같아지도록 합니다:
vi /etc/munin/munin.conf| dbdir /var/lib/munin htmldir /var/www/www.example.com/web/monitoring logdir /var/log/munin rundir /var/run/munin tmpldir /etc/munin/templates [server1.example.com] address 127.0.0.1 use_node_name yes [server2.example.com] address 192.168.0.101 use_node_name yes |
다음으로, munin을 재시작합니다:
/etc/init.d/munin-node restart몇 분 후, munin 페이지(http://www.example.com/monitoring/)에서 server2.example.com에 대한 링크를 찾아야 합니다:

그 링크를 클릭하면 server2.example.com에 대한 그래프를 볼 수 있습니다.
6 링크
- munin: http://munin-monitoring.org/
새 게시물을 받은 편지함에서 받기
스팸은 없습니다. 언제든지 구독 해지 가능합니다.