def agent_deployed?(hostname)
    hist = History.find_by(host: hostname, node_type: "agent")
    if enabled?
      return false if hist.nil? or hist.deployed_at.nil?
      hist.deployed_at >= self.agent_updated_at if self.agent_updated_at