Skip to content

Commit

Permalink
added exception for incomplete metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
jerdmann committed Dec 9, 2014
1 parent 8efccc4 commit a43c0db
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion graphios.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a43c0db

Please sign in to comment.