[ZBXNEXT-3589] Tags as macro (or dynamic macro) in trigger name and description Created: 2016 Dec 05 Updated: 2021 Nov 04 |
|
Status: | Open |
Project: | ZABBIX FEATURE REQUESTS |
Component/s: | Frontend (F), Server (S) |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Change Request | Priority: | Minor |
Reporter: | Eugene Semerikov | Assignee: | Unassigned |
Resolution: | Unresolved | Votes: | 4 |
Labels: | macros, tags, triggers, usability | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Issue Links: |
|
Description |
For now we are using too complicated trigger names with macro functions to display data from SNMP traps, like this: Unknown SNMP trap is received ({{ITEM.VALUE}.regsub("DISMAN-EVENT-MIB::sysUpTimeInstance\s+Timeticks:\s+((\d+))", "\1")}) {{ITEM.VALUE}.regsub("SNMPv2-MIB::snmpTrapOID\.0\s+\s+(.*)", "\1")} There is only two variables is getting from SNMP trap, but string is not readable and too long. E.g. trigger name field is only 255 chars. I'm think would be great to implement using tags as macro (or dynamic macro) in trigger name and description, then our trigger name may like this: Unknown SNMP trap is received ({TAGS.Timeticks}) {TAGS.OID} |
Comments |
Comment by Adriano Guilhermetti [ 2018 Oct 30 ] |
Hello, I need it too ... Any feedback? Adriano |
Comment by Lukáš Macura [ 2020 May 15 ] |
Great idea, we need this too. Triggers becomes very unreadable if we use regsub everywhere. Much cleaner solution is to use regsub formulas just in tags and then use tags as macros in url, description etc. There is macro {EVENT.TAGS.tagname} but it is not allowed to use inside trigger description/title. Would be enough if this macro is accessible in trigger definition.
For example, it could be as easy as: User {EVENT.TAGS.User} logged to server {EVENT.TAGS.Host} from IP {EVENT.TAGS.IP} via SSH
and in Tags, define Host { {ITEM.VALUE}.regsub(":[0-9]* (.) sshd.*Accepted publickey for (.) from (.) port (.)(SHA256:.*)","\1")}User {{ITEM.VALUE} .regsub(":[0-9]* (.) sshd.*Accepted publickey for (.) from (.) port (.)(SHA256:.*)","\2")} IP { {ITEM.VALUE}.regsub(":[0-9]* (.) sshd.*Accepted publickey for (.) from (.) port (.)(SHA256:.*)","\3")}
Same approach with regsub used more times is not son nice and it is not error-proof.
|