Page 1 of 2

restarting nagios through web does not reload config.

Posted: Mon Aug 18, 2014 9:44 am
by Conz
I've been having this problem for a while now since the upgrade to 4.x, I use nagiosql to edit our configuration but when I'm done I have to use the console to restart Nagios or it will not pick up on changes.
It restarts the service but for some reason it just won't pick up on config changes... It's been a while but I think I had to mod nagiosql to actually get it to send a restart command that nagios actually picked up on when 4 was first released .. but going by memory and never really bothered with it as I usually have an ssh session open any ways.

I'd still like to get this to work now though, so if anyone has any ideas :-)
[edit]
Forgot to mention, restart through the Nagios service webpage itself does exactly the same as a restart from nagiosql, which is 'not reloading the config'
Also running 4.0.7 right now, just found out .8 has been released but need to update it still.
[/edit]

Upsidedownlog:
[18-08-2014 16:36:35] Successfully launched command file worker with pid 20672
Informational Message[18-08-2014 16:36:35] wproc: Registry request: name=Core Worker 20668;pid=20668
Informational Message[18-08-2014 16:36:35] wproc: Registry request: name=Core Worker 20669;pid=20669
Informational Message[18-08-2014 16:36:35] wproc: Registry request: name=Core Worker 20671;pid=20671
Informational Message[18-08-2014 16:36:35] wproc: Registry request: name=Core Worker 20667;pid=20667
Informational Message[18-08-2014 16:36:35] wproc: Successfully registered manager as @wproc with query handler
Informational Message[18-08-2014 16:36:35] nerd: Fully initialized and ready to rock!
Informational Message[18-08-2014 16:36:35] nerd: Channel opathchecks registered successfully
Informational Message[18-08-2014 16:36:35] nerd: Channel servicechecks registered successfully
Informational Message[18-08-2014 16:36:35] nerd: Channel hostchecks registered successfully
Informational Message[18-08-2014 16:36:35] qh: core query handler registered
Informational Message[18-08-2014 16:36:35] qh: Socket '/usr/local/nagios/var/rw/nagios.qh' successfully initialized
Informational Message[18-08-2014 16:36:35] LOG VERSION: 2.0
Informational Message[18-08-2014 16:36:35] Local time is Mon Aug 18 16:36:35 CEST 2014
Program Start[18-08-2014 16:36:35] Nagios 4.0.7 starting... (PID=20666)
Informational Message[18-08-2014 16:36:35] Event broker module 'NERD' deinitialized successfully.
Informational Message[18-08-2014 16:36:35] Successfully shutdown... (PID=7740)
Program End[18-08-2014 16:36:35] Caught SIGTERM, shutting down...

Re: restarting nagios through web does not reload config.

Posted: Tue Aug 19, 2014 5:04 pm
by sreinhardt
According to the code, using the webui button should react by flushing memory, reloading configs, and restarting of monitoring. I will have to give this a few tests, to see if the functionality has been changed. I will post back here after testing.

Re: restarting nagios through web does not reload config.

Posted: Tue Oct 14, 2014 8:09 am
by Conz
Anyone have any ideas for this ? Updated to 4.0.8 and this problem remains.

Re: restarting nagios through web does not reload config.

Posted: Fri Oct 17, 2014 1:55 pm
by abrist
1. If you restart the nagios service from the CLI, do the new configs get loaded? If not, nagiosql may be writing the configs to the wrong location or not at all.
2. When you upgraded to 4.0.7, did you update the init script with:

Code: Select all

make install-init

Re: restarting nagios through web does not reload config.

Posted: Fri Oct 31, 2014 5:38 am
by Conz
abrist wrote:1. If you restart the nagios service from the CLI, do the new configs get loaded? If not, nagiosql may be writing the configs to the wrong location or not at all.
2. When you upgraded to 4.0.7, did you update the init script with:

Code: Select all

make install-init
Yes command line restart works fine.
It is just the restart through a webpage that does not.

Re: restarting nagios through web does not reload config.

Posted: Fri Oct 31, 2014 1:38 pm
by slansing
Looks like you have double posted this question, in your previous thread, did you try any of the suggestions put forth by other users? If so, which ones?:

http://support.nagios.com/forum/viewtop ... =7&t=24161

In the future, we do ask that you do not double post your questions, the duplicate will be removed, in this case, since we are already so far along in this one, we will keep them open.

Re: restarting nagios through web does not reload config.

Posted: Fri Oct 31, 2014 1:41 pm
by sreinhardt
As abrist mentioned, did you happen to do a make install-init? This will write out the init scripts for proper starting, if you were using an old version some settings or permissions might be incorrect that the init script is setting. Running the following should tell us fairly quickly as well:

Code: Select all

ls -lart /etc/init.d/nagios

Re: restarting nagios through web does not reload config.

Posted: Thu Apr 14, 2016 5:12 am
by dimk0u
Same issue on nagios 4.1.1 . Maybe someone is alredy solved this problem?

Re: restarting nagios through web does not reload config.

Posted: Thu Apr 14, 2016 9:42 am
by rkennedy
Can you please describe more about what you're experiencing? What are you using with Nagios? What is the output for ls -lart /etc/init.d/nagios?

Re: restarting nagios through web does not reload config.

Posted: Thu Apr 14, 2016 11:01 am
by Conz
rkennedy wrote:Can you please describe more about what you're experiencing? What are you using with Nagios? What is the output for ls -lart /etc/init.d/nagios?
It's been so long since I've looked at this as I had just given up trying to fix the web/socket restart.
Output for ls:

Code: Select all

-rwxr-xr-x 1 root root 3275 Nov 18  2013 /etc/init.d/nagios
I'm using nagiosql to deal with configuring Nagios, nagiosQL has an option to restart nagios.
It sends the 'RESTART_PROGRAM' command to the socket, this picks it up and restarts -something- according to the logging but it does not load the updated configuration from disk.