Page 1 of 1

NCPA Passive for Windows Service Issue

Posted: Fri Sep 29, 2017 2:02 pm
by onegative
G 'Day Customer Support,

So I am really trying to establish my standards for using the NCPA in Passive configuration mode.

So I have run into a snag...seems like I cannot determine a proper format to define within the passive cfg file to recognize service names that contain spaces.

SERVICE_NAME: BMC Remote Service Monitor

Formats tested and all failed.

%HOSTNAME%|Custom06 = /services --service BMC%20Remote%20Service%20Monitor --check true --status running
%HOSTNAME%|Custom07 = /services --service "BMC%20Remote%20Service%20Monitor" --check true --status running
%HOSTNAME%|Custom08 = /services --service 'BMC%20Remote%20Service%20Monitor' --check true --status running
%HOSTNAME%|Custom09 = /services --service BMC Remote Service Monitor --check true --status running
%HOSTNAME%|Custom10 = /services --service "BMC Remote Service Monitor" --check true --status running
%HOSTNAME%|Custom11 = /services --service 'BMC Remote Service Monitor' --check true --status running

How can we get Service Names that contain spaces to be recognized in the passive config files? All my service names that contain no spaces function exactly as expected.

Please help and as always many thanks,
Danny

Re: NCPA Passive for Windows Service Issue

Posted: Fri Sep 29, 2017 3:07 pm
by cdienger
Make sure you have the right service name and not just the display name. Opening up Windows' services and looking at the properties of the BMC Remote Service Monitor service will show you the service name at the very top of the General tab. You can also open the local browser to https://localhost:5693, go to the API section, and select services for the API Endpoint to get a list of services. Using the "Run as a Nagios check" will give you the option of viewing the correct format to use for active and passive checks.

Re: NCPA Passive for Windows Service Issue

Posted: Fri Sep 29, 2017 4:05 pm
by onegative
Yes I do in fact have the correct Service Name. As displayed from the Properties from Service Manager.

Also this is the latest 2.0.5 NCPA agent. I didn't test earlier but the API section from the agent is not displaying anything...but all other tabs are showing data...just the API section completes with no json data displaying...makes me think there is an issue with the 2.0.5 version. I tried it on multiple hosts with the same results for the 2.0.5 version...no joy for the API section of the Web GUI.

:cry:

I will install 2.0.3 which is working on other hosts...perhaps someone should try the 2.0.5 version and its gui api url.

Anyway will let you know once I get the 2.0.3 version back on this server.

Thanks,
Danny

Re: NCPA Passive for Windows Service Issue

Posted: Mon Oct 02, 2017 10:48 am
by lmiltchev
Can you try setting up the following service definition:

Code: Select all

%HOSTNAME%|BMC Remote Service Monitor = services?service=BMC%20Remote%20Service%20Monitor&status=running
then saving your config file, exiting, and restarting the "NCPA Passive" service?

I tested a similar service (with spaces in the name/description) with NCPA ver. 2.0.5, and it seems to be running just fine.

My service definition:

Code: Select all

%HOSTNAME%|AMD External Events Utility = services?service=AMD%20External%20Events%20Utility&status=running
In the GUI:
example01.PNG
Update: Actually, instead of using "%20", use "+".

Example:

Code: Select all

%HOSTNAME%|BMC Remote Service Monitor = services?service=BMC+Remote+Service+Monitor&status=running

Re: NCPA Passive for Windows Service Issue

Posted: Mon Oct 02, 2017 11:04 am
by onegative
OK after further investigation...I determined the following:

First and foremost! Internet Explorer sucks! It was preventing the json data from being displayed via the agent's gui api tab. Installed Mozilla and viola!

So where does the documentation describing the use of "+" sign for space substitution? That seems extremely strange to me and personally I would have never thought to use it.

Since I choose to utilize match=regex this request can be closed as the regex solution is functional and it is not often that Windows Services names have spaces.

Thanks,
Danny


Does not work!

Code: Select all

%HOSTNAME%|Custom06 = /services --service BMC Remote Service Monitor --check true --status running

%HOSTNAME%|Custom06 = services?service=BMC Remote Service Monitor&status=running
[/color]


Does work!

Code: Select all

%HOSTNAME%|Custom06 = /services --service BMC --match regex --check true --status running

%HOSTNAME%|Custom06 = services?service=BMC&match=regex&status=running

%HOSTNAME%|Custom06 = /services --service BMC+Remote+System+Monitor --check true --status running

%HOSTNAME%|Custom06 = services?service=BMC+Remote+System+Monitor&status=running
[/color]

Re: NCPA Passive for Windows Service Issue

Posted: Mon Oct 02, 2017 11:04 am
by lmiltchev
FYI - I just posted a new issue on GitHub here: https://github.com/NagiosEnterprises/ncpa/issues/390
So where does the documentation describing the use of "+" sign for space substitution? That seems extremely strange to me and personally I would have never thought to use it.
It doesn't. I believe that spaces in names should be handled automatically, and you don't need to add pluses. I consider this to be a bug. Jake is aware of the issue, and he will be fixing it as soon as he can. Feel free to make any comments/suggestions on GitHub.