Hello there :-)
here is what i want to achieve : i need to retreive a authentification token from an API, then use this token in several http agent items
so i configured a script called SCRIPTNAME in zabbix frontend, containing a curl command like this :
the script is configured to be played on zabbix proxy (remote commands enabled in configuration file).
when i set up the script to be manually executed, and i execute it on a host, it works.
now i need to update a macro with the value returned by the script.
so i set up the script as "manual event action", and configured the macro in my template like this
name : {$AUTH}
value : system.run[{$SCRIPTNAME}]
but when i use {$AUTH} in a http agent item header, the test returns a 401 code.
What would be the best approach to do this ?
here is what i want to achieve : i need to retreive a authentification token from an API, then use this token in several http agent items
so i configured a script called SCRIPTNAME in zabbix frontend, containing a curl command like this :
Code:
curl -s -X POST -H 'Content-Type: application/json' -d '{"user":"myUser","password":"myPassword"}' http://{HOST.IP}:8080/api | jq '.token' --raw-output
the script is configured to be played on zabbix proxy (remote commands enabled in configuration file).
when i set up the script to be manually executed, and i execute it on a host, it works.
now i need to update a macro with the value returned by the script.
so i set up the script as "manual event action", and configured the macro in my template like this
name : {$AUTH}
value : system.run[{$SCRIPTNAME}]
but when i use {$AUTH} in a http agent item header, the test returns a 401 code.
What would be the best approach to do this ?
Comment