apt-get install lm-sensors
This package contains the sensors tool, which if ran will output voltages and temperatures for your CPU, graphics card, and so on.
Next, we will make a simple script which will trigger sensors every five seconds, so you will be able to monitor your system in different load times:
#!/bin/bash
i=0
while [[ 1 -eq 1 ]]; do
clear
echo "Running sensors..."
echo -e "Elapsed time: $i seconds\n"
sensors
echo "Use ^C (CTRL+C) to stop"
sleep 5
i=$(( $i + 5 ))
done
This script will run the sensors utility every five seconds. You can save it under a suggestive name,
say cputemp.sh, make it executable (chmod 755 cputemp.sh) and put it in a directory in your path
(e.g. ~/bin/, where ~ is your home directory).
Tidak ada komentar:
Posting Komentar