Ad Widget

Collapse

Creating web scenario triggers via low-level discovery

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • inventor96
    Junior Member
    • Dec 2021
    • 13

    #1

    Creating web scenario triggers via low-level discovery

    I would like to create triggers automatically for all web checks created in our Zabbix instance. My first thought is to use LLD (low-level discovery) in a template, and then attach that template to the applicable hosts.

    I've configured the discovery to use an "External Check" with a script that calls the Zabbix API to fetch the names of all the web checks for the host specified in one of the parameters to the script. I've confirmed this works by itself by calling the script manually, and in Zabbix through my troubleshooting that I'll describe in a bit. This is what the trigger prototype looks like:

    Click image for larger version

Name:	Screenshot from 2022-03-28 20-35-55.png
Views:	1039
Size:	29.0 KB
ID:	442204

    The problem is that when I try to save this trigger prototype, it fails saying that the items don't exist, which makes sense, since the items aren't inherently tied to the template where this is being used.

    In order to try and trick Zabbix into creating the triggers, I've tried creating both items within the template; once with "Create enabled" disabled, once with "Discover" disabled, once with them both disabled, and once with both of them enabled. Unfortunately none of these attempts have been successful. It appears that the triggers were never created in any case. Only in the case where both options were enabled did the error come up about the items already existing (which makes sense, since the web checks have already been created by this point).

    I could definitely change my script to use the API to create the triggers itself and add a cron schedule for it, but it would be nice if we could do it via LLD and use the existing features there. If anyone has ideas on how to get this to work, or some other way of automatically creating triggers for web scenarios in Zabbix, it would be appreciated if you could share. Thanks!
  • tachikoma
    Junior Member
    • Nov 2013
    • 10

    #2
    You can try WSZL tool https://github.com/tinyops-ru/zabbix-lld-ws

    Comment

    Working...