-
Problem report
-
Resolution: Unresolved
-
Trivial
-
None
-
6.4.12
-
None
-
None
Steps to reproduce:
- On a host, create a macro: {$SENTRY_WARNING_THRESHOLD} with value 10
- On that same host, create a second macro: {$SENTRY_WARNING_THRESHOLD:"default-asp"} with value 15
- Create a discovery rule with 2 LLD macros #PROJECTNAME and #PROJECTSLUG, with the following item prototype:
- Name: {#PROJECTNAME}: warning threshold
- Type: Script
- Key: sentry.project_warning_threshold{#PROJECTSLUG}
- Parameters:
- threshold: {#SENTRY.WARNING_THRESHOLD:"{#PROJECTSLUG}"}
- Script:
- console.warn(value);
var obj = JSON.parse(value);
return obj.threshold * ((new Date()).getHours() + 1);
- console.warn(value);
Result:
When testing, the correct value is returned:
Note that the macro value has been prepopulated correctly.
The server log shows:
1975570:20240312:190835.064 {"threshold":"15"}
However, Execute now the item and the server logs the wrong value:
1975549:20240312:190845.067 {"threshold":"10"}
Expected:
The server should receive 15 as the value in both cases. At the very least, testing and execution should result in the same value.