mirror of
https://github.com/Icinga/icinga2.git
synced 2025-04-08 17:05:25 +02:00
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
02ddb4badc
commit
ff0b45eca0
@ -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…
x
Reference in New Issue
Block a user