Page 1 of 1

ncpa 3.0.0 not handling duplicate entries in configuration

Posted: Thu Nov 16, 2023 7:21 am
by CBoekhuis
Hello,

today we installed ncpa-3.0.0-latest.x86_64 on our nagiosxi server ( test environment Red Hat Enterprise Linux release 8.9 (Ootpa)).

We got error messages from systemd:

nagiosxi_test:root:/root> systemctl status ncpa
● ncpa.service - NCPA
Loaded: loaded (/usr/lib/systemd/system/ncpa.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2023-11-16 11:55:57 CET; 7s ago
Docs: https://www.nagios.org/ncpa
Process: 16830 ExecStart=/usr/local/ncpa/ncpa -n (code=exited, status=255)
Main PID: 16830 (code=exited, status=255)

Nov 16 11:55:57 nagiosxi_test ncpa[16830]: File "console.py", line 16, in run
Nov 16 11:55:57 nagiosxi_test ncpa[16830]: File "ncpa.py", line 1111, in <module>
Nov 16 11:55:57 nagiosxi_test ncpa[16830]: File "ncpa.py", line 1045, in main
Nov 16 11:55:57 nagiosxi_test ncpa[16830]: File "ncpa.py", line 894, in get_configuration
Nov 16 11:55:57 nagiosxi_test ncpa[16830]: File "configparser.py", line 713, in read
Nov 16 11:55:57 nagiosxi_test ncpa[16830]: File "configparser.py", line 1112, in _read
Nov 16 11:55:57 nagiosxi_test ncpa[16830]: configparser.DuplicateOptionError: While reading from '/usr/local/ncpa/etc/ncpa.cfg' [line 375]: option '.sh' in secti>
Nov 16 11:55:57 nagiosxi_test ncpa[16830]: ***** Starting NCPA version: 3.0.0
Nov 16 11:55:57 nagiosxi_test systemd[1]: ncpa.service: Main process exited, code=exited, status=255/n/a
Nov 16 11:55:57 nagiosxi_test systemd[1]: ncpa.service: Failed with result 'exit-code'.

After looking at the file we see the following :

# Linux / Mac OS X
.sh = /bin/sh $plugin_name $plugin_args
.py = python3 $plugin_name $plugin_args
.pl = perl $plugin_name $plugin_args
.php = php $plugin_name $plugin_args

# Windows
.ps1 = powershell -ExecutionPolicy Bypass -File $plugin_name $plugin_args
.vbs = cscript $plugin_name $plugin_args //NoLogo
.wsf = cscript $plugin_name $plugin_args //NoLogo
.bat = cmd /c $plugin_name $plugin_args
.sh = /bin/bash $plugin_name $plugin_args

I managed to start the ncpa service by moving the .sh line in the windows section to the Linux and deleting the line in de Linux section.

Question to you is : is this correct? And why is this not corrected by the installer.

Mean while we have stopped enrolment of the new release.

With kind regards,

Christian

Re: ncpa 3.0.0 service not starting

Posted: Thu Nov 16, 2023 11:17 am
by jmichaelson
Christian, I have a hunch that the answer is that it isn't correct.

Please file an issue in the NCPA GitHub repository here: https://github.com/NagiosEnterprises/ncpa

Re: ncpa 3.0.0 service not starting

Posted: Tue Nov 21, 2023 11:59 am
by bbahn
It seems that this is an issue of having duplicate entries in the plugin extensions. If you'd like, I can create an issue to allow NCPA to handle duplicate file extensions. The configuration does not ship in that state however and it's not intended to have duplicates in the configuration. Please respond here with @bbahn if you would like me to handle this.

Re: ncpa 3.0.0 service not starting

Posted: Thu Nov 23, 2023 8:53 am
by CBoekhuis
I have post an issue on github.

Re: ncpa 3.0.0 service not starting

Posted: Sun Dec 17, 2023 11:34 pm
by SageKilback
CBoekhuis wrote: Thu Nov 23, 2023 8:53 am I have post an issue on github.geometry dash 23
Can you share that link?

Re: ncpa 3.0.0 service not starting

Posted: Mon Dec 18, 2023 2:41 am
by CBoekhuis

Re: ncpa 3.0.0 service not starting

Posted: Thu Jan 04, 2024 3:54 am
by bekean23
Thanks for sharing!

Re: ncpa 3.0.0 service not starting

Posted: Wed Jan 31, 2024 12:24 am
by LoriaShideler
Thank you very much for providing