System level optimization of preventive maintenance in industrial automation systems