Hello,
I'm using a PBS(2.1-5) for more than year and I try to integrate it to my supervision(prometheus) via the blackbox exporter(http's probe).
To do this I have to interact with the API and here is the problem: the documentation is very poor about details.
Here is my script to try to interact with this API.
I don't know if "PBSAuthCookie" is the correct value.
In proxmox pve api's documentation they speak about PVEAuthCookie https://pve.proxmox.com/wiki/Proxmox_VE_API
So I change it to PBSAuthCookie but there is no precision about it in the PBS documentation.
I also try like this:
I got: authentication failed - no authentication credentials provided
Any idea?
I'm using a PBS(2.1-5) for more than year and I try to integrate it to my supervision(prometheus) via the blackbox exporter(http's probe).
To do this I have to interact with the API and here is the problem: the documentation is very poor about details.
Here is my script to try to interact with this API.
#!/bin/bash
source .credentials
FQDN="mon.pbs.fr"
curl --request POST --silent --insecure --data ${CREDENTIALS} \
https://${FQDN}:8007/api2/json/access/ticket \
| jq -r '.data.ticket' | sed 's/^/PBSAuthCookie=/' > cookie
curl --request get --insecure --cookie "$(<cookie)" https://${FQDN}:8007/api2/json | jq '.'
I don't know if "PBSAuthCookie" is the correct value.
In proxmox pve api's documentation they speak about PVEAuthCookie https://pve.proxmox.com/wiki/Proxmox_VE_API
So I change it to PBSAuthCookie but there is no precision about it in the PBS documentation.
I also try like this:
curl -v -s -k --cookie "PBSAuthCookie=$TICKET" -X GET https://${FQDN}:8007/api2/json
I got: authentication failed - no authentication credentials provided
Any idea?