install ncpa in windows 2003 server

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
supportcl
Posts: 39
Joined: Wed Oct 07, 2020 12:19 pm

install ncpa in windows 2003 server

Post by supportcl »

Hi, I need to install ncpa on a windows 2003 server.
To do this, install without problem the version https://assets.nagios.com/downloads/ncp ... -2.3.0.exe

The problem is that I don't know how to start it, nor how to configure it as a service.
Looking at the log I see the following

[06048] 2021/03/31 19:33:56.500 starting logging at level ERROR
[06048] 2021/03/31 19:33:57.421 Python exception encountered:
[06048] 2021/03/31 19:33:57.421 Internal Message: cannot import service module
[06048] 2021/03/31 19:33:57.421 Type => <type 'exceptions.ImportError'>
[06048] 2021/03/31 19:33:57.421 Value => DLL load failed: The specified procedure could not be found.
[06048] 2021/03/31 19:33:57.421 Traceback (most recent call last):

[06048] 2021/03/31 19:33:57.421 File "C:\ncpa\agent\ncpa_windows.py", line 15, in <module>

[06048] 2021/03/31 19:33:57.421 File "C:\ncpa\agent\passive\nrds.py", line 4, in <module>

[06048] 2021/03/31 19:33:57.421 File "C:\ncpa\agent\listener\server.py", line 11, in <module>

[06048] 2021/03/31 19:33:57.421 File "C:\ncpa\agent\listener\psapi.py", line 2, in <module>

[06048] 2021/03/31 19:33:57.421 File "C:\Python27\lib\site-packages\psutil\__init__.py", line 107, in <module>

[06048] 2021/03/31 19:33:57.421 File "C:\Python27\lib\site-packages\psutil\_pswindows.py", line 35, in <module>

[06048] 2021/03/31 19:33:57.421 File "ExtensionLoader_psutil__psutil_windows.py", line 25, in <module>

[06048] 2021/03/31 19:33:57.421 File "ExtensionLoader_psutil__psutil_windows.py", line 17, in __bootstrap__

[06048] 2021/03/31 19:33:57.421 ImportError: DLL load failed: The specified procedure could not be found.

[06048] 2021/03/31 19:33:57.421 ending logging
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: install ncpa in windows 2003 server

Post by ssax »

The only version of NCPA that works with Server 2003 is NCPA 1.8.1 which can be downloaded here:

https://assets.nagios.com/downloads/ncp ... -1.8.1.exe

That was the last version of NCPA that supported Server 2003.

You'll need to uninstall the current version on the 2003 system and install v1.8.1 in order for it to work.

Thank you!
supportcl
Posts: 39
Joined: Wed Oct 07, 2020 12:19 pm

Re: install ncpa in windows 2003 server

Post by supportcl »

Thank you, I have installed this new version without problems, now you see 2 services working and I have access to the web through https: // localhost: 5396

The problem is that this appears in the log

2021-04-01 13:22:53,898:INFO:__init__:Parsed config from: ['C:\\Program Files\\Nagios\\NCPA\\etc\\ncpa.cfg']
2021-04-01 13:22:53,898:INFO:__init__:Looking for plugins at: C:\Program Files\Nagios\NCPA\plugins
2021-04-01 13:22:53,898:INFO:__init__:Establishing passive handler: Handler
2021-04-01 13:22:53,914:ERROR:__init__:Invalid URL u'': No schema supplied. Perhaps you meant http://?
Traceback (most recent call last):
File "C:\ncpa\agent\ncpa_windows.py", line 192, in run_all_handlers
File "C:\Program Files\Nagios\NCPA\passive\nrds.py", line 37, in run
if self.config_update_is_required(nrds_url, nrds_token, nrds_config, nrds_config_version):
File "C:\Program Files\Nagios\NCPA\passive\nrds.py", line 135, in config_update_is_required
url_request = utils.send_request(nrds_url, **get_args)
File "C:\Program Files\Nagios\NCPA\passive\utils.py", line 13, in send_request
r = requests.post(url, data=kwargs, verify=False, allow_redirects=True)
File "C:\Python27\lib\site-packages\requests\api.py", line 88, in post
File "C:\Python27\lib\site-packages\requests\api.py", line 44, in request
File "C:\Python27\lib\site-packages\requests\sessions.py", line 349, in request
File "C:\Python27\lib\site-packages\requests\sessions.py", line 287, in prepare_request
File "C:\Python27\lib\site-packages\requests\models.py", line 287, in prepare
File "C:\Python27\lib\site-packages\requests\models.py", line 338, in prepare_url
MissingSchema: Invalid URL u'': No schema supplied. Perhaps you meant http://?
2021-04-01 13:22:53,914:INFO:__init__:Establishing passive handler: Handler
2021-04-01 13:22:53,914:INFO:__init__:Running check: /cpu/percent --warning 20 --critical 30
2021-04-01 13:22:54,976:INFO:__init__:Running check: /memory/swap/percent --warning 40 --critical 80
2021-04-01 13:22:54,976:INFO:__init__:Running check: /memory/virtual/percent --warning 60 --critical 80
2021-04-01 13:22:54,976:ERROR:__init__:Invalid URL u'/': No schema supplied. Perhaps you meant http:///?
Traceback (most recent call last):
File "C:\ncpa\agent\ncpa_windows.py", line 192, in run_all_handlers
File "C:\Program Files\Nagios\NCPA\passive\nrdp.py", line 112, in run
self.submit_to_nagios(checkresults)
File "C:\Program Files\Nagios\NCPA\passive\nrdp.py", line 165, in submit_to_nagios
ret_xml = utils.send_request(url=server, token=token, XMLDATA=checkresults, cmd='submitcheck')
File "C:\Program Files\Nagios\NCPA\passive\utils.py", line 13, in send_request
r = requests.post(url, data=kwargs, verify=False, allow_redirects=True)
File "C:\Python27\lib\site-packages\requests\api.py", line 88, in post
File "C:\Python27\lib\site-packages\requests\api.py", line 44, in request
File "C:\Python27\lib\site-packages\requests\sessions.py", line 349, in request
File "C:\Python27\lib\site-packages\requests\sessions.py", line 287, in prepare_request
File "C:\Python27\lib\site-packages\requests\models.py", line 287, in prepare
File "C:\Python27\lib\site-packages\requests\models.py", line 338, in prepare_url
MissingSchema: Invalid URL u'/': No schema supplied. Perhaps you meant http:///?
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: install ncpa in windows 2003 server

Post by ssax »

Please attach your ncpa.cfg file from the 2003 server.
supportcl
Posts: 39
Joined: Wed Oct 07, 2020 12:19 pm

Re: install ncpa in windows 2003 server

Post by supportcl »

there goes the file
You do not have the required permissions to view the files attached to this post.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: install ncpa in windows 2003 server

Post by ssax »

Edit your ncpa.cfg on the remote system and set this:

Code: Select all

handlers = nrds,nrdp
To this:

Code: Select all

handlers = 
Then restart the ncpa services.
supportcl
Posts: 39
Joined: Wed Oct 07, 2020 12:19 pm

Re: install ncpa in windows 2003 server

Post by supportcl »

I have made the change but it still does not work, when starting the service, it does not start.

2021-04-05 17: 01: 36,365: INFO: __ init __: Parsed config from: ['C: \\ Program Files \\ Nagios \\ NCPA \\ etc \\ ncpa.cfg']
2021-04-05 17: 01: 36,365: INFO: __ init __: Looking for plugins at: C: \ Program Files \ Nagios \ NCPA \ plugins
2021-04-05 17: 01: 36,365: ERROR: __ init __: 'passive.'
Traceback (most recent call last):
File "C: \ ncpa \ agent \ ncpa_windows.py", line 200, in start
File "C: \ ncpa \ agent \ ncpa_windows.py", line 185, in run_all_handlers
KeyError: 'passive.'

Why does it look for the ncpa agent in C: \ ncpa \?
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: install ncpa in windows 2003 server

Post by ssax »

Why does it look for the ncpa agent in C: \ ncpa \?

That's just the internal call, ignore it as it's not an issue, it does the same on mine.

Did you only change that line or did you change any others? If you changed anything else re-attach it.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: install ncpa in windows 2003 server

Post by tgriep »

Do you want to run Passive checks with the NCPA agent or Active checks?

If you only want to run active checks, then comment out the Passive section in the ncpa.cfg file as they are trying run and send data to the Nagios server but is it not setup to do so.

Either comment out the following section or delete it.

Code: Select all

[passive checks]
%HOSTNAME%|cpu usage = /cpu/percent --warning 20 --critical 30
%HOSTNAME%|swap usage = /memory/swap/percent --warning 40 --critical 80
%HOSTNAME%|memory usage = /memory/virtual/percent --warning 60 --critical 80
Save and restart the NCPA agent.


If you want to use passive checks, update the handlers line to the following.

Code: Select all

handlers = nrdp
Then under the [nrds] section, update the following settings to point to the Nagios server.
URL =
TOKEN =

To find those values, Login to the Nagios XI server and go to the Admin > Inbound Transfers and use these values for your NCPA configuration.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked