Zabbix user defined macro in script parameters (media type)

scriptingzabbix

I have an alert script in zabbix 3.4 that I would like to be run using user defined macros {$FOO}, basically the macro would store a predefined value

I am setting the {$FOO} in the media type (see screenshot) and using the predefault macro {ALERT.MESSAGE}

Media type configuration with macros

The {ALERT.MESSAGE} macro works fine, but the {$FOO} is not resolved on the script. I have configured {$FOO} as a global macro or template macro and host macro but nothing seems to work.

Question: Is is possible to use user macros on media type? Something wrong in my logic?

Best Answer

You cannot use usermacros directly in alertscript parameters, only a small subset of macros are supported there.

Instead, try including your usermacro in the alert message, it should be resolved there.