I am having an issue passing Macro values to an external script and would greatly appreciate any insight that could be provided.
Config is as follows:
Template Item that measures memory % free
Trigger that created a HIGH alarm when free memory is less than 10%
Defined script that runs a PHP file to create a ticket in an ITSM system
Script configuration is as follows:
/usr/lib/zabbix/alertscripts/newticket.php "{HOST.NAME}" "{EVENT.NAME}" "{EVENT.ID}" "3"
File that is run by the script accepts variables as such
newticket.php <host> <title1> <eventid> <severity>
Where HOST maps to HOST.NAME, TITLE1 maps to EVENT.NAME, etc
Action defined to run the PHP script whenever a HIGH ticket is encountered
For some reason, only the HOST.NAME is passed to the php script by Zabbix, the other Marcos are passed as "EVENT.ID" instead of the actual Event ID numeric value
The PHP script runs on the xabbix host to communicate with an ITSM API for ticket creation. Manually running the script from the Zabbix command line where I manually input the values is fine. Letting the script auto fire based on the trigger or manually firing it from the Zabbix dashboard results in only the HOST.NAME macro value being passed to the script as stated above.
Config is as follows:
Template Item that measures memory % free
Trigger that created a HIGH alarm when free memory is less than 10%
Defined script that runs a PHP file to create a ticket in an ITSM system
Script configuration is as follows:
/usr/lib/zabbix/alertscripts/newticket.php "{HOST.NAME}" "{EVENT.NAME}" "{EVENT.ID}" "3"
File that is run by the script accepts variables as such
newticket.php <host> <title1> <eventid> <severity>
Where HOST maps to HOST.NAME, TITLE1 maps to EVENT.NAME, etc
Action defined to run the PHP script whenever a HIGH ticket is encountered
For some reason, only the HOST.NAME is passed to the php script by Zabbix, the other Marcos are passed as "EVENT.ID" instead of the actual Event ID numeric value
The PHP script runs on the xabbix host to communicate with an ITSM API for ticket creation. Manually running the script from the Zabbix command line where I manually input the values is fine. Letting the script auto fire based on the trigger or manually firing it from the Zabbix dashboard results in only the HOST.NAME macro value being passed to the script as stated above.
Comment