mirror of
https://github.com/Qubes-Community/Contents.git
synced 2024-10-01 01:05:51 -04:00
Create system-stats-xen
A ressource monitor which can be run in dom0 and uses low system ressources
This commit is contained in:
parent
fe4db19f32
commit
a002fca75b
27
code/monitoring/system-stats-xen
Normal file
27
code/monitoring/system-stats-xen
Normal file
@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
# Author: tasket
|
||||
# Github: https://github.com/tasket/
|
||||
# Usage : A ressource monitor which can be run in dom0 and uses low system ressources (compared to Qubes Manager)
|
||||
#
|
||||
# Link to the repository of the initial author (tasket):
|
||||
# https://github.com/tasket/Qubes-scripts/blob/master/system-stats-xen
|
||||
|
||||
delay=5
|
||||
sensor_lines='Package id 0|fan1'
|
||||
|
||||
lnparse () {
|
||||
if [ "$2" = 'CPU(%)' ]; then
|
||||
clear
|
||||
sensors |grep -E "^($sensor_lines)"
|
||||
echo -e "\nVM NAME CPU(% ) MEMORY(MB)"
|
||||
else
|
||||
echo "$ln"
|
||||
fi
|
||||
}
|
||||
|
||||
clear
|
||||
stdbuf -oL xentop -b -f -d $delay \
|
||||
| stdbuf -oL awk '{sub(/\.[0-9]/, " ")} {printf ("%-20s %5s %7\047d\n", $1,$4,$5/1000) }' \
|
||||
| while read ln; do
|
||||
lnparse $ln
|
||||
done
|
Loading…
Reference in New Issue
Block a user