refactor method get_ip + check ip is nil + change getIp for hostname, user and network