Hi folks, I would like to set sending webhooks by python script, but I have one problem with this. I am trying according this manual https://www.zabbix.com/documentation...s/media/script . The script is executing but it doesn't send values which I want. This is my script
In zabbix settings I have added these parmeters:
{HOST.NAME}
{EVENT.NAME}
{EVENT.SEVERITY}
Notificiation which has been sent from zabbix doesn't contain values ony parameter names. Notificiation looks like this:
{HOST.NAME},{EVENT.NAME},{EVENT.SEVERITY}
Could someone help me, where is the problem? Thank you in advance.
Code:
#!/usr/bin/python
import sys
import requests
hostname = sys.argv[1]
eventname = sys.argv[2]
severity = sys.argv[3]
payload = '{{"text": "{0},{1},{2}"}}'.format(hostname,eventname,severity)
headers = {'Content-type': 'application/json'}
endpoint = "https://example.com/asdf"
requests.post(endpoint, headers=headers, data=payload, verify=False)
{HOST.NAME}
{EVENT.NAME}
{EVENT.SEVERITY}
Notificiation which has been sent from zabbix doesn't contain values ony parameter names. Notificiation looks like this:
{HOST.NAME},{EVENT.NAME},{EVENT.SEVERITY}
Could someone help me, where is the problem? Thank you in advance.
Comment