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.

 

 

0 0 votes
Article Rating
Subscribe
Notify of
guest
10 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Petra
Petra
4 years ago

Very usefull, it works, many thanks.

James
James
3 years ago

Will this exclude existing discovered virtfs?

James
James
3 years ago
Reply to  Jobin Joseph

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?

James
James
3 years ago
Reply to  Jobin Joseph

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?

James
James
3 years ago

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.

Paul
Paul
3 years ago

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 🙁

Hasan
Hasan
1 year ago

^(/sys/fs/cgroup|/run/lock|/dev/shm|/run/user|/run/user/0|/run|/virtfs|/var|/usr)$ [Result is FALSE]

10
0
Would love your thoughts, please comment.x
()
x
Scroll to Top