[Nagvis-devel] Nagvis 1.4.5 - bug in perfdata parsing in gadgets_core.php
Brought to you by:
larsi-
From: Robert F. <rob...@nt...> - 2009-12-09 19:43:40
|
It appears there is a problem with gadgets_core.php in version 1.4.5. When parsing perfdata for 'warning' or 'critical' ranges, the code does: $aSet['warning'] = $aTmp[4]; // Try to get warn min/max preg_match_all('/([\d\.]+):([\d\.]+)/',$aTmp[4], $matches); if(!isset($matches[0])) { $aSet['warning_min'] = $matches[1][0]; $aSet['warning_max'] = $matches[2][0]; } Why is it trying to set the min/max when it _doesn't_ find matches? Additionally, when we do find matches - does it make sense to leave $aSet['warning'] set to the min:max value as is currently being done? I see that in the git tree it's slightly different, though it still leaves the ['warning'] and ['critical'] fields set to min:max, which seems odd. Does anybody have insight into this? |