backup check via API

Nov 22, 2018
4
0
21
50
Hi,

ich möchte gerne ein Monitoring-Plugin schreiben, welches den Backup-Status über die API ausliest.
Wir haben bei uns derzeit diese Version im Einsatz und sie funktioniert schon einigermassen gut:

Auf Github findet man ihn hier:
roland-gsell/check_proxmox_backups
(als neuer User darf ich keine Links posten)

Allerdings bekommen wir Criticals, wenn Backups gerade laufen und zudem muss der Check direkt auf einem der Nodes laufen, weil ich auf die Logfiles zugreifen muss.

Daher würde ich das gerne stattdessen über die API lösen.

Das Hauptproblem ist folgendes:
Die Task-Listen geben leider keinerlei Hinweis darauf um welche VM es sich bei dem Task gehandelt hat - man sieht nur den Node:

Code:
{"endtime": 1542085706,
 "id": "",
 "node": "pve01",
 "saved": "1",
 "starttime": 1542063662,
 "status": "OK",
 "type": "vzdump",
 "upid": "UPID:pve01:00000B30:15C08CA5:5BEA062E:vzdump::root@pam:",
 "user": "root@pam"}

Die UPID ist die eindeutige ID des Tasks. Kann man die irgendwie einer VM zuordnen?

Man bekommt auch immer nur die letzten 50 Tasks was auch zu einem Problem werden kann, wenn es viele VMs und/oder andere Tasks gibt (aptupdate, vncproxy, ...). Die Backups können bis zu einer Woche alt sein.
Kann man die Zahl der Tasks, die man erhält, erhöhen?

Und ein letztes Problem gibt es noch:
Die Tasks sind immer nur abgeschlossene Ereignisse. Kann man auch irgendwie auslesen, welche Jobs gerade jetzt laufen?

LG,
Roland.
 
please file an enhancement request on https://bugzilla.proxmox.com - it should be possible to set the ID at least for vzdump tasks backing up a single guest.
 
Ok, I will do that. If it wouldn't be perl I would possibly write the patch myself.

So, a single task could also be the result of several vzdump backups and OK means then that the whole group is ok? **
We are always scheduling groups of machines to backup at at specified time, but to me it seems that for each individual guest backup a task is created.

** in that case the id of the backup schedule would be useful to know with one was ok (or not).

https://bugzilla.proxmox.com/show_bug.cgi?id=1997
 
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!