글쓴이 : 윤성재 (공작명왕)
E-mail : <gongjak@gmail.com>
Facebook : < https://www.facebook.com/sungjae.yun >
Nginx Plugin
1.Nginx 설치와 시작
< Debian 8 >
sudo apt-get install nginx
< CentOS 7 >
sudo yum install epel-release sudo yum install nginx sudo systemctl start nginx
2.사전 준비
cd /etc/nginx/conf.d/ && sudo curl -O https://raw.githubusercontent.com/Stackdriver/stackdriver-agent-service-configs/master/etc/nginx/conf.d/status.conf
3.Plugin 설치
cd /opt/stackdriver/collectd/etc/collectd.d/ && sudo curl -O https://raw.githubusercontent.com/Stackdriver/stackdriver-agent-service-configs/master/etc/collectd.d/nginx.conf
4.Stackdriver Agent 재시작
< Debian 8 >
sudo service stackdriver-agent restart
< CentOS 7 >
sudo systemctl restart stackdriver-agent
5.Monitoring 확인
Monitoring -> Resources -> Instances
각 서버를 클릭해보자. stackdriver agent가 plugin이 정상으로 동작하여 정보를 제대로 가져온다면 Monitoring의 오른쪽 그래프 윗부분에서 다음과 같은 화면을 볼 수 있다.
[ 출처: Flickr, gongjak1 ]
6.현재 모니터링 가능한 항목
- Active Connections (count): The number of active connections currently attached to Nginx.
- Reading Connections (count): The number of reading connections currently attached to Nginx.
- Writing Connections (count): The number of writing connections currently attached to Nginx.
- Waiting Connections (count): The number of waiting connections currently attached to Nginx.
- Requests (count/s): The number of requests per second Nginx is servicing.