Find agent by hostName or Ip from master
refactor dew.common for application