Monitoring/Perfdata: Fix throwing an exception when perfdata is a number with an exponential base
This commit is contained in:
parent
8269d1542e
commit
1229eae0bf
|
@ -134,7 +134,9 @@ class Perfdata
|
||||||
|
|
||||||
$unit = null;
|
$unit = null;
|
||||||
if (! preg_match('~^(\-?[\d+\.]+(?:E\-?\d+)?)([^\d]+)?$~', $this->val, $m)) {
|
if (! preg_match('~^(\-?[\d+\.]+(?:E\-?\d+)?)([^\d]+)?$~', $this->val, $m)) {
|
||||||
throw new \Exception('Got invalid perfdata: ' . $perfdata);
|
return $perfdata;
|
||||||
|
// Numbers with an exponential base will be rendered invalid using the regex above
|
||||||
|
// throw new \Exception('Got invalid perfdata: ' . $perfdata);
|
||||||
}
|
}
|
||||||
$this->val = $m[1];
|
$this->val = $m[1];
|
||||||
if (isset($m[2])) {
|
if (isset($m[2])) {
|
||||||
|
|
Loading…
Reference in New Issue