mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-05-28 04:36:06 -04:00
parent
0d96994d54
commit
ef16387ca0
1 changed files with 5 additions and 1 deletions
|
|
@ -426,13 +426,17 @@ class PerfData
|
|||
$parts = explode(';', $this->perfdataValue);
|
||||
|
||||
$matches = array();
|
||||
if (preg_match('@^(-?(?:\d+)?(?:\.\d+)?)([a-zA-Z%°]{1,3})$@u', $parts[0], $matches)) {
|
||||
if (preg_match('@^(U|-?(?:\d+)?(?:\.\d+)?)([a-zA-TV-Z%°]{1,3})$@u', $parts[0], $matches)) {
|
||||
$this->unit = $matches[2];
|
||||
$this->value = $matches[1];
|
||||
} else {
|
||||
$this->value = $parts[0];
|
||||
}
|
||||
|
||||
if (! is_numeric($this->value)) {
|
||||
$this->value = null;
|
||||
}
|
||||
|
||||
switch (count($parts)) {
|
||||
/* @noinspection PhpMissingBreakStatementInspection */
|
||||
case 5:
|
||||
|
|
|
|||
Loading…
Reference in a new issue