PBS API

konradwo

New Member
Feb 15, 2024
7
2
3
Is it possible for
GET /api2/json/tape/backup
last-run-state
to always have a value?

Currently, during backup API it does not return key last-run-state at all.
It would be useful (for monitoring purposes) to add states IN PROGRESS, NEVER RUN, UNKNOWN, etc.
 
the 'last-run-state' is the state for the last run, so if there was no run yet -> empty, and if there is currently a run, then it's still empty but 'last-run-upid' is set

is there any state missing that can't be seen with the above information?
 
the 'last-run-state' is the state for the last run, so if there was no run yet -> empty, and if there is currently a run, then it's still empty but 'last-run-upid' is set

is there any state missing that can't be seen with the above information?
key 'last-run-state' not exist in returned json during the backup,
last-run-upid is set always during backup job lifecycle (unless before first run)

this is example of returned json during the pending tape backup job:

{
"pool": "XX",
"next_media_label": "TYYYYYL8",
"ns": "XX",
"schedule": "06:00",
"last_run_upid": "UPID:SRVNAME:000003AE:000002C5:0000024B:66B04E40:tape_backup_job:DATASTORE\\x3aXX\\x3aDRIVE1\\x3aPOOL_NAME:root@pam:",
"notification_mode": "notification_system",
"eject_media": true,
"id": "POOL_NAME",
"next_run": 1722916800,
"drive": "DRIVE1",
"store": "DATASTORE"
}

there is no information about last state and pending backup

it's hard to monitor information that isn't there.

My goal is to get Zabbix to monitor the copies made to tape.

The problem is that during the copy, the key disappears and no other appears that could indicate the state of the copy :(

Backup Server 3.2-3 - Enterprise Repository
 
Last edited:
i don't know how to configure zabbix exactly, but the state should be as follows:

no 'last-run-state' and no 'last-run-upid' => it never ran
no 'last-run-state' and a 'last-run-upid' => it's currently running
'last-run-state' (regardless of upid or not) => it ran in the past with that result

if it's absolutely not possible to integrate somethin that is able to handle that, you can ofc open a feature request here: https://bugzilla.proxmox.com but no promises if we implement such a thing (but it's probably not a bad idea)
 
i don't know how to configure zabbix exactly, but the state should be as follows:

no 'last-run-state' and no 'last-run-upid' => it never ran
no 'last-run-state' and a 'last-run-upid' => it's currently running
'last-run-state' (regardless of upid or not) => it ran in the past with that result

if it's absolutely not possible to integrate somethin that is able to handle that, you can ofc open a feature request here: https://bugzilla.proxmox.com but no promises if we implement such a thing (but it's probably not a bad idea)
Thank You for reply.

The problem is that 'last-run-state' non exist in returned json during the backup, 'last-run-endtime' alsow not existst in json during tape backup job.

Some solution would be to return these keys with an empty value.

If they are not there, then when analyzing the returned json I will get an error that the key I am looking for does not exist.

Thanks again for your reply and I'm filing a bugzilla report
 

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!