Page 1 of 1

NCPA Windows Service Monitoring with regex Filtering

Posted: Wed Oct 02, 2019 10:38 am
by onegative
G 'Day Nagios Support,

So I have recently discovered that if you attempt to monitor Windows Services using a regex Filter services that are disabled within Windows are still identified and alarmed upon...this really makes the regex Filter useless when trying to monitor something like MSSQL services because those services are not always utilized together.

Case in point...since the services SQLSERVERAGENT and SQLBrowser are Disabled, they should be dropped from the regex Filter before processing for Status. Otherwise what good is using the regex Filter unless all matching services are running even though you do not want them to be. This really should have been caught in QA from the beginning of the release. Looking at the recent ChangeLog for versions 2.1.7, 2.1.8 and/or 2.1.9 there is no mention of this fix being addressed. Please test my assertion to verify my findings and then please submit a bugfix for Jake if you confirm.

Many Thanks,
Danny

NCPA AGENT VERSION
ncpa_version.png
Windows Service Configuration
service_configuration.png
Run as Nagios Check in API
service_api_endpoint.png

Re: NCPA Windows Service Monitoring with regex Filtering

Posted: Wed Oct 02, 2019 2:31 pm
by lmiltchev
This is not a bug... NCPA checks if ALL of the services that match the regex query are running. If some if them are NOT running, you would get a non-ok state, regardless of whether they are disabled or stopped. You could add a feature request for removing disabled services from the query here:

https://github.com/NagiosEnterprises/ncpa/issues

As a "workaround", you could search for SQLWriter and MSSQLSERVER in the service filters with exact match.

Hope this helps.

Re: NCPA Windows Service Monitoring with regex Filtering

Posted: Fri Nov 08, 2019 1:29 pm
by onegative
I understand that I can specify each and every service independently...that is not my problem.

Using a regex filter allows for less work...but not filtering out Disable Services completely breaks the point of having the regex option in the first place.

I DO NOT agree with your assessment, and I think if the developers really think about it they would agree with my thinking...

Anyway, you can lock this thread.

And as always thanks for your help,
Danny

Re: NCPA Windows Service Monitoring with regex Filtering

Posted: Fri Nov 08, 2019 3:12 pm
by jomann
I understand your argument here but the reason that we allow showing all the services (including those disabled) is in order for people to monitor services that are disabled and may be enabled by someone, etc. This just makes sense that we list them all by default. I've added an issue you can follow here: https://github.com/NagiosEnterprises/ncpa/issues/593 on github as a feature/enhancement to allow checks to specifically not show disabled services.

I'll go ahead and lock the thread.