From 7d3c0d3b76dad83fa75645f51a84a1a5fdf38c5e Mon Sep 17 00:00:00 2001 From: Ben Reedy Date: Wed, 2 Feb 2022 06:52:11 +1000 Subject: [PATCH] Add missing whitelist/blacklist checks for IIS Checks were removed in 82f17fd despite flags still being present. Signed-off-by: Ben Reedy --- collector/iis.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/collector/iis.go b/collector/iis.go index dc5d1f8d..461b0d0d 100644 --- a/collector/iis.go +++ b/collector/iis.go @@ -885,6 +885,10 @@ func (c *IISCollector) collectWebService(ctx *ScrapeContext, ch chan<- prometheu } for _, app := range WebService { + if app.Name == "_Total" || c.siteBlacklistPattern.MatchString(app.Name) || !c.siteWhitelistPattern.MatchString(app.Name) { + continue + } + ch <- prometheus.MustNewConstMetric( c.CurrentAnonymousUsers, prometheus.GaugeValue, @@ -1159,6 +1163,12 @@ func (c *IISCollector) collectAPP_POOL_WAS(ctx *ScrapeContext, ch chan<- prometh } for _, app := range APP_POOL_WAS { + if app.Name == "_Total" || + c.appBlacklistPattern.MatchString(app.Name) || + !c.appWhitelistPattern.MatchString(app.Name) { + continue + } + for key, label := range applicationStates { isCurrentState := 0.0 if key == uint32(app.CurrentApplicationPoolState) {