I'm sharing a method of naming triggers with macros,.
I've set up a couple of triggers that trigger actions from one (more than one actually) item but get their name from oneother. Se below:
{Template_MSC:r.1.strlen(0)}<0 | {Template_MSC:nidl.1.last(0)}=0 & {Template_MSC:nocc.1.last(0)}>0 & {Template_MSC:r.1.regexp(.*?S[O|I])}=0
The trick is to or the naming item with a nonsense expression. The nonsense expression in this case is "{Template_MSC:r.1.strlen(0)}<0" since a string cant have a length < 0.
The name can then be selected with something like below, where {ITEM.VALUE1} selects the first items value (the naming items value):
Route {ITEM.VALUE1} in {HOSTNAME} no idle device
I've set up a couple of triggers that trigger actions from one (more than one actually) item but get their name from oneother. Se below:
{Template_MSC:r.1.strlen(0)}<0 | {Template_MSC:nidl.1.last(0)}=0 & {Template_MSC:nocc.1.last(0)}>0 & {Template_MSC:r.1.regexp(.*?S[O|I])}=0
The trick is to or the naming item with a nonsense expression. The nonsense expression in this case is "{Template_MSC:r.1.strlen(0)}<0" since a string cant have a length < 0.
The name can then be selected with something like below, where {ITEM.VALUE1} selects the first items value (the naming items value):
Route {ITEM.VALUE1} in {HOSTNAME} no idle device

Comment