Skript hooks broken?

imadevel

Member
Jun 2, 2014
7
1
21
Hello,
first of all I want to be able to run a skript after each part of a backup job, that will send information to a zabbix server.
here it shows https://pve.proxmox.com/pve-docs/vzdump.1.html that there
when I use a absolut basic skript
Code:
# example hook script for vzdump (--script option)

use strict;
my $logfile = "/temp/ausgabentest.txt";
my $proxlogfile = $ENV{LOGFILE}; 
print "HOOK: " . join (' ', @ARGV) . "\n";
open(LFH, '>>', $logfile) or die "cannot open the log file $logfile: $!";
print LFH "HOOK: " . join (' ', @ARGV) . "\n".$proxlogfile."\n";
my $phase = shift;
if ($phase eq 'backup-end' ){
close LFH;
I was getting the following output
Code:
HOOK: job-start
HOOK: job-end
so there seems no usefull variable for me
A longer time ago I even edited the Proxmox files and wrote a little package that was called by /usr/share/perl5/PVE/VZDump.pm right before
Code:
eval { $self->sendmail ($tasklist, $totaltime, undef, $job_start_log, $job_end_log); };

interestingly It does not seems to get called anymore since the new backup shedular in PVE7, old jobs still using crone seems to work.

The Question is is there any easy way to call a skript that gets basicly the information name of the VM, ID of the VM, Backupstatus (Ok, Error) , so that I could call zabbix-sender with that information?
 
i just tested the example hookscript (/usr/share/doc/pve-manager/examples/vzdump-hook-script.pl) and it correctly printed out all phases with variables...

what's your 'pveversion -v' output?
maybe check your hookscript that it really does what you want?
 

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!