Hello everyone,
Since a few days I am trying to link Zabbix to our Discord server, to post status updates and such directly to a Discord channel, for that I am using a self written bash script. Now to get the variables into the script, I am trying to use the action message as JSON parameter for the script, the issue is sadly that somehow I can't bypass the string as json, it errors out and prevents loading the json into bash variables. My current guess would be that Zabbix bypasses a escaped parameter, I honestly dont know.
Here are my Monitor informations:
OS: Debian 9.8 Stretch
Zabbix Version: 4.2.1
Here what I put as action message:
Also running the script directly with that string does work and causes no errors, so it has to have something to do how Zabbix bypasses Parameters
Did somebody else attempted something like this ( json as message ) and could help me out by telling me how they fixed the issue?
Thank you for reading this,
ApDev
PS:
Before I tried to use script parameters in media types directly, but sadly that just supports 3 macros, so now I gotta improvise
Since a few days I am trying to link Zabbix to our Discord server, to post status updates and such directly to a Discord channel, for that I am using a self written bash script. Now to get the variables into the script, I am trying to use the action message as JSON parameter for the script, the issue is sadly that somehow I can't bypass the string as json, it errors out and prevents loading the json into bash variables. My current guess would be that Zabbix bypasses a escaped parameter, I honestly dont know.
Here are my Monitor informations:
OS: Debian 9.8 Stretch
Zabbix Version: 4.2.1
Here what I put as action message:
Code:
"{\"msg\":\"Problem started at {EVENT.TIME} on {EVENT.DATE}\nProblem name: {EVENT.NAME}\nHost: {HOST.NAME}\nSeverity: {EVENT.SEVERITY}\n\nOriginal problem ID: {EVENT.ID}\n{TRIGGER.URL}\",\"ack\":\"{EVENT.ACK.STATUS}\",\"sev\":{TRIGGER.NSEVERITY},\"status\":\"{TRIGGER.STATUS}\"}"
Did somebody else attempted something like this ( json as message ) and could help me out by telling me how they fixed the issue?
Thank you for reading this,
ApDev
PS:
Before I tried to use script parameters in media types directly, but sadly that just supports 3 macros, so now I gotta improvise
Comment