Simple scritp to monitor cpu and hdd temperatures
Currently does not have support for multi CPU systems
outputs the info to temps.json
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
crontab -e
10 * * * * python /path_to_folder/script.py
(change crontab setting to modify run frequency)
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
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}
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
set the following command to run at startup, set the port inside
streamlit run /path_to_folder/webui.py --server.port {port}
to get the data manually you have to run:
python script.py <option>
this command gets the temperature from the cpu and hdd's and dumps it to data/temps.json
this command gets the cpu usage percent and dumps it to /data/cpu_usage.json
this command gets the memory usage percent and actual memory usage ammount and dumps it to /data/memory_usage.json