MC2: a tool to remotely monitor computer resources

For more than a year now, EASYTEAM and Cinchéo have been working on a project that aims at creating new methods and tools to help IT departments to control the carbon footprint linked to digital services. It is a vast and complicated topic and a lot needs to be achieved. With MC2 (say M-C-square), we are contributing a small and modest part to the tooling ecosystem.

In this post, I will explain the principles of MC2 and how it works. The source code is fully available on Github: https://github.com/cincheo/mc2.

NOTE: MC2 it is still work in progress and is a small part of a wider R&D project involving EASYTEAM (Constellation group) and INRIA (Spirals team).

The MC2 architecture

MC2 architecture
MC2 architecture

MC2 is a 3-tiers application composed of:

  • A probe, which is a Java program that can run commands on the monitored computer using the CLI. The current implementation uses the top command, but the idea is that any other command could be used, for instance the powermetrics command (assuming it is available and that the program is installed with the according access levels). The probe starts an HTTP server (on 8091 by default) and a Web Socket to communicate with the client.
  • A front-end client, running in a Web browser. It is developed with the DLite low-code platform (https://ui.dlite.io), which is currently being developed by Cinchéo.
  • A server part that will store the data.

The idea behind this design is that it is flexible and easy to extend. At this point, it is not as light as is should be, but the dependencies will be better managed in the future with lighter implementations. Adding support for a new CLI tool is straightforward and requires a little bit of regexp tuning to extract the interesting data. Also the probe is implemented using the DLite server framework (https://github.com/cincheo/dlite), which is made to be customizable and extensible.

The MC2 UI

The UI is shown hereafter. It runs on the DLite.io Low-Code platform, which means that it is only a small application descriptor written in JSON (see the code here). It is working on any modern web browser and is responsive (so you should be able to monitor your computers from your smartphone if you are paranoid ;)). It is also editable so that anyone can tune the style and even the behavior of the application.

The MC2 UI

The data server is also implemented with DLite and shares a common data model with the probe. At this point, the implementation is still work in progress.

Getting started

MC2 is not production-ready and is still under development. If you want to contribute, a simple way is to support Cinchéo by staring the Github repository and to send some feedbacks, ideas, …

If you want to try it out, note that the probe has been successfully tested under MacOS. It should work with Linux, since it comes with the same top command. However, it will probably require some adjustments/tuning for Windows since the top command may provide different output. To run, follow the Github indications (https://github.com/cincheo/mc2). You can also check the video if you like videos (although I do not recommend it because of bad carbon footprint).

Conclusion

In order to design sustainable and responsible digital services, the software industry needs to change the way it builds software. By coupling MC2 with other tools, such as PowerAPI (INRIA), CI/CD and automatisation tools, logging tools (such as Graylog), we shall be able to evaluate better the impacts of software in terms of resources and energy.

Ultimately, we aim at building usable models and methods to help every IT department to understand and control the environmental impacts of its software and hardware assets.

The road is long and tough, and MC2 is only a small step forward. We hope that many others will go the same way.