Process stats from ElasticSearch matched by IP
In some scenarios ElasticSearch returns its IP address as 'host' value. This was filtered out when looking for matching hostname. This commit adds IP address to allowed 'hostnames' Change-Id: I3fd1adf291c2eead0c8c601140a5e4b1487ba9a4
This commit is contained in:
parent
1544d4cb49
commit
7f7588d10f
|
@ -253,7 +253,8 @@ class ElasticSearch(AgentCheck):
|
|||
hostnames = (
|
||||
self.hostname.decode('utf-8'),
|
||||
socket.gethostname().decode('utf-8'),
|
||||
socket.getfqdn().decode('utf-8')
|
||||
socket.getfqdn().decode('utf-8'),
|
||||
socket.gethostbyname(socket.gethostname()).decode('utf-8')
|
||||
)
|
||||
if node_hostname.decode('utf-8') in hostnames:
|
||||
for metric in self.METRICS:
|
||||
|
|
Loading…
Reference in New Issue