NCPA 1.7.2 Agent, check_ncpa.py, and Wizard problems

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
mp4783
Posts: 116
Joined: Wed May 14, 2014 11:11 am

NCPA 1.7.2 Agent, check_ncpa.py, and Wizard problems

Post by mp4783 »

I'm attempting to test the functionality of the NCPA agent. I am using the 1.7.2 agent on a Windows 2012 server. On my Nagios XI 2014R1.5 server, I have the NSCA Agent configuration installed.

I have read the documentation regarding "active" monitoring of Windows servers via the NCPA agent. The documentation shows the first step in the wizard which should have four options

Address: The IP address or FQDNS name of the NCPA Agent.
Port: Defaults to port 5693.
Token: Authentication token used to connect to the NCPA Agent.
Authorization Mode: HTTP or HTTPS

I do not see "Authorization Mode" in my GUI.

The problem here is that upon installation of the NCPA agent on the Windows server, it generated a self-signed certificate which I assume the Nagios XI server has no idea how to accept. Because the option to switch to insecure (HTTP) authorization is not present, the wizard fails every time.

If I open the NCPA agent web page on the Windows server, I have to accept the insecure SSL certficate as an exception. Once that is done, I can see all of the pages (including the very cool realtime monitors), so I know the agent can respond.

I have executed curl commands from the Nagios server using the "-k" option and the agent responds as expected.

I have attempted to use the check_ncpa.py plugin (latest version from GitHub), but I always get the following:

Code: Select all

nagios01:/usr/local/nagios/libexec# ./check_ncpa.py -s -H labws2012.domain.com -P 5693 -t token -M 'disk/logical/C:\|/used_percent' -w 85 -c 95
The stack trace:Traceback (most recent call last):
  File "./check_ncpa.py", line 263, in main
    info_json = get_json(options)
  File "./check_ncpa.py", line 207, in get_json
    url = get_url_from_options(options)
  File "./check_ncpa.py", line 133, in get_url_from_options
    arguments = get_arguments_from_options(options)
  File "./check_ncpa.py", line 193, in get_arguments_from_options
    if options.query_args:
AttributeError: Values instance has no attribute 'query_args'
I also note that there are no default plugins installed with the NCPA 1.7.2 agent and there's really no reference to where they can be found. Should we use plugins from the NSClient++? Where are the equivalent of the NRPE plugins?

Thanks.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: NCPA 1.7.2 Agent, check_ncpa.py, and Wizard problems

Post by lmiltchev »

I do not see "Authorization Mode" in my GUI.
I believe this document needs to be updated. This screenshot is from the "old" wizard. The "Authorization Mode" doesn't exist in the new wizard (I am using ver. 1.3.1).

Can you access the client on port 5693 from your Nagios XI server? Can you run the following command and show us the output:

Code: Select all

nmap <client ip> -p 5693
Can you also try running the following?

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H <client ip> -t 'token' -P 5693 -M 'disk/logical/C:|/used_percent' -w 85 -c 95
I also note that there are no default plugins installed with the NCPA 1.7.2 agent and there's really no reference to where they can be found. Should we use plugins from the NSClient++? Where are the equivalent of the NRPE plugins?
You have a few options. You can place any plugins that you would like to use in the "C:\Program Files (x86)\Nagios\NCPA\plugins" folder and leave the "plugin_path" directive in the ncpa.cfg file as is:

Code: Select all

[plugin directives]
plugin_path = plugins/
or you can modify the path to point to a different folder (perhaps to "C:\Program Files\NSClient++\scripts"). You will need to restart the NCPA agent (listener and passive), so that changes can take effect.

Hope this helps.
Be sure to check out our Knowledgebase for helpful articles and solutions!
mp4783
Posts: 116
Joined: Wed May 14, 2014 11:11 am

Re: NCPA 1.7.2 Agent, check_ncpa.py, and Wizard problems

Post by mp4783 »

Here's the nmap output:

Code: Select all

nagios01:/usr/local/nagios/libexec# nmap -p5693 labws2012.domain.com

Starting Nmap 5.51 ( http://nmap.org ) at 2015-04-03 17:53 GMT
Nmap scan report for labws2012.domain.com (200.70.52.207)
Host is up (0.00073s latency).
PORT     STATE SERVICE
5693/tcp open  unknown
MAC Address: 00:29:F0:22:5Q:AB (VMware)

Nmap done: 1 IP address (1 host up) scanned in 5.74 seconds
I ran the check_ncpa.py command as the apache, nagios, and root user and all three returned the same:

Code: Select all

The stack trace:Traceback (most recent call last):
  File "/usr/local/nagios/libexec/check_ncpa.py", line 263, in main
    info_json = get_json(options)
  File "/usr/local/nagios/libexec/check_ncpa.py", line 207, in get_json
    url = get_url_from_options(options)
  File "/usr/local/nagios/libexec/check_ncpa.py", line 133, in get_url_from_options
    arguments = get_arguments_from_options(options)
  File "/usr/local/nagios/libexec/check_ncpa.py", line 193, in get_arguments_from_options
    if options.query_args:
AttributeError: Values instance has no attribute 'query_args'
I don't think there's any doubt that the NCPA agent is working properly. We have two issues here, one with the Nagios NCPA Agent wizard not working and the other with the check_ncpa.py command not working. For all I know, they could be both be related to the SSL certificate.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: NCPA 1.7.2 Agent, check_ncpa.py, and Wizard problems

Post by tmcdonald »

I know we are working on a v1.8 of NCPA and the wizard will likely be worked on as well, I am just not sure of an exact release date. I'll see if the devs can weigh in.
Former Nagios employee
mp4783
Posts: 116
Joined: Wed May 14, 2014 11:11 am

Re: NCPA 1.7.2 Agent, check_ncpa.py, and Wizard problems

Post by mp4783 »

An error message in the Apache logs gave me a clue as to why the wizard is failing. The OpenSSL PHP extension is not installed, but I think is probably required. I'll see if I can install it and solve the problem.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: NCPA 1.7.2 Agent, check_ncpa.py, and Wizard problems

Post by ssax »

Sounds good, let us know if that solves it.
Locked