I really like that graphs also show the relevant triggers - like
.
They are especially useful, because in the graph "100M" means 100*1000*1000, but in the user macro which sets the trigger "100M" means 100*1024*1024.
Displaying the trigger levels in the graph allows me to verify that I have done the awkward 1024-to-1000 math correctly.
EDIT: Wrong. That was not the problem at all.
The actual problem was, that I changed the trigger to
({template-common:level[{#SNAME}].last()} > {$MAXLEVEL:"{#SNAME}"}) and ({template-common:isDisabled[{#SNAME}].last()}=0)
Removing the other item does not help:
({template-common:level[{#SNAME}].last()} > {$MAXLEVEL:"{#SNAME}"})
But the original version with no parentneses works fine:
{template-common:level[{#SNAME}].last()} > {$MAXLEVEL:"{#SNAME}"}
I'd like to report that this feature does not work when there are multiple levels of templates and/or context-specific macros in the templates.
Concretely, let's assume the configuration is hostXY > template-hostgroupX > template-common.
"template-common" defines all the items, triggers, graphs and LLD prototypes.
"template-hostgroupX" sets macro values for groups of hosts to avoid copy-pasting errors.
"hostXY" just links the template-hostgroupX.
template-common macro: {$MAXLEVEL} = 0;
template-common trigger prototype: "{template-common:level[{#SNAME}].last()} > {$MAXLEVEL:"{#SNAME}"}"
template-common graph prototype for "template-common:level[{#SNAME}]"
template-hostgroup1: {$MAXLEVEL:tank1} = 30;
This should reproduce my problem of trigger levels not showing.
Everything works correctly only when I copy the macros directly to the hosts, unlink template-hosgroupX, link template-common.
They are especially useful, because in the graph "100M" means 100*1000*1000, but in the user macro which sets the trigger "100M" means 100*1024*1024.
Displaying the trigger levels in the graph allows me to verify that I have done the awkward 1024-to-1000 math correctly.
EDIT: Wrong. That was not the problem at all.
The actual problem was, that I changed the trigger to
({template-common:level[{#SNAME}].last()} > {$MAXLEVEL:"{#SNAME}"}) and ({template-common:isDisabled[{#SNAME}].last()}=0)
Removing the other item does not help:
({template-common:level[{#SNAME}].last()} > {$MAXLEVEL:"{#SNAME}"})
But the original version with no parentneses works fine:
{template-common:level[{#SNAME}].last()} > {$MAXLEVEL:"{#SNAME}"}
I'd like to report that this feature does not work when there are multiple levels of templates and/or context-specific macros in the templates.
Concretely, let's assume the configuration is hostXY > template-hostgroupX > template-common.
"template-common" defines all the items, triggers, graphs and LLD prototypes.
"template-hostgroupX" sets macro values for groups of hosts to avoid copy-pasting errors.
"hostXY" just links the template-hostgroupX.
template-common macro: {$MAXLEVEL} = 0;
template-common trigger prototype: "{template-common:level[{#SNAME}].last()} > {$MAXLEVEL:"{#SNAME}"}"
template-common graph prototype for "template-common:level[{#SNAME}]"
template-hostgroup1: {$MAXLEVEL:tank1} = 30;
This should reproduce my problem of trigger levels not showing.
Everything works correctly only when I copy the macros directly to the hosts, unlink template-hosgroupX, link template-common.
Comment