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

nginx-zabbix: Catch more write errors


Signed-off-by: Florian Pritz's avatarFlorian Pritz <bluewind@xinu.at>
parent 04e0e47a
......@@ -35,8 +35,8 @@ sub send_zabbix {
$zabbix_sender->autoflush();
}
my $ret = syswrite $zabbix_sender, (sprintf "- %s %s\n", $key, $value);
if (not $ret and $!{EPIPE}) {
print STDERR "Got EPIPE. Restarting zabbix_sender\n";
if (not defined $ret) {
print STDERR "Writing failed: '$!' Restarting zabbix_sender\n";
undef $zabbix_sender;
send_zabbix(@_);
}
......
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