Create system-stats-xen

A ressource monitor which can be run in dom0 and uses low system ressources
This commit is contained in:
[799] 2018-06-24 15:49:41 +02:00 committed by GitHub
parent fe4db19f32
commit a002fca75b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 27 additions and 0 deletions

View 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