mirror of https://github.com/Icinga/icinga2.git
PluginUtility: Fix PerfData don't get parsed correctly
The problem was that some PerfData labels contained several whitespace characters, not just one, and therefore it was parsed incorrectly in `SplitPerfdata()`. I.e. the condition in line 144 checks whether the first and last character is a normal quote, but since the label can contain spaces at the beginning and at the end respectively, this caused the problems. This PR fixes the problem by removing all occurring whitespace from the beginning and end, before starting to parse the actual label.
This commit is contained in:
parent
66b039df9c
commit
24d95e1178
|
@ -140,6 +140,7 @@ Array::Ptr PluginUtility::SplitPerfdata(const String& perfdata)
|
|||
break;
|
||||
|
||||
String label = perfdata.SubStr(begin, eqp - begin);
|
||||
boost::algorithm::trim_left(label);
|
||||
|
||||
if (label.GetLength() > 2 && label[0] == '\'' && label[label.GetLength() - 1] == '\'')
|
||||
label = label.SubStr(1, label.GetLength() - 2);
|
||||
|
|
Loading…
Reference in New Issue