I need to run this sh script and xentop in Debian1 appvm, why is xentop not running in appvm?

It appears I installed everything i need to in order to install/run xentop in my Debian1 appvm, but when i try to run xentop, it says “command not found”

Please help,

here is the xentop script that converts the kb RAM meter to Gigabytes.

#!/bin/bash

Function to convert kilobytes to gigabytes

convert_to_gb() {
echo “scale=2; $1 / 1024 / 1024” | bc
}

Run xentop in batch mode, updating every 2 seconds

while true; do
clear
# Extract memory line, convert values to GB, and format the output
xentop -b -d 2 | grep -i ‘Mem:’ | awk ‘{print “Total: " $2/1024/1024 " GB\tUsed: " $3/1024/1024 " GB\tFree: " $4/1024/1024 " GB”}’
done

You have to run xentop in dom0.
And the convert_to_gb() function is redundant, because you divide twice by 1024 in awk (for each parameter printed), never calling the function.

1 Like

Thank you, the reason why i’m trying to run xentop in Debian1 appvm is because I am experimenting with the above script, trial and error ,and I need to be able to copy and paste back and forth from my terminal to my browser and to my A.I./chatgpt, and I cant do that with dom0. If I could copy/paste from an appvm to dom0, that would solve the problem, but theres not way to.