PBS CLI show backup state

t89s

New Member
Jan 11, 2021
4
0
1
35
Hi everyone,

I am a heavy zabbix user, and I like monitoring everything in an infrastructure and how important backups are :)

I looked a bit at the pbs documentation without seeing if it was possible to recover the status of the backups in CLI.

Is there a way to get this information?

This could allow me to make a zabbix template for monitoring backups.

Thank you
 
What exactly do you mean by "status of the backups"?

You can get an overview of snapshots with proxmox-backup-client list and proxmox-backup-client snapshot list. On the server, you can also access running backup jobs: proxmox-backup-manager task list; proxmox-backup-manager task log. Keep in mind all of these options should support the --output-format json option as well, for automation.
 
  • Like
Reactions: flames
Thank you for your answer


What exactly do you mean by "status of the backups"?

On the dashboard you can see a summary of the jobs over 30 days. With the success and failed.

The idea would be to make a zabbix template with this info and be able to set it up over the last 24 hours for example.

So, if a job is failed, it would send an alert to zabbix

I just saw the file / var / log / proxmox-backup / task / archive

Code:
UPID:pbs1:0000042F:000008F5:0000003B:5FFD0149:backup:Backup\x3act-114:Backup_user@pbs: 5FFD0447 OK
UPID:pbs1:0000042F:000008F5:0000003C:5FFD0449:backup:Backup\x3act-115:Backup_user@pbs: 5FFD093F OK
UPID:pbs1:0000042F:000008F5:0000003D:5FFD0940:backup:Backup\x3act-116:Backup_user@pbs: 5FFD0D49 OK
UPID:pbs1:0000042F:000008F5:0000003E:5FFD0D4A:backup:Backup\x3act-159:Backup_user@pbs: 5FFD103D OK
UPID:pbs1:0000042F:000008F5:00000040:5FFD10B0:verificationjob:Backup\x3av\x2d4c7255ba\x2dc996:root@pam: 5FFD10FE OK
UPID:pbs1:00003D5E:0097F389:00000000:5FFD12FC:aptupdate::root@pam: 5FFD12FE OK
UPID:pbs1:0000042F:000008F5:0000003F:5FFD103D:backup:Backup\x3act-160:Backup_user@pbs: 5FFD13E2 OK
UPID:pbs1:0000042F:000008F5:00000041:5FFD2CD0:verificationjob:Backup\x3av\x2d4c7255ba\x2dc996:root@pam: 5FFD2CE5 OK
UPID:pbs1:0000042F:000008F5:00000042:5FFD48F0:verificationjob:Backup\x3av\x2d4c7255ba\x2dc996:root@pam: 5FFD48F0 OK
UPID:pbs1:0000042F:000008F5:00000043:5FFD6510:verificationjob:Backup\x3av\x2d4c7255ba\x2dc996:root@pam: 5FFD6510 OK
UPID:pbs1:0000042F:000008F5:00000044:5FFD6DB1:backup:Backup\x3ahost-pve1:Backup_user@pbs!Backup_Agent: 5FFD6DBE connection error: Connection reset by peer (os error 104)
UPID:pbs1:0000042F:000008F5:00000045:5FFD6DF2:backup:Backup\x3ahost-pve1:Backup_user@pbs!Backup_Agent: 5FFD6DFF backup ended but finished flag is not set.
UPID:pbs1:0000042F:000008F5:00000046:5FFD6E56:backup:Backup\x3ahost-pve1:Backup_user@pbs!Backup_Agent: 5FFD6E62 backup ended but finished flag is not set.
UPID:pbs1:0000042F:000008F5:00000047:5FFD6E81:backup:Backup\x3ahost-pve1:Backup_user@pbs!Backup_Agent: 5FFD6E8D backup ended but finished flag is not set.


With grep we can show backup

