Implement support for hosts in the agent component.

Refs #4865