check if osm agent is configured before deleting