From a43c0db6cf6b101fa4589e020fcdcef62de59516 Mon Sep 17 00:00:00 2001 From: Jason Erdmann Date: Mon, 8 Dec 2014 21:39:25 -0600 Subject: [PATCH] added exception for incomplete metrics --- graphios.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/graphios.py b/graphios.py index 96b54a1..d11fa95 100755 --- a/graphios.py +++ b/graphios.py @@ -347,7 +347,13 @@ def get_mobj(nag_array): """ mobj = GraphiosMetric() for var in nag_array: - (var_name, value) = var.split('::', 1) + # drop the metric if we can't split it for any reason + try: + (var_name, value) = var.split('::', 1) + except: + log.warn("could not split value %s, dropping metric" % var) + return False + value = re.sub("/", cfg["replacement_character"], value) if re.search("PERFDATA", var_name): mobj.PERFDATA = value