Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure payload contains escaped double quotes #2

Conversation

rd-goran-pulevic
Copy link

Zabbix trigger elements, containing double quotes in definition
fields, are not being properly escaped when constructing JSON
payload. That, of course, breaks JSON standard.

Fix implements additional step, which deconstructs raw JSON payload
and, as an output, produces a valid JSON.

Zabbix trigger elements, containing double quotes in definition
fields, are not being properly escaped when constructing JSON
payload. That, of course, breaks JSON standard.

Fix implements additional step, which deconstructs raw JSON payload
and, as an output, produces a valid JSON.
@BirolYildiz
Copy link
Member

Hey @rd-goran-pulevic,
thanks for your PR. Do you have a sample .ilert file, generated by Zabbix, so we can reproduce this properly?
Thanks,
B.

@rd-goran-pulevic
Copy link
Author

Some history - this is the error message:
ilert-zabbix.py: error: payload must be valid json (see https://support.ilert.de/display/ID/Zabbix+Integration). Error: Invalid control character at: line 7 column 35 (char 226)

Sample invalid payload:

{
    "EVENT.ID": "2468041",
    "HOST.HOST": "rs-int-front-001",
    "HOST.IP": "172.30.122.61",
    "TRIGGER.DESCRIPTION": "Traefik: ping API did not respond with OK",
    "TRIGGER.ID": "22342",
    "TRIGGER.NAME": "Traefik "live" signal missing / ping not OK",
    "TRIGGER.SEVERITY": "Average",
    "TRIGGER.STATUS": "PROBLEM",
    "TRIGGER.URL": "",
    "TRIGGER.VALUE": "1",
    "PLUGIN_VERSION": "1.0"
}
``

@yacut yacut added the bug Something isn't working label Aug 4, 2020
@yacut yacut added the wontfix This will not be worked on label Sep 29, 2020
@rd-goran-pulevic
Copy link
Author

labeled wontfix.

@yacut
Copy link
Member

yacut commented Nov 18, 2020

@rd-goran-pulevic If you are using Zabbix 4.4+, please try our native integration to solve the problem: https://docs.ilert.com/integrations/zabbix/native

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants