Ad Widget

Collapse

Manually add items to host via template

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aljassem
    Junior Member
    • Aug 2020
    • 1

    #1

    Manually add items to host via template

    Hi everyone,

    I have a humble experience with Zabbix.
    I want now to monitor SSL certificate validity of various sites.
    Currently i am adding the items manually to the hosts, Then add two triggers for each item. It is surely not the right way.
    The problem is that i don't know how to doe this via template.

    The goal is to be able to add the items via a template so that i can later delete the items and the triggers by unlinking the template from the host. Or delete un item with the related triggers.
    The problem is that the sites that i monitor are not managed by me. So there is no possibility for auto descovery on the remote server.
    If i create a template with items. Then they are not editable any more at the Host config.

    I don't know how to do this.
  • tim.mooney
    Senior Member
    • Dec 2012
    • 1427

    #2
    You can use templates to add items and triggers (and other things, if you want) to a host. Templates become much, much more powerful when the template is written to use macros , in this case user macros. Zabbix user macros are like variables that have a default value (in this case, probably set at the template level), but that default value can be overridden on a host-by-host basis to customize how the item or trigger works for that host.

    Read the documentation section on macros, especially user macros, and think about how you monitor the certificate validity now. You probably create items that are very similar (perhaps with only one thing changing, such as the URL) right now when you're creating manually for each host. It's the part that you frequently need to customize per-host that you would make a macro. You create the item in the template, instead of directly on a specific host. You write the item so that the parts that sometimes need to be changed are represented by the macro. The same is true for your triggers -- the parts that you need to customize per host would be (different) user macros.

    Comment

    Working...