[zabbix] Auto registration

Logan. K.
Logan. K.
Jan 18, 2017 · 3 min read

AWS에서 서비스 준비 중인데 Auto scaling시에 서버 모니터링을 위해서 zabbix auto registration 설정을 했습니다.

AWS에 환경 구성을 하였고 zabbix는 3.x 버전입니다.

— — — — — — — — — — — — — — — — — — — — — — —

zabbix-agent(이하 agent라 칭함)설정 부분입니다.

  1. agent를 Active 모드로 실행해야 합니다.
  2. HostMetadata설정- auto registration시에 사용할 meta data라 보시면 됩니다.

ansible로 관리를 하는데 env는 web이라 보시면 되겠습니다. 즉, web-autoscaling입니다.

#zabbix_agentd.conf#Server={{ zabbix_server_ip }}
StartAgents=0
ServerActive={{ zabbix_server_ip }}

#Hostname= <-- 주석처리
HostnameItem=system.hostname
HostMetadata={{ env }}-autoscaling

— — — — — — — — — — — — — — — — — — — — — — —

zabbix-server(이하 server라 칭함) 설정 부분입니다.

Configuration -> Actions -> Event Source[Auto registration] -> Create action클릭합니다.

“Action” Tab:

  • Name에는 구분할 수 있는 원하시는 값 넣으시면 됩니다.

“Conditions” Tab

  • Host metadata는 zabbix_agentd.conf에 HostMetadata에 설정한 값 넣어주시면 됩니다. 이 값을 비교해서 match될 경우 Operations에 설정한 동작을 합니다.

“Operations” Tab

  • Send message: auto-registration이 되면 telegram으로 메시지를 전송하도록 설정하였습니다.
  • Add Host: 해당 host를 server가 모니터링 할 수 있도록 추가합니다.
  • Add to host group: 특정 group에 추가되도록 설정
  • Link to template: 관련 있는 template을 Link해줍니다.

이렇게 설정하고 몇 초(?) 지나면 자동으로 host가 등록 되는 것을 확인 할 수 있습니다.

Written by

Logan. K.

일찍 일어나라 그리고 열심히 일해라. 성공을 위한 법칙은 이것 뿐이다. B형. 얼리버드. 개발자. DevOoops.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade