Ad Widget

Collapse

Exclude bind mounts

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • maxxer
    Member
    • Oct 2010
    • 80

    #1

    Exclude bind mounts

    Hi.
    I've googled around and seems an old topic, but couldn't find the correct way to handle it.
    I'd like to monitor an ISPConfig host which has a *lot* of bind mount points for local directories. Like this (from mtab):
    Code:
    /var/log/ispconfig/httpd/domain.com /var/www/clients/client207/web243/log none rw,bind 0 0
    I found I should change the "File system auto discovery" rule in order to exclude mount types I'd like to remove. So this is the default regexp in Zabbix 2.2:
    Code:
    ^(btrfs|ext2|ext3|ext4|jfs|reiser|xfs|ffs|ufs|jfs|jfs2|vxfs|hfs|ntfs|fat32|zfs)$
    which should already exclude bind mounts, which have mount type=none. In fact if I make a test with the regexp tester built into Zabbix webui the none value returns FALSE.
    So why is it still showing all those mountpoints?

    thanks
  • aib
    Senior Member
    • Jan 2014
    • 1615

    #2
    Correct me if I'm wrong - you tested only regexp with internal tester But you didn't try to create any LLD to discover the mounted filesystems on real server?
    Sincerely yours,
    Aleksey

    Comment

    • maxxer
      Member
      • Oct 2010
      • 80

      #3
      Originally posted by aib
      Correct me if I'm wrong - you tested only regexp with internal tester But you didn't try to create any LLD to discover the mounted filesystems on real server?
      you're right...

      Comment

      • aib
        Senior Member
        • Jan 2014
        • 1615

        #4
        There is my server.
        [root@server-13] ~# mount
        Code:
        /dev/ufs/FreeNASs2a on / (ufs, local, read-only)
        [B]devfs on /dev (devfs, local, multilabel)[/B]
        /dev/md0 on /etc (ufs, local)
        /dev/md1 on /mnt (ufs, local)
        /dev/md2 on /var (ufs, local)
        /dev/ufs/FreeNASs4 on /data (ufs, local, noatime, soft-updates)
        syspool on /mnt/syspool (zfs, local, nfsv4acls)
        syspool/.system on /mnt/syspool/.system (zfs, local, nfsv4acls)
        syspool/.system/cores on /mnt/syspool/.system/cores (zfs, local, nfsv4acls)
        syspool/.system/samba4 on /mnt/syspool/.system/samba4 (zfs, local, nfsv4acls)
        syspool/.system/syslog on /mnt/syspool/.system/syslog (zfs, local, nfsv4acls)
        pool-0 on /mnt/pool-0 (zfs, local, nfsv4acls)
        pool-0/dedup on /mnt/pool-0/dedup (zfs, local, nfsv4acls)
        pool-1 on /mnt/pool-1 (zfs, local, nfsv4acls)
        pool-1/dedup on /mnt/pool-1/dedup (zfs, local, nfsv4acls)
        Regular expression:
        Code:
        ^(btrfs|ext2|ext3|ext4|jfs|reiser|xfs|ffs|[B]ufs[/B]|jfs|jfs2|vxfs|hfs|ntfs|fat32|[B]zfs[/B]|nfs)$
        You can see that there is both UFS and ZFS, but DEVFS doesn't exist in my regexp.

        And the list of discovered items also contains all mounted filesystems exclude DEVFS:
        Attached Files
        Sincerely yours,
        Aleksey

        Comment

        • filipp.sudanov
          Senior Member
          Zabbix Certified Specialist
          • May 2014
          • 137

          #5
          If zabbix_agent is configured in passive mode, you can try to use zabbix_get tool to see the actual JSON with file system discovery data:

          Code:
          zabbix_get -s <server_address> -k vfs.fs.discovery
          Please check, if it outputs "{#FSTYPE}":"none" for your file systems.

          UPD: just tryed to create a bind mount on my system, it reports the file system as ext3:

          {"{#FSNAME}":"/tmp/bind_mount_test/binded_folder","{#FSTYPE}":"ext3"}

          I am not sure, if it's a correct behaviour for the agent, or not.
          Last edited by filipp.sudanov; 09-07-2014, 15:50.

          Comment

          • maxxer
            Member
            • Oct 2010
            • 80

            #6
            Originally posted by filipp.sudanov
            UPD: just tryed to create a bind mount on my system, it reports the file system as ext3:

            {"{#FSNAME}":"/tmp/bind_mount_test/binded_folder","{#FSTYPE}":"ext3"}

            I am not sure, if it's a correct behaviour for the agent, or not.
            Yes, it's returned as ext4!
            Can I exclude all paths with a certain regexp?
            Code:
            			"{#FSNAME}":"\/var\/www\/clients\/client76\/web85\/log",
            			"{#FSTYPE}":"ext4"},
            I should exclude all paths /var/www/clients/?/?/log

            Comment

            Working...