Fix problem when have 2 same ip in XML of agent. Thanks to Vadim Pisarev for the patch. closes #2344