Open alejdg opened 5 years ago
The file should be in /etc/telegraf/telegraf.d/extra_plugins.conf with the below contents:
Not really "extra_plugins.conf" as that will conflict with the telegraf charm. Instead, something like telegraf.d/zookeeper.conf or zookeeper-charm.conf.
The problem we're trying to solve is that for telegraph (via the charm), when you add inputs to monitor zookeeper, we're forced to use ":2181" as there is no way to pass through extra configs to have the telegraf charm fill in the local unit's IP address. By using ":2181", you connect to localhost which the zookeeper snap doesn't listen on.
To make zookeeper-telegraf plugin run without manual changes it would need the charm to create a config file with the same ip used in https://github.com/cloud-green/zookeeper-snap-charm/blob/master/charm/zookeeper/templates/zoo.cfg#L29 when a telegraf relation is added.
The file should be in /etc/telegraf/telegraf.d/extra_plugins.conf with the below contents: [[inputs.zookeeper]] servers = ["{{ client_bind_addr }}:2181"]
Another approach would be to make the snap to bind zookeeper to localhost or to all interfaces. That way the plugin's default configuration would work.
Once this is implemented the nagios check can be removed as there's a prometheus alert replacing it.