From a13fe545a17d55c16402f977ae23fc0daffb5d32 Mon Sep 17 00:00:00 2001 From: Fabian Schlenz Date: Wed, 12 Aug 2020 05:43:48 +0200 Subject: [PATCH] Fixed network interface detection in qemu.sh --- files/usr/local/emhttp/plugins/zabbix_agent/scripts/qemu.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/files/usr/local/emhttp/plugins/zabbix_agent/scripts/qemu.sh b/files/usr/local/emhttp/plugins/zabbix_agent/scripts/qemu.sh index fcd02a2..cc5ba0e 100755 --- a/files/usr/local/emhttp/plugins/zabbix_agent/scripts/qemu.sh +++ b/files/usr/local/emhttp/plugins/zabbix_agent/scripts/qemu.sh @@ -16,9 +16,10 @@ while IFS=":" read key value; do [ "$key" = "Used memory" ] && echo -n ', "memory_used":'$((${value%KiB} * 1024)) done < <(virsh dominfo "$VM") +read interface _ < <(virsh domiflist "$VM" | head -n3 | tail -n1) while read if key value; do [ "$key" = "rx_bytes" ] && echo -n ', "network_bytes_in":'$value [ "$key" = "tx_bytes" ] && echo -n ', "network_bytes_out":'$value -done < <(virsh domifstat "$VM" vnet0) +done < <(virsh domifstat "$VM" "$interface") echo "}"