ncpa 3.0.0 not handling duplicate entries in configuration
Posted: Thu Nov 16, 2023 7:21 am
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
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