서버/리눅스
collectd-nginx 설치하기 - CentOS
사악신
2013. 5. 3. 10:07
#yum install collectd-nginx
yum 으로 모듈을 설치한 후, 설정 파일(/etc/collectd.d/nginx.conf)을 수정한다.
LoadPlugin nginx
<Plugin nginx>
URL "http://localhost:8080/status?auto"
# User "www-user"
# Password "secret"
# CACert "/etc/ssl/ca.crt"
</Plugin>
그리고 nginx 설정파일(/etc/nginx/conf.d/default.conf)에 다음을 추가한다.(현재 nginx 가 8080 포트를 사용하고 있음)
location /status {
stub_status on;
access_log off;
allow 127.0.0.1;
deny all;
}
nginx 와 collectd 데몬을 재실행한다. 아래와 같이 nginx 항목이 추가되고 그래프가 출력되는지 확인한다.
반응형