Ad Widget

Collapse

Exclude discovery from trigger

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • FrK3v
    Junior Member
    • Apr 2018
    • 8

    #1

    Exclude discovery from trigger


    Hello everyone,

    I I have created a discovery to find mounts points (/vm, /vm1, …) with items in order to retrieve some values such as used space, remaining space.

    I would like to create a trigger which will act when the used space will be > 80 % but exclude from this trigger the mount point discovered: /vm (and only this one).

    {TEMPLATE:ITEM[{#MP},used%].last()}>80 and ????

    How can I correctly build this trigger? I tried to look on Google without success.

    Note: I need informations from /vm so I couldn’t afford to exclude this one from my discovery.

    Thanks for your help

    FrK3v

    Zabbix Server 3.4.7
  • tcilmo
    Senior Member
    • Nov 2016
    • 122

    #2
    You will need to create a regular expression to filter out that string, and also create a filter on the discovery rule that points to the regular expression.

    Comment

    • kloczek
      Senior Member
      • Jun 2006
      • 1771

      #3
      Originally posted by tcilmo
      You will need to create a regular expression to filter out that string, and also create a filter on the discovery rule that points to the regular expression.
      BTW: currently (>=3.4) it is no longer the only truth :P
      Now as zabbix uses pcre instead libc regep() it is possible to use more complicated regexps which will be defined entirely in situ in LLD filter without referring to zabbix global regexps by @<RegexpNsame>.
      Example from my template https://github.com/kloczek/zabbix-te...ter/OS%20Linux
      In VOL: lld in filter you can find such in situ definition:

      Type of calculation: A and B
      A: {#FSNAME} ^(?!(^/run/media))
      B: {#FSTYPE} ^(btrfs|ext2|ext3|ext4|jfs|reiser|xfs|ffs|ufs|jfs| jfs2|vxfs|hfs|refs|ntfs|fat32|zfs)$

      "A" is to exclude monitoring any temporary appearing storage devs mounted for example over USB.

      Or in NET: lld you can find the similar example to excluding lo interface:

      Filters:
      A: {#IFNAME} ^(?!(lo))

      Similar filters you can find in my OS Solaris and OS Windows templates.

      Another example you can find in my MySQL template where I have set of metrics populated per each database which should not be populated for system databases.
      https://github.com/kloczek/zabbix-te...ervice%20MySQL
      In this template MySQL:B: lld you can find:

      Filters:
      A: {#DB} ^(?!(information_schema|mysql|performance_schema|s ys))

      Using in situ in filters regexps (without @<RegexpNsame>) makes templates self-contained/easier to move around
      http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
      https://kloczek.wordpress.com/
      zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
      My zabbix templates https://github.com/kloczek/zabbix-templates

      Comment

      • FrK3v
        Junior Member
        • Apr 2018
        • 8

        #4
        Hello,

        I have founded a solution. I will add an information in my discovery for example: "{#MONITORED} true/false" and I will used this information in my trigger.

        Thanks for your help

        Comment

        • wwatanabe
          Junior Member
          • Nov 2014
          • 3

          #5
          Hi All !

          FrK3v can you share your solution please ?!

          I need the same and couldn't figure out how to do that !

          I'm using the Windows template that discovers the file systems. I want to continue monitoring the disks, all of them, but we have some disks that are dedicated to backup in a rotating way and I don't want it triggers for diskspace.

          Thanks in advance !

          Wellington

          Comment

          Working...