Proxmox VMs backup monitoring script

MR_Andrew

New Member
Aug 9, 2018
2
0
1
33
Hello!
I'm working on monitoring script for Zabbix. Purpose - get result of build-in Proxmox backup procedure.
Total Zabbix template will works with 2 scripts: discovery script that will find VM numbers and check if backup enabled; monitoring script that will do all other staff.
I want ask you to check my monitoring script. It's pretty much simple to understand. File attached.
Script works with 2 arguments: VM number and number of days to find backup files. Example:
Code:
./proxmox-vms-backup-status 100 7
I'm a little bit afraid about logic of script. I made tests of this script on 3 different proxmoxes with different versions. Now, after debugging and fixing issues that been found, seems like working correct. But I want to be sure that everything is fine before publishing to production.

Thanks a lot!
Kind regards, Andrew.
 

Attachments

This is a good starting point, but the only real test is to restore your backup, e.g. real restore in another datacenter or unpack with vzdump, everything else is just a check if a file exists - or a test if the backup is correctly exported (not that it is correctly written).
 
  • Like
Reactions: MR_Andrew
This is a good starting point, but the only real test is to restore your backup, e.g. real restore in another datacenter or unpack with vzdump, everything else is just a check if a file exists - or a test if the backup is correctly exported (not that it is correctly written).

Dear LnxBil, thanks for your reply!
I understand your idea. Unfortunately, I didn't found any way to check backup file consistence. Looks like Proxmox don't have such build-in procedure. It's pity.

"or a test if the backup is correctly exported" - what do you mean? Is it possible to check via bash?
Thanks!
 
If some are interested in Zabbix monitoring of PVE, I've also written some scripts. It also uses LLD to discover guests, storage, pools etc... It doesn't monitor backups, but can graph a lot of things. See

http://gitweb.firewall-services.com/?p=zabbix-agent-addons;a=blob;f=zabbix_scripts/disco_pve_sudo

And

http://gitweb.firewall-services.com/?p=zabbix-agent-addons;a=blob;f=zabbix_scripts/check_pve_sudo

And

http://gitweb.firewall-services.com/?p=zabbix-agent-addons;a=blob;f=zabbix_conf/pve.conf