Procespy: Process Monitoring tool in Rust

Reading Time: 3 minutes

Procespy is a process Monitoring tool for Linux distributions, it helps the user to keep track of the running services in the system with their memory utilisation.
This tool will allow the user to set the threshold for a particular service in respect of memory utilisation. If any service will cross its threshold value then the process will terminate by providing a popup with a message that particular process is terminated and also sends an email to the user for providing the status of that service.

Architecture:

Fig 1: Architecture of Procespy.

As we see Procespy is a process monitoring tool that can help the users to keep track of the running services in the system with their memory utilisation. So initially this tool will fetch the given configuration from the config file in which the threshold limit of the processes and the email id of the user is present. Then Procespy will keep monitoring all the processes as per our given configuration. If any process can cross its threshold limit then the tool will terminate that process by displaying the popup on the screen with a respective message. It will also send an email to the user by specifying the process status. So, this is the overall goal of Procespy.

Why Rust?

This image has an empty alt attribute; its file name is 483-rust-lang-the-rust-programming-language.png

As we all know Rust Programming Language is blazingly fast and it has some powerful features like Memory Safety and Safe Concurrency. So we decided to put Rust into the picture. Because as per our project’s behavior which is continuously monitoring of memory utilisation, termination of processes, sending emails to admin and many more. So, we need a fast and secure programming language and Rust perfectly fitted with our requirements. And Rust provides a binary that directly runs of bare metal. It is very useful for us if we are going to deploy our tool in a server.

Key features of Procespy:

  • Monitor memory utilised by each service.
  • Allow users to set the threshold limit for a particular service.
  • Terminate the process if any processes exceed its threshold limit.
  • Send notification to the user.

Monitor the memory utilised by each service:

The tool will continuously monitor the memory utilised by the processes by checking its memory usage and the threshold value of that process.

Allow user to set the threshold limit for particular service:

In this feature we allow the user to set the threshold limit for service in respect of memory consumption. Here we will update the user if any service will cross its threshold limit.

Terminate the process if any processes exceed its threshold limit:

In this feature, if the process can crosse its threshold limit then the tool will terminate the process and notify the user.

Send notification to the user:

In this feature, our tool will notify the user if any service crosses its threshold limit by giving a popup on the screen and by sending the email.

Thanks for reading this blog!!!

For more reference and contributing to our open source project Procespy, you can visit here.

This image has an empty alt attribute; its file name is footer-2.jpg

Written by 

Pankaj Chaudhary is a Software Consultant at Knoldus LLP. He has 1.5+ years of experience with good knowledge of Rust, Python, Java, and C. Now he is working as Rust developer and also works on machine learning and data analysis because he loves to play with data and extract some useful information from it. His hobbies are bike riding and explore new places.