From f014da61c590662eef5cad9d9eb99e5bce2ad020 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Fri, 20 May 2016 12:07:39 +0200 Subject: [PATCH] Status: report errors on socket creation problems If the socket couldn't be created (e.g. FQDN not resolvable) we continued witouth any hint, when actualy writing the data we then die'd. The user then does not really know why, so report errors if the socket creation failed. Signed-off-by: Thomas Lamprecht --- PVE/Status/Graphite.pm | 2 +- PVE/Status/InfluxDB.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PVE/Status/Graphite.pm b/PVE/Status/Graphite.pm index c125c908..f8d95d12 100644 --- a/PVE/Status/Graphite.pm +++ b/PVE/Status/Graphite.pm @@ -72,7 +72,7 @@ sub write_graphite_hash { PeerAddr => $host, PeerPort => $port, Proto => 'udp', - ); + ) || die "couldn't create carbon socket [$host]:$port - $@\n"; write_graphite($carbon_socket, $d, $ctime, $path.".$object"); diff --git a/PVE/Status/InfluxDB.pm b/PVE/Status/InfluxDB.pm index 4d1a2372..83001473 100644 --- a/PVE/Status/InfluxDB.pm +++ b/PVE/Status/InfluxDB.pm @@ -92,7 +92,7 @@ sub write_influxdb_hash { PeerAddr => $host, PeerPort => $port, Proto => 'udp', - ); + ) || die "couldn't create influxdb socket [$host]:$port - $@\n"; $socket->send($payload->{string}); $socket->close() if $socket;