After each time when i restart my system, i have to restart the Nagios process manually. I need to add enable this can be done automatically? Please suggest step by step::
* I am using Ubuntu 15.04 (GNU/Linux 3.16.0-36-generic x86_64)
Nagios process failed to auto-start during system boot
Nagios process failed to auto-start during system boot
Regards
Sazzad
Sazzad
Re: Nagios process failed to auto-start during system boot
Which version of Nagios are you trying to install? Are you following a guide for the install (provide the link) or how did you install it?
Re: Nagios process failed to auto-start during system boot
I am using nagios 4.0.8 Version. I just followed bellow link to install NAGIOS::
http://sharadchhetri.com/2014/08/25/ins ... 14-04-lts/
http://sharadchhetri.com/2014/08/25/ins ... 14-04-lts/
Regards
Sazzad
Sazzad
-
jdalrymple
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Nagios process failed to auto-start during system boot
By what means are you starting the process?
Are you calling the binary or are you using an init script? It looks like SUSE recently quit working with our init scripts altogether and perhaps you're in the same boat.
Are you calling the binary or are you using an init script? It looks like SUSE recently quit working with our init scripts altogether and perhaps you're in the same boat.
Re: Nagios process failed to auto-start during system boot
After each time my server restarted i need to manually restart the process using following command:
As per my guide line there is a script at
I beleive this script is no longer working. What should modification can do the resoluation? Or please do suggest some possible way to fix it.
Code: Select all
sudo service nagios restart/etc/init/nagios.conf
Code: Select all
description "nagios 4.x core"
start on filesystems
stop on runlevel [1246]
respawn
setuid nagios
setgid nagcmd
console log
script
exec /usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg
end scriptRegards
Sazzad
Sazzad
Re: Nagios process failed to auto-start during system boot
Here's what I had to do to get it running:
Create /etc/systemd/system/nagios.service with the contents below:
Then:
Create /etc/systemd/system/nagios.service with the contents below:
Code: Select all
[Unit]
Description=Nagios
BindTo=network.target
[Install]
WantedBy=multi-user.target
[Service]
User=nagios
Group=nagios
Type=simple
ExecStart=/usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg
Code: Select all
sudo systemctl enable /etc/systemd/system/nagios.serviceRe: Nagios process failed to auto-start during system boot
Thanks a lot. It works. Would you mind to describe me a little bit about this steps? It would help me to make similiar script for my other services as well.
Again thanks a lot!
Admin can close this thread!

Again thanks a lot!
Admin can close this thread!
Regards
Sazzad
Sazzad
-
jdalrymple
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Nagios process failed to auto-start during system boot
I'll expand on ssax's answer a bit. Here is some a more thorough systemd script:
It actually leverages the logic we have built into the original init script so you can use it to reload your daemon after you've changed configs ... safely. You will need to relocate /etc/init.d/nagios to the path shown (/usr/lib/systemd/scripts/).
Documentation on creating these files is here:
http://www.freedesktop.org/software/sys ... rvice.html
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.targetDocumentation on creating these files is here:
http://www.freedesktop.org/software/sys ... rvice.html