Commit 0b139722 authored by Nigel Kukard's avatar Nigel Kukard

Retry zabbix_sender 3 times before giving up

parent 7cfe0b89
#!/usr/bin/perl
# backstep-traceback - Client software for the AWIT Backstep server
# Copyright (c) 2010-2017, AllWorldIT
# Copyright (c) 2010-2018, AllWorldIT
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -2678,7 +2678,9 @@ sub zabbixReport
}
# Check result of close
my ($res,@data) = runCommand(
my $res;
for (my $try = 1; $try < 4; $try++) {
($res,my @data) = runCommand(
"zabbix_sender",
"--config",$globalConfig{'zabbix-config'},
"--with-timestamps",
......@@ -2702,6 +2704,14 @@ sub zabbixReport
if (defined($data[0]) && $data[0] ne "") {
printLog(LOG_ERROR,"ZABBIX: - STDOUT log below\n- - - - - - - - - -\n%s\n- - - - - - - - - -\n",$data[0]);
}
# Retry
printLog(LOG_ERROR,"ZABBIX: - Retrying... #$try");
sleep(10);
# Success
} else {
last;
}
}
return $res;
......
Markdown is supported
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