diff --git a/modules/monitoring/library/Monitoring/Plugin/Perfdata.php b/modules/monitoring/library/Monitoring/Plugin/Perfdata.php index 559e2a703..6c2d89a72 100644 --- a/modules/monitoring/library/Monitoring/Plugin/Perfdata.php +++ b/modules/monitoring/library/Monitoring/Plugin/Perfdata.php @@ -323,14 +323,14 @@ class Perfdata case 3: $this->rawCriticalThreshold = trim($parts[2]); $this->criticalThreshold = self::convert( - ThresholdRange::fromString($this->rawCriticalThreshold ?: '~:'), + ThresholdRange::fromString($this->rawCriticalThreshold), $this->unit ); // Fallthrough case 2: $this->rawWarningThreshold = trim($parts[1]); $this->warningThreshold = self::convert( - ThresholdRange::fromString($this->rawWarningThreshold ?: '~:'), + ThresholdRange::fromString($this->rawWarningThreshold), $this->unit ); } diff --git a/modules/monitoring/library/Monitoring/Plugin/ThresholdRange.php b/modules/monitoring/library/Monitoring/Plugin/ThresholdRange.php index 26165c0e9..536dc8f7a 100644 --- a/modules/monitoring/library/Monitoring/Plugin/ThresholdRange.php +++ b/modules/monitoring/library/Monitoring/Plugin/ThresholdRange.php @@ -36,10 +36,14 @@ class ThresholdRange * * @return ThresholdRange */ - public static function fromString($rawRange) + public static function fromString($rawRange = '') { $range = new static(); + if ($rawRange === '') { + return $range; + } + $rawRange = ltrim($rawRange); if (substr($rawRange, 0, 1) === '@') { $range->setInverted();