SHM for historical buildings: preventive and post-earthquake controls