Ad Widget

Collapse

Zabbix media webhook. Call custom url (include tag in the url)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ojutulu
    Junior Member
    • Dec 2022
    • 1

    #1

    Zabbix media webhook. Call custom url (include tag in the url)

    Trying to call custom url from Zabbix. I've created media type webhook with this script:

    Code:
    var request = new CurlHttpRequest();
    request.AddHeader('Content-Type: application/json');
    var response = request.Post('https://url/api/heartbeat/tag_id');
    if (request.Status() != 200) {
    throw 'Response code: ' + request.Status();
    }
    return response;

    Now I want it to open https://url/api/heartbeat/tag_id where tag_id is something on the host level configuration. For each host I have special tag to call.in example:
    r/zabbix - Zabbix media webhook. Call custom url (include tag in the url)
    for the above it should call https://url/api/heartbeat/husa7633123SD (it doesn't have to be host.tags, I can use other field if easier). How do I pass this tag to the url parameter in the script?
    Thank you!
Working...