This method is making things more confusing than clearer..
If the Status entry is for a 'EclAgent', queuename is filled with name then examined below.... use of 'queuename' here is misleading and confusing. It would be clearer if the test of @name = "EclAgent" was explicit here and avoid fake filling queuename..