Get current status without table of VM/LXC

Editor

Well-Known Member
Apr 26, 2017
108
1
58
Turkey
Hello,

Unable to retrieve data about the status of the machine, unfortunately no longer. The reason for this is that Proxmox version change.

Before:
Code:
root@prox:~# pvesh get /nodes/prox/lxc/101/status/current
running
root@prox:~#

So I could get data with PHP but with the new version it has changed.

After:
Code:
root@prox:~# pvesh get /nodes/prox/lxc/101/status/current
┌─────────┬─────────────────────┐
│ key     │ value               │
├─────────┼─────────────────────┤
│ cpus    │ 1                   │
├─────────┼─────────────────────┤
│ ha      │ {"managed":0}       │
├─────────┼─────────────────────┤
│ maxdisk │ 24.48 GiB           │
├─────────┼─────────────────────┤
│ maxmem  │ 1.00 GiB            │
├─────────┼─────────────────────┤
│ maxswap │ 512.00 MiB          │
├─────────┼─────────────────────┤
│ name    │ test-9.example.com │
├─────────┼─────────────────────┤
│ status  │ running             │
├─────────┼─────────────────────┤
│ uptime  │ 14m 24s             │
├─────────┼─────────────────────┤
│ vmid    │ 101                 │
└─────────┴─────────────────────┘
root@prox:~#

How will it be now? :)
 
For seeing just the status in the command line, this should work:

Code:
pvesh get /nodes/prox/lxc/101/status/current --noborder --noheader | grep status | cut -d ' ' -f 3
 
  • Like
Reactions: Editor

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!