ike-dai / zaws

Zabbix AWS monitoring template
49 stars 27 forks source link

How to configure discovery to add instance's interface IP per host instead of 127.0.0.1? #2

Closed valery-zhurbenko closed 7 years ago

valery-zhurbenko commented 7 years ago

for now all aws EC2 hosts added, but each instance in zabbix have interface IP 127.0.0.1. This is greyed and not editable because added by discovery rule from template. My EC2 instances have hostname that is "APPNAME_INSTANCEID", like "web1i-01013167c8f712345". So I changed "host prototype" in rule to: {#INSTANCE.NAME}{#INSTANCE.ID}

Now all added, but problem to allow agents to be accepted, probably because this registered in zabbix host names have different interface IP (127.0.0.1) then real host IP. Same issue if host added by agent - discovery rule can do nothing because this name exists....

The goal is to manage instance lifecycle (adding and removing) and AWS resources with zaws discovery, but be able to monitor with installed there agent.

How to define discovery to add real instance IP instead of 127.0.0.1?

Thanks!

ike-dai commented 7 years ago

This is becouse of Zabbix specification. By this specification, each interfaces are set the parent host interface information automatically. If you want to monitor Zabbix Agent type data, please change the item type to "Zabbix Agent(Active)". By this way, Zabbix Server doesn't need to know each Agent interface information. At this type, the following point is important.

Please check it.

If you want to set interface info absolutely, please consider the other tool.

Zabbix AWS monitoring templates: https://github.com/tech-sketch/zabbix_aws_template

This template includes auto registration hosts scripts for AWS auto scaling. This script doesn't use Zabbix low-level-discovery func, but it use Zabbix API. So, it regist to host interface public or private IP of EC2 instance.