Hosts/VM resources via PHP API

x86

New Member
Aug 19, 2014
21
0
1
Hello,

Here is another question about fetching resources information about a host (node) or VM via the PHP API.
i.e. when using the API call '/nodes/NODE1/status' you'll get the data back. Except the CPU and I/O delay are a bit different.
They'll return as:
array(12) {
["cpu"]=>
float(0.1659904843661)

But actually the CPU usage is different on the web gui. Any ideas?
Thanks.
 
We use the following JS code to render the cpu value:

Code:
    var render_cpu = function(value) {
        var per = value * 100;
        return per.toFixed(2) + "%";
    };
 

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!