From 697dec5dfb232d28e10d5573f9da3101448ffae1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjo=CC=88rn=20Puttmann?= Date: Fri, 24 Jan 2020 15:56:42 +0100 Subject: [PATCH] Fixed bug causing libvirtd: End of file while reading data: Input/output error log messages. --- prometheus-libvirt-exporter.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/prometheus-libvirt-exporter.go b/prometheus-libvirt-exporter.go index d5ea010..2dd07bc 100644 --- a/prometheus-libvirt-exporter.go +++ b/prometheus-libvirt-exporter.go @@ -367,6 +367,8 @@ func CollectFromLibvirt(ch chan<- prometheus.Metric, uri string) error { return err } + defer l.Disconnect() + host, err := l.ConnectGetHostname() if err != nil { log.Fatalf("failed to get hostname: %v", err)