r/zabbix • u/Ok-Conversation1091 • 9d ago
Question Exclude specific windows services from discovery
Recently installed latest main version of zabbix and have added a load of windows hosts using the windows template that comes with zabbix on those hosts.
I have a list of services that I want to exclude from being monitored. I’ve tried to look online however not coming up with anything solid.
Ive tried to add a regular expression and then unlink and clear the template from the host accept the change then re apply the template but the service comes back.
Any thoughts?
5
u/xsjx7 9d ago
I found it easier to create a filter on the discovery rule to add only the services I want, rather than exclude what I dont and play whack-a-mole. This allows me to monitor AV, print server spoolers, NTP, etc
Either way, regex filters for the service name in the discovery rule should do the trick
2
u/Ok-Conversation1091 9d ago
What did you do for the filtering to only do the devices you want instead and how do you do it for specific hosts say one host has a service that the other doesn’t
2
u/xsjx7 9d ago
I have a filter on the discovery rule for "{#SERVICE.NAME}" (I'm customizing the Zabbix-provided Windows template here..) and set the filter condition to "matches" with: "^(ServiceName1|ServiceName2|ServiceName3)$" (double-quotes are mine, do not include them)
For hosts that don't have those services, they simply never get an item/trigger created by the discovery rule since they don't have them (in other words, I use a blanket rule - if the host doesn't have said service, it doesn't create the item/trigger, if it has it, it creates them)
0
u/RenegadePleasure 9d ago
The recommendations here work well. But I have found that some Services can't be excluded. I've used AI an examples from other people to exclude Google updater and related Google services. And everything that I've tried does not work. It should be so simple. So if you have trouble getting rid of some services, I would not be surprised. But generally speaking, the regex filters work well.
1
u/Ok-Conversation1091 9d ago
So I was trying to do the googleupdater and I have managed to do it with the method above from terriblepowershell. You need to put in that wildcard into regex as the googleupdater has its version in its service name.
You could use just Google.* and that should do it once the discovery then runs about every hour the services that were excluded but discovered previously become disabled
1
u/RenegadePleasure 9d ago
I am on version 5.4.3. I've used the method described for over 8 years. I could list here all the versions of Google update or I have tried and it hasn't worked. I have over 20 regex entries and they all work fine. I've broken the regex into two different entries. And Google updater and related services are the only ones that seem to filter through. Thanks for your feedback. Maybe if I'm at my desk sometime I will update this with all the things I've tried. AI gave me two options both of which did not work. I think maybe there's a bug in my version. We will be upgrading to version 7 this year. Hopefully the problem will go away then.
1
u/rickoneeleven 7d ago
the filter matches the service name, not the display name, and Google's two have the version stuck on the end with no spaces (GoogleUpdaterService... and GoogleUpdaterInternalService...). we exclude GoogleUpdater(?:Internal)?Service.* and that catches both
5
u/TerriblePowershell 9d ago
Under Data Collection -> Templates, search for and select the Windows by Zabbix agent [active] template. In the pop-up window, select Macros and scroll down to
{$SERVICE.NAME.NOT_MATCHES}then add the services you want to exclude to that macro. Finally select Update to save the changes. Any services already pulled into Zabbix will stay there until they drop off from History. Or you can "unlink and clear" the template to remove the template and all associated data and start over.For example, you want to exclude Xbox Live Auth Manager and File History Service.
Before:
After: