Hi,
I'm facing a issue with custom script getting wrong macro from different template than which is triggering the script to run.
Not sure if this kind of scenario is even supported, but it makes life a lot easier when configuring simple restart for services. If there are better ways of doing this. I'm free to suggestions.
How to reproduce this / configure this (Example):
* Setup different 3 templates
* Add macro called {$SERVICE.NAME} with value nginx to template 1
* Add macro called {$SERVICE.NAME} with value php-fpm to template 2
* Add macto called {$SERVICE.NAME} with value mysql to template 3
* Configure needed monitoring with triggers.
* Create following custom script being execute on agent: sudo /usr/bin/systemctl restart {$SERVICE.NAME}
* Configure action which calls this script when trigger triggers.
What I'm currently getting is that it only uses service name from template 2 although execution of that script is being initiated from template 1 or 3.
What i'm expecting is that Action passes correct macro from template 1 to custom script.
Everything is working fine when i remove macros from template 2 and 3.
Should this kind of scenario be supported or is there reason why its not?
Zabbix Server version is 3.4.1
I'm facing a issue with custom script getting wrong macro from different template than which is triggering the script to run.
Not sure if this kind of scenario is even supported, but it makes life a lot easier when configuring simple restart for services. If there are better ways of doing this. I'm free to suggestions.
How to reproduce this / configure this (Example):
* Setup different 3 templates
* Add macro called {$SERVICE.NAME} with value nginx to template 1
* Add macro called {$SERVICE.NAME} with value php-fpm to template 2
* Add macto called {$SERVICE.NAME} with value mysql to template 3
* Configure needed monitoring with triggers.
* Create following custom script being execute on agent: sudo /usr/bin/systemctl restart {$SERVICE.NAME}
* Configure action which calls this script when trigger triggers.
What I'm currently getting is that it only uses service name from template 2 although execution of that script is being initiated from template 1 or 3.
What i'm expecting is that Action passes correct macro from template 1 to custom script.
Everything is working fine when i remove macros from template 2 and 3.
Should this kind of scenario be supported or is there reason why its not?
Zabbix Server version is 3.4.1
Comment