Code:
UPID:pbs1:0000042F:000008F5:0000002E:5FFCD87D:backup:Backup\x3act-129:Backup_user@pbs: 5FFCD881 OK
UPID:pbs1:0000042F:000008F5:0000002F:5FFCD890:backup:Backup\x3act-250:Backup_user@pbs: 5FFCD899 OK
UPID:pbs1:0000042F:000008F5:0000002D:5FFCD874:backup:Backup\x3act-101:Backup_user@pbs: 5FFCDA49 OK
UPID:pbs1:0000042F:000008F5:00000030:5FFCDA4B:backup:Backup\x3act-102:Backup_user@pbs: 5FFCDB59 OK
UPID:pbs1:0000042F:000008F5:00000028:5FFCD4C3:backup:Backup\x3ahost-pve3:Backup_user@pbs!Backup_Agent: 5FFCDCE4 OK
UPID:pbs1:0000042F:000008F5:00000031:5FFCDB5A:backup:Backup\x3act-103:Backup_user@pbs: 5FFCDD88 OK
UPID:pbs1:0000042F:000008F5:00000032:5FFCDD89:backup:Backup\x3act-104:Backup_user@pbs: 5FFCE17B OK
UPID:pbs1:0000042F:000008F5:00000033:5FFCE17C:backup:Backup\x3act-105:Backup_user@pbs: 5FFCE541 OK
UPID:pbs1:0000042F:000008F5:00000034:5FFCE542:backup:Backup\x3act-106:Backup_user@pbs: 5FFCE814 OK
UPID:pbs1:0000042F:000008F5:00000035:5FFCE815:backup:Backup\x3act-107:Backup_user@pbs: 5FFCE9FE OK
UPID:pbs1:0000042F:000008F5:00000036:5FFCE9FF:backup:Backup\x3act-108:Backup_user@pbs: 5FFCECC9 OK
UPID:pbs1:0000042F:000008F5:00000037:5FFCECCA:backup:Backup\x3act-109:Backup_user@pbs: 5FFCEFCF OK
UPID:pbs1:0000042F:000008F5:00000038:5FFCEFD0:backup:Backup\x3act-110:Backup_user@pbs: 5FFCF551 OK
UPID:pbs1:0000042F:000008F5:0000003A:5FFCF552:backup:Backup\x3act-113:Backup_user@pbs: 5FFD0147 OK
UPID:pbs1:0000042F:000008F5:0000003B:5FFD0149:backup:Backup\x3act-114:Backup_user@pbs: 5FFD0447 OK
UPID:pbs1:0000042F:000008F5:0000003C:5FFD0449:backup:Backup\x3act-115:Backup_user@pbs: 5FFD093F OK
UPID:pbs1:0000042F:000008F5:0000003D:5FFD0940:backup:Backup\x3act-116:Backup_user@pbs: 5FFD0D49 OK
UPID:pbs1:0000042F:000008F5:0000003E:5FFD0D4A:backup:Backup\x3act-159:Backup_user@pbs: 5FFD103D OK
UPID:pbs1:0000042F:000008F5:0000003F:5FFD103D:backup:Backup\x3act-160:Backup_user@pbs: 5FFD13E2 OK
UPID:pbs1:0000042F:000008F5:00000044:5FFD6DB1:backup:Backup\x3ahost-pve1:Backup_user@pbs!Backup_Agent: 5FFD6DBE connection error: Connection reset by peer (os error 104)
UPID:pbs1:0000042F:000008F5:00000045:5FFD6DF2:backup:Backup\x3ahost-pve1:Backup_user@pbs!Backup_Agent: 5FFD6DFF backup ended but finished flag is not set.
UPID:pbs1:0000042F:000008F5:00000046:5FFD6E56:backup:Backup\x3ahost-pve1:Backup_user@pbs!Backup_Agent: 5FFD6E62 backup ended but finished flag is not set.
UPID:pbs1:0000042F:000008F5:00000047:5FFD6E81:backup:Backup\x3ahost-pve1:Backup_user@pbs!Backup_Agent: 5FFD6E8D backup ended but finished flag is not set.

A little more finely we can have the task and its status, on the other hand it only works for the status OK

Code:
 --> grep  backup tasks/archive | awk '{print $2, $3}'
5FFA6A7E OK
5FFB51A7 connection
5FFB521A OK
5FFB5430 backup
5FFB60AB OK
5FFB628C OK
5FFB628E backup
5FFB634A backup
5FFB6476 OK
5FFB7955 backup
5FFB7F5D backup
5FFB8528 connection
5FFB8563 connection
5FFB87A9 backup
5FFB8861 backup

We can deduce that if it is not OK it means that there is a problem with this jobs

On the other hand, a pity that there is no time in the log
 

Attachments

  • Screenshot_2021-01-12 pbs1 - Proxmox Backup Server.png
    Screenshot_2021-01-12 pbs1 - Proxmox Backup Server.png
    14.5 KB · Views: 16
On the other hand, a pity that there is no time in the log
Hello,

Thanks for your post, it helped me.

I don't know what do you mean by "there is no time in the log", but it seems that the numbers "5FFxxxxx" in your logs are timestamps in hex.

For example, your last log is "5FFB8861 backup"
5FFB8861 → 1610319969 → 11/01/2021 00:06:09

I assume you already knew that, otherwise you wouldn't keep that number in your last command.
I'm posting this assuming it might help someone someday.
Who knows.
 

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!