Failed to start Nagios Core Service on CentOS 7

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
karlossimo
Posts: 1
Joined: Sat Oct 12, 2019 9:52 am

Failed to start Nagios Core Service on CentOS 7

Post by karlossimo »

I have deployed Nagios Core on a CentOS 7 server. I have followed all the commands as listed on the installation guide

https://assets.nagios.com/downloads/nag ... entos7.pdf

Everything has gone fine but when I try to start the Nagios service using the command

Code: Select all

sudo service nagios start
I get the following error:

Starting nagios (via systemctl): Job for nagios.service failed because the control process exited with error code. See "systemctl status nagios.service" and "journalctl -xe" for details.
[FAILED]


systemctl status nagios.service INFO
● nagios.service - Nagios Core Monitoring Daemon
Loaded: loaded (/etc/systemd/system/nagios.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sun 2019-10-13 01:20:42 ACDT; 6s ago
Process: 63865 ExecStart=/usr/lib/systemd/scripts/nagios start (code=exited, status=203/EXEC)

Oct 13 01:20:42 localhost.localdomain systemd[1]: Starting Nagios Core Monitoring Daemon...
Oct 13 01:20:42 localhost.localdomain systemd[1]: nagios.service: control process exited, code=exited status=203
Oct 13 01:20:42 localhost.localdomain systemd[1]: Failed to start Nagios Core Monitoring Daemon.
Oct 13 01:20:42 localhost.localdomain systemd[1]: Unit nagios.service entered failed state.
Oct 13 01:20:42 localhost.localdomain systemd[1]: nagios.service failed.
Warning: nagios.service changed on disk. Run 'systemctl daemon-reload' to reload units.

journalctl -xe INFO
Oct 13 01:20:42 localhost.localdomain sudo[63843]: karl : TTY=pts/0 ; PWD=/tmp/nagios-plugins-2.1.1 ; USER=root ; COMMAND=/sbin/service nagios start
Oct 13 01:20:42 localhost.localdomain sudo[63843]: pam_unix(sudo:session): session opened for user root by karl(uid=0)
Oct 13 01:20:42 localhost.localdomain polkitd[707]: Registered Authentication Agent for unix-process:63859:961913 (system bus name :1.161 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/
Oct 13 01:20:42 localhost.localdomain systemd[1]: Starting Nagios Core Monitoring Daemon...
-- Subject: Unit nagios.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/li ... temd-devel
--
-- Unit nagios.service has begun starting up.
Oct 13 01:20:42 localhost.localdomain systemd[63865]: Failed at step EXEC spawning /usr/lib/systemd/scripts/nagios: No such file or directory
-- Subject: Process /usr/lib/systemd/scripts/nagios could not be executed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/li ... temd-devel
--
-- The process /usr/lib/systemd/scripts/nagios could not be executed and failed.
--
-- The error number returned by this process is 2.
Oct 13 01:20:42 localhost.localdomain systemd[1]: nagios.service: control process exited, code=exited status=203
Oct 13 01:20:42 localhost.localdomain systemd[1]: Failed to start Nagios Core Monitoring Daemon.
-- Subject: Unit nagios.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/li ... temd-devel
--
-- Unit nagios.service has failed.
--
-- The result is failed.
Oct 13 01:20:42 localhost.localdomain systemd[1]: Unit nagios.service entered failed state.
Oct 13 01:20:42 localhost.localdomain systemd[1]: nagios.service failed.
Oct 13 01:20:42 localhost.localdomain polkitd[707]: Unregistered Authentication Agent for unix-process:63859:961913 (system bus name :1.161, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, l
Oct 13 01:20:42 localhost.localdomain sudo[63843]: pam_unix(sudo:session): session closed for user root

I also created a file /etc/systemd/system/nagios.service as per some recommendations from ohter discussions as I was previously getting a error code 1 before.

nagios.service INFO

Code: Select all

[Unit]
Description=Nagios Core Monitoring Daemon
After=network.target

[Service]
User=nagios
Group=nagios
Type=forking
ExecStart=/usr/lib/systemd/scripts/nagios start
ExecStop=/usr/lib/systemd/scripts/nagios stop
ExecReload=/usr/lib/systemd/scripts/nagios reload

[Install]
WantedBy=multi-user.target

Any help would be greatly appreciated
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Failed to start Nagios Core Service on CentOS 7

Post by benjaminsmith »

Hello,

Would you be able to try again using the instructions below as they are the most up-to-date?

Nagios Core - Installing Nagios Core From Source
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked