Structural Health Monitoring of historical buildings: preventive and post-earthquake controls