크세노폰의 IT 누리사랑방
우분투 시스템 통계 프로그램 Munin 설치 방법 본문
Munin..
모니터링하기 좋은 프로그램이다.
서비스는 nginx 로 돌고 있기 때문에 기본적으로 아파치에서는 몇 가지 설정을 더 줘야 한다.(엔진x는 빠른데 이런 점이 문제다.)
여하튼 오늘은 munin을 설치하는 방법에 대해 알아보자.
1. apt-get 명령어로 설치하기
=> sudo apt-get install munin munin-node spawn-fcgi libcgi-fast-perl
2. munin 설정하기
=> nano /etc/munin/munin-conf.d/90-fcgi
listen 443 ssl;
listen 80;
charset utf-8;
server_name munin.your-domain.com;location ~ ^/munin/munin-cgi-graph/ {
fastcgi_split_path_info ^(/munin/munin-cgi-graph)(.*);
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_pass unix:/var/run/munin/fastcgi-graph.sock;
include fastcgi_params;
}location /munin/static/ {
alias /etc/munin/static/;
expires modified +1w;
}location /munin/ {
fastcgi_split_path_info ^(/munin)(.*);
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_pass unix:/var/run/munin/fastcgi-html.sock;
include fastcgi_params;
}
location / {
rewrite ^/$ munin/ redirect; break;
}
}
# Provides: munin-fcgi
# Required-Start: $remote_fs $syslog $network
# Required-Stop: $remote_fs $syslog $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start munin FCGI processes at boot time
# Description: Start the FCGI processes behind http://munin.*/
### END INIT INFOgraph_pidfile=”/var/run/munin/fcgi_graph.pid”
# Ubuntu 12.10: /usr/lib/cgi-bin/munin-cgi-graph
graph_cgi=”/usr/lib/munin/cgi/munin-cgi-graph”
html_pidfile=”/var/run/munin/fcgi_html.pid”
# Ubuntu 12.10: /usr/lib/cgi-bin/munin-cgi-html
html_cgi=”/usr/lib/munin/cgi/munin-cgi-html”retval=0
. /lib/lsb/init-functions
start() {
echo -n “Starting munin graph FastCGI: ”
start_daemon -p ${graph_pidfile} /usr/bin/spawn-fcgi -u munin -g munin \
-s /var/run/munin/fastcgi-graph.sock -U www-data ${graph_cgi}
echo
echo -n “Starting munin html FastCGI: ”
start_daemon -p ${html_pidfile} /usr/bin/spawn-fcgi -u munin -g munin \
-s /var/run/munin/fastcgi-html.sock -U www-data ${html_cgi}
echo
retval=$?
}
stop() {
echo -n “Stopping munin graph FastCGI: ”
killproc -p ${graph_pidfile} ${graph_cgi} -QUIT
echo
echo -n “Stopping munin html FastCGI: ”
killproc -p ${html_pidfile} ${html_cgi} -QUIT
echo
retval=$?
}
case “$1″ in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo “Usage: munin-fcgi {start|stop|restart}”
exit 1
;;
esac
exit $retval
sudo chown munin /var/log/munin/munin-cgi-*
sudo update-rc.d munin-fcgi defaults
이렇게 하면 일단 munin이 작동할 것이다.
## 디버그 관련
설정하다 잘 안되면 이 경로에서 힌트를 얻을 수 있다.
1. /var/log/nginx/error.log
2. /var/log/munin/munin-cgi-graph.log
3. /var/log/munin/munin-html-graph.log
'기술과 지침서 > Ubuntu/Linux' 카테고리의 다른 글
극적으로 해결한 FTP문제 (0) | 2015.07.01 |
---|---|
극적으로 해결한 FTP 문제 (0) | 2014.11.01 |
Nginx에서 서버 통계도구 "Munin" 설치방법 (0) | 2014.10.31 |
원격지에서 서버 속도 측정방법 (2) | 2014.01.13 |
트랜스미션 403 Forbidden 오류 해결방법 (4) | 2013.12.12 |