API Call - Get VM info

API

New Member
Dec 4, 2013
9
1
1
Is there an API call to get the load, RAM usage, bandwidth usage, et cetera for a KVM VPS? Either in a list for the node or on an individual VM basis. Either will work.
 
  • Like
Reactions: b1tcl0ud
Overview of all resources in the cluster:

# pvesh get /cluster/resources

Status for all KVM VMs on a specific node:

# pvesh get /nodes/<NODENAME>/qemu

or a single VM:

# pvesh get /nodes/<NODENAME>/qemu/<VMID>/status/current
 
Overview of all resources in the cluster:

# pvesh get /cluster/resources

Status for all KVM VMs on a specific node:

# pvesh get /nodes/<NODENAME>/qemu

or a single VM:

# pvesh get /nodes/<NODENAME>/qemu/<VMID>/status/current

Would the nodes/<NODENAME>/qemu return an array of whatever /nodes/<NODENAME>/qemu/<VMID>/status/current would return? Also, do you by any chance have a sample return for /nodes/<NODENAME>/qemu/<VMID>/status/current? I'm going to be using the JSON API, but I won't have an opportunity to start for a few more weeks and anything to familiarize myself now. :)
 
Would the nodes/<NODENAME>/qemu return an array of whatever /nodes/<NODENAME>/qemu/<VMID>/status/current would return?

Why don't you simply run above pvesh commands?- that way you can see what it returns.
 
is there any way to get AVG data of given period in text format for CPU usage, Memory usage, and network bandwidth details like monthly reports
 
you could use the /nodes/{node}/rrddata or /nodes/{node}/qemu/{vmid}/rrddata api calls for that i guess, but it only shows the last day|month|year etc. no historic data
for that i would setup an external metric server, see https://pve.proxmox.com/wiki/External_Metric_Server
 
hi everyone, im also looking for a JSON API that returns the status of the CPU, RAM, Memory and Disk. After these 2 years, was it created?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!