-
New Feature Request
-
Resolution: Unresolved
-
Trivial
-
None
-
None
-
None
-
None
It would be nice if you could define a global or host macro based on a custom SQL query.
I have added an additional table to the database that tracks the association of a support ticket with a specific triggerid or eventid. This allows me to track if a re-occurring event for a given trigger has already had a support ticket opened for it.
If I could define a custom macro that was populated with a user defined sql query, We could use it in an action such as an email message.
For example:
Assume you have created an additional table in the zabbix database
Create Table: CREATE TABLE `tickets` ( `ticketid` bigint(20) unsigned NOT NULL, `triggerid` bigint(20) unsigned NOT NULL DEFAULT '0', `eventid` bigint(20) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`ticketid`), ) ENGINE=InnoDB DEFAULT CHARSET=latin1
If I were able to define two global macros similar to the following:
{$TRIGGER.TICKET} = select ticketid from zabbix.tickets where triggerid=
order by ticketid dec limit 1;
{$EVENT.TICKET} = select ticketid from zabbix.tickets where eventid=
;
Then I would be able to generate emails for a triggered event that used the {$TRIGGER.TICKET} and or {$EVENT.TICKET} in the message and have the value of the above query in the message.