Ad Widget

Collapse

Over ride a trigger level for a given host

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gaidukas
    Junior Member
    • Jul 2013
    • 12

    #1

    Over ride a trigger level for a given host

    Hello,

    I have 300+ hosts that I'm actively monitoring and for the most part, the default templates are fine. There are however a few hosts that I would like to change the default trigger level for.

    An example is a virtual host that has local disk with a single vm and a virtual disk that has allocated 90% of the hosts storage space. This will never grow beyond 90% so I would like to change the Free space trigger level for this one volume on this one host from the default 20% down to 5%.

    I've tried going into host config and disabling the trigger item and then cloning it and changing the clone to 5% but it looks like when I disable the item, its disabling the item in the template affecting all hosts with this template.

    So, it looks like I'm doing something wrong here. What is the proper way to make this change to a given host/trigger item without affecting all other hosts that use the same template?

    Please also note that this volume if found via discovery which may or may not complicate things...

    Thanks!

    -Glen
  • ingus.vilnis
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Mar 2014
    • 908

    #2
    Hi Glen,

    Do you want to create a different threshold for whole host or one volume only?

    To apply different threshold for whole host you can use the concept of user macros.


    To do this for one volume on one host you have to use different (or cloned) template without automated discovery, remove the discovered items and create custom ones manually.

    Best Regards,
    Ingus

    Comment

    • gaidukas
      Junior Member
      • Jul 2013
      • 12

      #3
      Ingus,

      I'm happy with 95%+ of what the templates are doing. There are however some situations like the one I mentioned where I would like to over ride the trigger level without making changes to the templates affecting other hosts.

      And yes this is for just one host that has a discovered volume which was assigned a trigger for low disk space of 20%. This is the behavior I want for 99% of the hosts I monitor. I just want to change it for a couple of hosts without making changes to the templates.

      If this is not possible, then I would hope that this becomes a feature in a future release.

      Thanks!

      -Glen

      Comment

      • ingus.vilnis
        Senior Member
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Mar 2014
        • 908

        #4
        Hi Glen,

        I think user macros is exactly the feature you are talking about.

        Here is how to apply this concept for your hosts. This will affect all disk volumes on that one host later. The modification of templates will be one time deal.
        1. Go to your template and open tab Macros
        2. Create a new macro with name of your choice, e.g. {$DISK_FREE} with value 20 (as in default disk discovery)
        3. Open Discovery rules for this template
        4. Click on Trigger prototypes
        5. Change the trigger expression by adding the macro instead of fixed value.
          Code:
          {Template OS Windows:vfs.fs.size[{#FSNAME},pfree].last(0)}<{$DISK_FREE}
        6. Change the Trigger name as well. "Free disk space is less than {$DISK_FREE}% on volume {#FSNAME}"
        7. Save the template. Now this will get populated to all hosts when the next discovery gets executed.
        8. Now go to the specific host and open Macros tab
        9. Create a new macro with the same name as above (e.g. {$DISK_FREE}) and give it the threshold value you want for this specific host, like 5.
        10. Save the host and you are done.


        Now 99% of the hosts have the same thresholds but this one is using values from macros on the host level.

        Best Regards,
        Ingus

        Comment

        • gaidukas
          Junior Member
          • Jul 2013
          • 12

          #5
          Ingus,

          Thanks for your help and the instructions. This gets me closer to what I'm hoping for and helps a lot with my understanding of how Zabbix works.

          The only remaining issue with this example is, it will affect all volumes on the given host. This is ok for this situation but in my case, this is a linux host with several volumes and I would like to change it for one specific volume and not the other volumes:

          /dev/mapper/pve-root 95G 1.6G 89G 2% /
          tmpfs 16G 0 16G 0% /lib/init/rw
          udev 16G 232K 16G 1% /dev
          tmpfs 16G 44M 16G 1% /dev/shm
          /dev/mapper/pve-data 5.3T 4.3T 965G 83% /var/lib/vz <-- this one...
          /dev/sda2 494M 78M 392M 17% /boot


          As you can see, the volume /var/lib/vz is 83% utilized. This is known and ok for this host. I however would like to retain the 20% tigger level for / and other volumes on this host.

          Again, your recommendations get me closer to what I want and also increases my knowledge of zabbix so thank you for your help!

          Regards,

          -Glen

          Comment

          • ingus.vilnis
            Senior Member
            Zabbix Certified Trainer
            Zabbix Certified SpecialistZabbix Certified Professional
            • Mar 2014
            • 908

            #6
            As said, this method affects all volumes on that host if you use discovery.

            Maybe 15% for all drives is a sensible value?

            Best Regards,
            Ingus

            Comment

            • gaidukas
              Junior Member
              • Jul 2013
              • 12

              #7
              Good point since in this situation since the space used will probably not go much beyond 83% for this volume. As recommended I changed the macro to 15%.

              This may be difficult for the Zabbix Dev team but it would be nice if they could make a way of disabling or overriding a specific trigger (even when they are discovered items) on a given host with out making changes to the parent template.

              Thanks!

              -Glen

              Comment

              Working...