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.
Very usefull, it works, many thanks.
Will this exclude existing discovered virtfs?
Yes, it will rediscover the disks
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?
Please try restarting the zabbix-server service
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?
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?
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.
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 🙁
^(/sys/fs/cgroup|/run/lock|/dev/shm|/run/user|/run/user/0|/run|/virtfs|/var|/usr)$ [Result is FALSE]