The year 2017 was a year in which El Niño phenomenon was the cause of a situation of great tension in departments such as Piura, Lambayeque, La Libertad, and Lima, leaving more than 1.7 million people affected [1]. This event represents the starting point for the execution of an adequate system of prevention and evacuation, which leads to a rehabilitation stage characterized by the minimization of the response time of humanitarian aid, and the reduction of the impact on the population. This investigation proposes a methodology, focused on the case of the overflow of the Piura river, which seeks to achieve this minimization by locating sensors that measure in real time the flow and level of flow in streams and rivers. Its use represents the beginning of a prevention system to operate as part of a management system of risk alert for the population when the river reaches a certain level, and that added to the flow with which the currents come, generate an estimated time in which the overflow will occur. In this way, it will proceed to an early evacuation of all the inhabitants, and the proper management of humanitarian aid to the places of refuge. A model that combines linear programming with statistical and mathematical concepts is proposed, with the objective of implementing a warning risk management, and an adequate evacuation that generates a greater number of people who receive the necessary help in a shorter time, thus achieving that this research be a replicable proposal before future El Niño events in Peru.