I. Introduction
In this day and age, various services such as e-government, e-mail, e-shopping and e-news that serve directly to the users are provided via web-based technologies. In addition, cyber-physical systems are in use everywhere in a very wide range of technologies such as autonomous vehicles, smart grid, smart buildings, smart agriculture systems, medical devices etc. Reliability and accessibility for these types of services are critical [1]. Those properties are enhanced via deployment of monitoring systems that are used to detect unusual events in time to avoid system and security failures. In monitoring, metrics produced by the systems are evaluated according to certain criteria known as monitoring rules. Experts define such rules and the cost of the mistakes done in this step can be very high. In this work, the system monitoring rules are expressed in a formal language, and the rule maximizing the success of the monitoring system is automatically generated.