Commit 45620667 authored by Dimitris Aragiorgis's avatar Dimitris Aragiorgis Committed by Christos Stavrakakis
Browse files

gtools: Fix collectd plugin wrt netstats



Ganeti with ifdown support adds a new file per NIC (with
name it's UUID) under /var/run/ganeti/kvm-hypervisor/nic/<vm>/.
Let ganeti-netstats.py collectd plugin be aware of this change.
Signed-off-by: default avatarDimitris Aragiorgis <dimara@grnet.gr>
parent d3df28b2
......@@ -26,7 +26,10 @@ def netstats(data=None):
hostname = os.path.basename(dir)
for nic in glob(os.path.join(dir, "*")):
idx = int(os.path.basename(nic))
try:
idx = int(os.path.basename(nic))
except ValueError:
continue
with open(nic) as nicfile:
try:
iface = nicfile.readline().strip()
......
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