Verified Commit e036a7f1 authored by Florian Pritz's avatar Florian Pritz
Browse files

nginx-zabbix: Close tail fd when terminating

Seems like the open fd might prevent the script from properly
terminating. Let's see if this fixes it.

Signed-off-by: Florian Pritz's avatarFlorian Pritz <>
parent fc785c7e
......@@ -17,9 +17,12 @@ my @nginx_log_file_paths = glob("/var/log/nginx/*-access.log /var/log/nginx/*/ac
@nginx_log_file_paths = ("./test-access.log") if $devmode;
my $logfile;
$SIG{__DIE__} = sub {
print STDERR "Should be dying now\n";
close $logfile;
......@@ -49,7 +52,7 @@ sub send_zabbix {
sub main {
die "No log files found" if @nginx_log_file_paths == 0;
open my $logfile, "-|", qw(tail -n0 -q -F), @nginx_log_file_paths;
open $logfile, "-|", qw(tail -n0 -q -F), @nginx_log_file_paths;
my $last_send_time = 0;
my $value_template = {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment