Proxmox VE API queries

mikspik001

New Member
Oct 27, 2023
4
0
1
Hi All, im trying to build a client API to interact with Proxmox VE API... looking for endpoints with following guest VM data:
a) virtual serial port and serial console status
b) active/logged in users
c) running tasks status

... currently using Proxmox VE API doc as reference but so far can't seem to find above items... any pointers would be much appreciated, thank you!
 
logged in users and running tasks status can only be provided from within the VM. You would need a kind of monitoring agent. Modern monitoring systems can do this.
I do not think that this is a task for the Proxmox VE API.
Could you help me to provide a full documents of the API usage with the version of PVE being 8.0.2 instead of using pytest to brute more api path, I want to make some idea, but I hardly to find a various documents. Looking fotward to your reply.
 
logged in users and running tasks status can only be provided from within the VM. You would need a kind of monitoring agent. Modern monitoring systems can do this.
I do not think that this is a task for the Proxmox VE API.
Thanks so much for the follow up... since these are critical for the end goal, would like to confirm once more if below functionality can not be currently achieved via Proxmox VE API endpoints:
- Execute and monitor automation scripts running on guest VM
- Check virtual serial port is present and serial console is working.
- Check users logged in (access from RDP-like application - Guacamole)

Thanks again!
 
Last edited:
The Proxmox API does not provide information from within the VM.

There is an API endpoint to start processes via qemu-guest-agent and get the output:
https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/qemu/{vmid}/agent/exec
https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/qemu/{vmid}/agent/exec-status

I.e. you can build something yourself.
Thanks so much again for your help!

I tried installing qemu-guest-agent on VM, but cannot "enable" the agent after its install... followed this guide: https://pve.proxmox.com/wiki/Qemu-guest-agent for Ubuntu... please see attached screenshots with issues.... form "/agent/exec {command}" POST request im getting back: {'data': None}

I guess at this point i can continue looking into given errors
(or)
as you suggested, build something myself
...not sure if you meant this, to build an ssh agent on guest vm? i was thinking something like that but got stuck could not figure out how to basic ssh into guest VM from a remote machine on same VPN... just to note, ultimately client app must be able to access guest VM ssh agent over HTTP via external REST API call, and provide core functionality i mentioned above. I started looking at creating a REST API service on guest VM.... wondering if im thinking in the right direction based on end goal?? if possible please explain a bit more about what you tried to suggest above.

Thank you!
 

Attachments

  • qemu_agent_error.png
    qemu_agent_error.png
    201.1 KB · Views: 13
Just fyi, got the guest agent running... what i did was 1) enabled it from the PVE UI 2) rebooted the VM.. pls see screenshots attached.... now for example POST request on ../agent/info endpoint is returning data... yet to try understand ../agent/execute {command} endpoint, like execute a command script, etc... still interested in your feedback on my previous post if you get a chance... thank you!
 

Attachments

  • agent_enabled.png
    agent_enabled.png
    186 KB · Views: 15
  • agent_enabled2.png
    agent_enabled2.png
    77.6 KB · Views: 15
Last edited:

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!