Monitor "capacity" tab using CLI (Command Line Interface)


I would like to get some way to monitor real CPU usage of each “running” VM, because some users leave their VMs doing “nothing” and resources are consumed.

I have seen in Sunstone that inside VM option, there are a “Capacity” tab that shows the real CPU usage.

Is there any way to get that information using CLI for, then, use that inside a bash script?


That information can be seen on the VM instance template, which you can see with onevm show <vm_id>.

For example

root@provisionengine-test-env:~# onevm show 1034 | grep 'VIRTUAL MACHINE MONITORING' -A 11
CPU                 : 1.01
MEMORY              : 124.5M
NETTX               : 0K
NETRX               : 0K
DISKRDBYTES         : 13854296
DISKRDIOPS          : 972
DISKWRBYTES         : 385024
DISKWRIOPS          : 151
ID                  : 1034
TIMESTAMP           : 1701176925


Yes, I knew that, and that value is updated “MONITOR_VM” seconds inside "PROBES_PERIOD (if I am not wrong…), but my question was if there was any way (not only run onevm show $vm_id | grep “CPU” to get real CPU usage.

Also, thanks for your response :wink:

In this case everything is gathered from the VM entry in the database and is presented as a graph on the Web GUI view and as a value in the CLI.

What other way would be useful/expected ?