lukecyca/pyzabbix

Fix Host Ips

Closed this issue · 1 comments

Hi,

When I run the command, on hosts with long dns name, I get the following error:

root@test01:/etc/zabbix/externalscripts# ./fix_host_ips.py
Warning: test02 has dns "test-01-internal-e-srvc-te.as-e1.eu1.cloudhub.io"
Traceback (most recent call last):
File "./fix_host_ips.py", line 49, in <module>
lookup = socket.gethostbyaddr(h['dns'])
socket.herror: [Errno 1] Unknown host
root@test01:/etc/zabbix/externalscripts#

Can you help me?

szuro commented

Hi,

are you sure this address exists?

> ping test-01-internal-e-srvc-te.as-e1.eu1.cloudhub.io
Ping request could not find host test-01-internal-e-srvc-te.as-e1.eu1.cloudhub.io. Please check the name and try again.

Is it resolvable from the system you're running the script on?