Open Source

[ Zabbix ] Nginx Monitoring

Pydole 2022. 10. 21. 10:05

 

Nginx를 웹 서비스로 선택하고, 모니터링을 해야하는데 Zabbix agent 템플릿이 있어 구축하였다.

 

주요 성능 지표는 아래 공식사이트를 참고하면 된다.

 

Zabbix Agent는 이미 설치되었고, Nginx 설정만 포스팅 한다.

 

 

 

https://www.zabbix.com/integrations/nginx

 

Nginx monitoring and integration with Zabbix

This template is for Zabbix version: 6.2 Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/nginx_agent?at=release/6.2 Nginx by Zabbix agent Overview For Zabbix version: 6.2 and higher. This template is developed to monitor Nginx

www.zabbix.com

 


 

1. nginx.conf 파일 location 위치에 아래와 같이 추가하여 준다.

 

location = /basic_status {
stub_status;
allow 127.0.0.1;
deny all;
}

 

 

 

2. nginx 서비스 재기동 ( nginx - t 를 이용하여 문법 체크하여 정상인지 확인 )

 

 

 

 

3. Nginx가 탑재되어 있는 Host 설정의 Macros 탭에 아래와 같이 추가하여 준다.

    상세설명은 위의 공식 사이트 "Macros used"를 참고하면 된다. ( 설정값을 복붙 )

 

 

 

/basic_status HTTP/1.1" 200   Nignx 엑세스로그가 확인되면 정상적으로 연동

 

 

 

 

4. Nginx Item DashBoard

 

nginx zabbix dashboard

 

 

 


마치며, 기본적인 Nginx 모니터링을 하는 데 유용하다. 각 item 성능 지표에 대해 Trigger를 사용하고, 알림에 연동하면 좀 더 액티브하게 사용가능하다.