Ad Widget

Collapse

Low level discovery with filters

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • duncan9562
    Member
    • Jan 2017
    • 46

    #1

    Low level discovery with filters

    Hi all,

    I am trying to configure a discovery rule for file systems / directories on a large number of our Linux servers.

    I have set up the following, which works great:-

    * Discovery rule taken from the default template, that checks for new file systems using vfs.fs.discovery every 5 minutes (will be 1 hour, 5 minutes is just for testing purposes).
    * Item prototypes also taken from the default template, which include Free disk space on {#FSNAME} etc.
    * Trigger prototypes, also taken from the default template.

    As per the docs https://www.zabbix.com/documentation...ry/filesystems I am using Filters to determine the file system type, and also exclude some directories. These are as follows:-

    * {#FSTYPE} matches @File systems for discovery
    * {#FSNAME} matches @Directorys to exclude from mounted file system discovery

    The type of calculation is set to A and B.

    The regular expressions look like:-

    * File systems for discovery = 1 » ^(btrfs|ext2|ext3|ext4|jfs|reiser|xfs|ffs|ufs|jfs| jfs2|vxfs|hfs|refs|ntfs|fat32|zfs)$ [Result is TRUE]
    * Directorys to exclude from mounted file system discovery = 1 » ^(\Wmnt|\Wproc|\Wsys|\Wdev|\Wsrv) [Result is FALSE]

    The above set up works brilliantly. What I have tried to do is add a further regular expression to exclude a directory, in this case /home/server/root_images.

    I created a regular expression as follows:-
    * Match fsname root images = 1 » ^/home/server/root_images [Result is FALSE]
    This was tested using the expression test function, and when /home/server/root_images was the input, the result was FALSE, and anything else entered TRUE.

    I also changed the Filter options as follows:-
    * Custom expression = A and (B or C)

    ...and the Filters to be:-
    * A = {#FSTYPE} matches @File systems for discovery
    * B = {#FSNAME} matches @Directorys to exclude from mounted file system discovery
    * C = {#FSNAME} matches @Match fsname root images

    This then started adding triggers for directories that the "Directorys to exclude from mounted file system discovery" expression was excluding, such as /srv /proc.

    I have also tried changing the Type of calculation to (A and B) or (A and C) however this produces the same result.

    If anyone could shed any light on this, it would be greatly appreciated.
  • duncan9562
    Member
    • Jan 2017
    • 46

    #2
    For those interested, the Type of calculation needed to be 'A and B and C'.

    Comment

    • tguest
      Junior Member
      • Oct 2014
      • 1

      #3
      Thanks for the information Duncan. Where do you define the list of directories to exclude?

      Comment

      Working...