Skip to content

Repository files navigation

Linux Usage Monitor

A python script that monitors the temperature (if on Pi), RAM usage, and CPU usage of a linux system and sends it through a Discord webhook every minute.
If you're concerned about bandwidth, the script takes up 1.728 MB a month on average.
it work

Installation

THIS WILL ONLY WORK ON RASPBERRY PI.

wget https://raw.githubusercontent.com/SoulWithMae/Linux-Usage-Monitor/main/install.sh && bash install.sh

It will install any dependencies for you if you do not already have them, do not worry about installing them.
If the OS you installed onto your Pi has a graphic desktop, you can download it directly from the releases.
Or, you can install it manually with the instructions below.

Manual Installation

NOTE: I HAVE ONLY TESTED THIS IN UBUNTU, NO IDEA IF IT WORKS IN ANY OTHER LINUX DISTROS.
psutil MUST be installed for this to work.
Install it with "pip install psutil"
If you don't have pip, install python3-pip with "apt install python3-pip"

Run wget https://raw.githubusercontent.com/SoulWithMae/Linux-Usage-Monitor/main/usagemonitor.py
Run wget https://raw.githubusercontent.com/SoulWithMae/Linux-Usage-Monitor/main/usagemonitor.conf
Run nano usagemonitor.conf
Change YOUR_WEBHOOK_URL to the URL of your discord webhook.
Change the time to whatever you want it to be in seconds, or leave it.
Change "yes/anything_else" to "yes" if you're installing it on a Pi, or literally anything if it's not on a pi.
IT MUST BE LOWERCASE.
Run mv usagemonitor.py /opt/
Run mv usagemonitor.conf /opt/
Run the file with "python3 /opt/usagemonitor.py" to make sure it works
Use systemctl, supervisor, nohup, or any other service daemon to run the file in the background
An example service file for systemctl is in the source code.

Configuration

If you want to change the webhook URL or the time between each message after install, just edit the usagemonitor.conf file
It is located in /opt/ usually, unless you changed the directories in the scripts.

Uninstallation

Run systemctl stop usagemonitor && rm /opt/usagemonitor.* && rm /etc/systemd/system/usagemonitor.service

Windows?

With some modification to the script, it can work on windows.
It all has to be manually installed, the automatic install was written for Linux and won't work on Windows.
Change the config directory in the script to be "./usagemonitor.conf" instead of /opt/usagemonitor.conf".
The config file will be regular, the Pi value CANNOT be "yes", put it as anything but yes.
I do not know any programs that run python scripts in the background on Windows, you will have to figure that out yourself.
If something breaks, this script was written with Linux in mind and not Windows, so expect that.

About

A python script that monitors the temperature (if on Pi), RAM usage, and CPU usage of a linux system and sends it through a Discord webhook every minute.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Contributors

Languages