How to exclude virtfs or any Mount Point from Zabbix Filesystem Discovery

How to exclude virtfs or any Mount Point from Zabbix Filesystem Discovery

I was configuring Zabbix for our cPanel servers. A few years back I had configured Zabbix with Manual mount points. But this time, I want to use the File System Discovery to make the setup easier for the team.

The default configuration of Zabbix will detect all the virtfs mount point from the cPanel servers but this is not needed for us since virtfs mount points are just hardlinks in cPanel.

 

Below is the configuration  I have done on my Zabbix, Please feel free to comment if you need any help on the configuration.

Define the  Regular Expressions

Administration >> General >> Regular Expressions (Right hand side DropDown)

New Regular Expression
Name : File systems for discovery exclude
Expressions:
Result is FALSE
/virtfs/ 

2. Modify the Filesystem Discovery In template.

Switch to the Template you are using. In mycase Template OS Linux

Configuration >> Templates >> Click on the template you are using of you are not using any custom one, it should be Template OS Linux

Click on Discovery Rules >> Mounted filesystem discovery

On the window, Click on FIlters

Modify the below settings

Type of calculation: AND

Filters: Add a new one

Label Macro {#FSNAME}

Regular expression: @File systems for discovery exclude  

Click on Add and the Update. Now it should look like the below.

If you dont want to wait for another 1hour to reflect the same.

Modify the Update interval in Discovery Rules to be 2m or 5m to see the changes fast. Revert it back once the rule is tested and verified.

 

 


9 thoughts on “How to exclude virtfs or any Mount Point from Zabbix Filesystem Discovery”

  • 1
    Petra on June 11, 2019 Reply

    Very usefull, it works, many thanks.

  • 2
    James on April 1, 2020 Reply

    Will this exclude existing discovered virtfs?

    • 3
      Jobin Joseph on April 2, 2020 Reply

      Yes, it will rediscover the disks

      • 4
        James on April 2, 2020 Reply

        Thanks for your reply. I follow instructions. It’s been 24 hours and all /virtfs/ are still not removed.

        Here are screenshots of the settings per guide and the test results:
        https://imgur.com/a/IpIa04a

        Any ideas?

        • 5
          Jobin Joseph on April 2, 2020 Reply

          Please try restarting the zabbix-server service

          • 6
            James on April 2, 2020

            yes, did that yesterday both server and agent.

            Maybe discovery exclusion only works when adding *new* hosts?

            Do I need to delete the other existing filters?

          • 7
            Jobin Joseph on April 2, 2020

            Rules are changed to the Template and it will be applied to any host using the same template.
            In your case, please check if you are modifying the Discovery rule on the Template you are using for the registered host?

  • 8
    James on April 3, 2020 Reply

    This does not removing the virtfs/. However, if I delete and clean teamplate and re-add. Then it works by way of exclusion. But does not affect existing hosts. Hope this helps.

  • 9
    Paul on September 3, 2020 Reply

    I would like to exclude mount points on Windows for user profiles. The discovery looks like this:
    [
    {
    “{#FSNAME}”: “C:”,
    “{#FSTYPE}”: “NTFS”,
    “{#FSDRIVETYPE}”: “fixed”
    },
    {
    “{#FSNAME}”: “D:”,
    “{#FSTYPE}”: “UNKNOWN”,
    “{#FSDRIVETYPE}”: “cdrom”
    },
    {
    “{#FSNAME}”: “E:”,
    “{#FSTYPE}”: “CDFS”,
    “{#FSDRIVETYPE}”: “cdrom”
    },
    {
    “{#FSNAME}”: “C:\\Users\\user1”,
    “{#FSTYPE}”: “NTFS”,
    “{#FSDRIVETYPE}”: “fixed”
    },
    {
    “{#FSNAME}”: “C:\\Users\\users2”,
    “{#FSTYPE}”: “NTFS”,
    “{#FSDRIVETYPE}”: “fixed”
    }
    ]

    I want to exclude the users part since those are Remote Desktop Profile Disks.

    I added a new regular expression with /Users/ and put it on Result is False as you mentioned.
    Then I updated the discovery and added the filter just like you do but it does not exclude the mount points 🙁

Leave a Reply

Your email address will not be published. Required fields are marked *