Processing added and removed ports in agent