HTTP Log monitoring system

Subject

Project structure

The project is designed as follows:

Each process is running in a different thread to enable reading the same log file, displaying the stats and the alert messages, and checking if an alert message should be raised. So the program is composed of three threads: the reader, the displayer and the alert system, and a extra optional thread with the log simulator. The advantage of this structure is that each element is independent from the others. If we want to change our reader, it will be easy. Moreover, we can add many readers to put the lines in the same queue. We can apply the same logic to the displayer and the alert system.

How to use it ?

This program is using Python 3.5. First, you will need to install the required packages, by running the Makefile.

Using the simulation

In order to see the algorithm works, you just need to go in the project folder, and launch the short_simulation file. This sample is running during 3 minutes with a Reader, a Displayer, an AlertSystem and a LogSimulator. During two minutes, the LogSimulator is running to enable the raising of an alert by putting a lower threshold than the real number of requests per second. Then, for the last minute, we just stop the LogSimulator to enable the number of requests per second to drop below the threshold and to display an alert recovery message.

Using on your own system

To perform the monitoring of your own system, you will have to use the main file. But you can customize the system with the config.ini file. You can change

And then, after choosing your own parameters, you just need to launch the main file. The main file will start the thread.

Improvements

I think the system can be improved with several things I didn’t have time to make