Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

making single quote labels work, fixes #54 #71 #117

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions graphios.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import os
import os.path
import re
import shlex
import sys
import time

Expand Down Expand Up @@ -339,9 +340,13 @@ def process_log(file_name):
variables = line.split('\t')
mobj = get_mobj(variables)
if mobj:
# break out the metric object into one object per perfdata metric
# log.debug('perfdata:%s' % mobj.PERFDATA)
for metric in mobj.PERFDATA.split():
try:
metric_array = shlex.split(mobj.PERFDATA)
except:
log.critical("failed to parse perfdata: %s" % (mobj.PERFDATA))
continue
for metric in metric_array:
try:
nobj = copy.copy(mobj)
(nobj.LABEL, d) = metric.split('=')
Expand Down