service nagios start failed

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

service nagios start failed

Postby donnyforbes » Wed Jun 14, 2017 9:09 am

Moderator Edit: This thread has been split from another - viewtopic.php?f=7&t=21721
In the future, please create a new thread and link to the old one instead of adding on.


I have done the the following script in the following /etc/systemd/system/nagios.service

[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

Then did the following:
[root@nag nagios]# systemctl stop nagios
[root@nag nagios]# systemctl start nagios
Job for nagios.service failed because the control process exited with error code. See "systemctl status nagios.service" and "journalctl -xe" for details.

Can you please assist me with this? I am running CentOS Linux release 7.0.1406 (Core) and nagios 4.3.2 core.
donnyforbes
 
Posts: 244
Joined: Tue Jun 13, 2017 2:17 pm

Re: service nagios start failed

Postby tgriep » Thu Jun 15, 2017 12:33 pm

Try using the following in the nagios.service file for starting / stoping the Nagios Daemon.
Adjust the paths as needed.
Code: Select all
[Unit]
Description=Nagios Network Monitoring
After=network.target
Documentation=https://www.nagios.org/documentation/

[Service]
Type=forking
User=nagios
Group=nagios
PIDFile=/var/run/nagios/nagios.pid
# Verify Nagios config before start as upstream suggested
ExecStartPre=/usr/sbin/nagios -v /etc/nagios/nagios.cfg
ExecStart=/usr/sbin/nagios -d /etc/nagios/nagios.cfg
ExecStopPost=/usr/bin/rm -f /var/spool/nagios/cmd/nagios.cmd


[Install]
WantedBy=multi-user.target
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
 
Posts: 6019
Joined: Thu Oct 30, 2014 9:02 am


Return to Nagios Core

Who is online

Users browsing this forum: No registered users and 4 guests