Skip to content

API and weblclient for monitoring system temperatures over the network

License

Notifications You must be signed in to change notification settings

JavierOramas/temperatureMonitor

Repository files navigation

contributions welcome Hits

Simple scritp to monitor cpu and hdd temperatures
Currently does not have support for multi CPU systems
outputs the info to temps.json

Installation

pip install -r requirements.txt (if needed use pip3)
install package hddtemp:
Arch Linux
sudo pacman -S hddtemp
Ubuntu/Debian
sudo apt-get install hddtemp

add the following line to the sudoers file (sudo visudo) {USER} ALL= NOPASSWD: /usr/bin/hddtemp

How to run it

crontab -e
10 * * * * python /path_to_folder/script.py
(change crontab setting to modify run frequency)

Deploy to a Server

to deploy to a server you have to run: sudo python3 setup.py [ api|webui ] sudo systemctl daemon-reload

sudo systemctl enable temp_monitor_api or sudo systemctl enable temp_monitor_web

sudo systemctl start temp_monitor_api or sudo systemctl start temp_monitor_web

this will make the services start with the system

Web Interface

set the following command to run at startup and set the port of your preference
streamlit run /path_to_folder/webui.py --server.port {port}

For Cleaning the Data

In order to avoid excess of info, you can run the clean.py script to leave only the last X elements (default:100)
python3 clean.py X

API

set the following command to run at startup, set the port inside
streamlit run /path_to_folder/webui.py --server.port {port}

Inside the code

fetching the data

to get the data manually you have to run:
python script.py <option>

get_temperatures

this command gets the temperature from the cpu and hdd's and dumps it to data/temps.json

get_cpu_usage (alpha)

this command gets the cpu usage percent and dumps it to /data/cpu_usage.json

get_memory_usage (alpha)

this command gets the memory usage percent and actual memory usage ammount and dumps it to /data/memory_usage.json

About

API and weblclient for monitoring system temperatures over the network

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published