restarting nagios through web does not reload config.

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.
Conz
Posts: 6
Joined: Fri Sep 30, 2011 5:19 am

restarting nagios through web does not reload config.

Post 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...
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: restarting nagios through web does not reload config.

Post 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.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Conz
Posts: 6
Joined: Fri Sep 30, 2011 5:19 am

Re: restarting nagios through web does not reload config.

Post by Conz »

Anyone have any ideas for this ? Updated to 4.0.8 and this problem remains.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: restarting nagios through web does not reload config.

Post 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
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Conz
Posts: 6
Joined: Fri Sep 30, 2011 5:19 am

Re: restarting nagios through web does not reload config.

Post 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.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: restarting nagios through web does not reload config.

Post 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.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: restarting nagios through web does not reload config.

Post 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
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
dimk0u
Posts: 1
Joined: Tue Apr 12, 2016 8:52 am

Re: restarting nagios through web does not reload config.

Post by dimk0u »

Same issue on nagios 4.1.1 . Maybe someone is alredy solved this problem?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: restarting nagios through web does not reload config.

Post 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?
Former Nagios Employee
Conz
Posts: 6
Joined: Fri Sep 30, 2011 5:19 am

Re: restarting nagios through web does not reload config.

Post 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.
Locked