A method for controlling a temperature of a server of a server infrastructure, comprising: sending, at a first rate, temperature measurement requests, from a polling node (510, 515) to a first server, at each of successive first polling periods; receiving temperature measurements from the first server in response to the temperature measurement requests; storing, in a database (520, 310), the temperature measurements received from the first server in response to the temperature measurement requests; constructing a first prediction model forecasting future values of temperature for the first server by a machine learning system, by: fetching temperature measurements from the database (520, 310), at a second rate lower than the first rate, and using the fetched temperature measurements as ground truth information for training the machine learning system; defining a normal variation from the first prediction model for the first server; receiving, at a second polling period subsequent to the first polling periods, a new temperature measurement from the first server; and if a difference between the new temperature measurement and a temperature value for the first server forecasted by the first prediction model for the second polling period is more than the normal variation from the first prediction model for the first server: taking a corrective action applied to the first server, comprising increasing a heat transfer rate of a cooling system for the first server, reducing a processing speed of the first server, reducing a processing power of the first server, reducing a traffic load directed to the first server, or transferring a virtual machine from the first server to another server of the server infrastructure, or a combination thereof, and if a difference between the new temperature measurement and the temperature value for the first server forecasted by the first prediction model for the second polling period is more than a predetermined safety margin: taking the corrective action applied to the first server when the new temperature measurement exceeds a predetermined fixed threshold; and storing the received new temperature measurement in the database (520, 310), and updating the first prediction model by further training the machine learning system with temperature measurements from the database (520, 310) fetched at the second rate. sending, at a first rate, temperature measurement requests, from a polling node (510, 515) to a first server, at each of successive first polling periods; receiving temperature measurements from the first server in response to the temperature measurement requests; storing, in a database (520, 310), the temperature measurements received from the first server in response to the temperature measurement requests; constructing a first prediction model forecasting future values of temperature for the first server by a machine learning system, by: fetching temperature measurements from the database (520, 310), at a second rate lower than the first rate, and using the fetched temperature measurements as ground truth information for training the machine learning system; defining a normal variation from the first prediction model for the first server; receiving, at a second polling period subsequent to the first polling periods, a new temperature measurement from the first server; and if a difference between the new temperature measurement and a temperature value for the first server forecasted by the first prediction model for the second polling period is more than the normal variation from the first prediction model for the first server: taking a corrective action applied to the first server, comprising increasing a heat transfer rate of a cooling system for the first server, reducing a processing speed of the first server, reducing a processing power of the first server, reducing a traffic load directed to the first server, or transferring a virtual machine from the first server to another server of the server infrastructure, or a combination thereof, and if a difference between the new temperature measurement and the temperature value for the first server forecasted by the first prediction model for the second polling period is more than a predetermined safety margin: taking the corrective action applied to the first server when the new temperature measurement exceeds a predetermined fixed threshold; and storing the received new temperature measurement in the database (520, 310), and updating the first prediction model by further training the machine learning system with temperature measurements from the database (520, 310) fetched at the second rate.