-
Change Request
-
Resolution: Unresolved
-
Trivial
-
None
-
None
-
None
Currently it's not allowed to use combination of hash symbol and a macro as trigger function parameter:
host:service.status.count(#{$ERRORS.FROM},1,eq)}=0
In this example I'd like to receive an alert if service is down for some variable number of subsequent checks.
The server already supports this, the only blocking point is the Frontend that does not allow using both the hash symbol and a macro. The example fix (tested) for 5.0 looks pretty simple:
--- ui/include/classes/validators/CFunctionValidator.php 2020-05-27 13:05:48.959208824 +0300 +++ ui/include/classes/validators/CFunctionValidator.php.new 2020-05-27 12:50:32.718485922 +0300 @@ -470,11 +470,6 @@ return (substr($param, 1) > 0); } - // allow hash symbol (#) prior to macro - if (preg_match('/^#\{\$[A-Z0-9_\.]+\}$/', $param)) { - return true; - } - return ($this->validateSecValue($param) && $param > 0); }