Page 1 of 2

Weird Renaming Problem

Posted: Fri May 29, 2015 5:39 am
by WillemDH
hello,

I seem to have problems with the renaming tool. After trying to rename one host, Nagios XI seems to set all hosts to Not applied and does not automatically apply configuration, although the checkbox to not apply is not checked. After manually applying configuration, it takes ages to finish. I'm not even sure if it finished. Also after renaming the host, the services of this host still seem to have the old hostname as config name. The renaming tool just show an empty red box, see screenshot.

As I feared something went totally wrong, I tried restoring a configuration snapshot of the last apply, and this also is taking a huge time. It has been running for 3 minutes now. (Waiting for configuration verification) I'll update this thread if it ever finishes.

EDIT: it took about 4 minutes, but it finally finished. This were the changes

Code: Select all

Write host configurations ...
Host configuration files successfully written!

Write service configurations ...
WARNING! Ghost service config detected! Removing the file servermscrv01.cfg.save.cfg
Service configuration files successfully written!

Configuration file: hostgroups.cfg successfully written!
Configuration file: servicegroups.cfg successfully written!
Configuration file: hosttemplates.cfg successfully written!
Configuration file: servicetemplates.cfg successfully written!
Configuration file: timeperiods.cfg successfully written!
Configuration file: commands.cfg successfully written!
Configuration file: contacts.cfg successfully written!
Configuration file: contactgroups.cfg successfully written!
Configuration file: contacttemplates.cfg successfully written!
Configuration file: servicedependencies.cfg successfully written!
Configuration file: hostdependencies.cfg successfully written!
Configuration file: serviceescalations.cfg successfully written!
Configuration file: hostescalations.cfg successfully written!
Configuration file: serviceextinfo.cfg successfully written!
Configuration file: hostextinfo.cfg successfully written!
I tried doing a small edit and applying config took normal amount of time (5 sec) but I did get the same message:

Code: Select all

Write host configurations ...
Configuration file: servertest.cfg successfully written!
Host configuration files successfully written!

Write service configurations ...
WARNING! Ghost service config detected! Removing the file servermscrv01.cfg.save.cfg
Service configuration files successfully written!

Configuration file: hostgroups.cfg successfully written!
Configuration file: servicegroups.cfg successfully written!
Configuration file: hosttemplates.cfg successfully written!
Configuration file: servicetemplates.cfg successfully written!
Configuration file: timeperiods.cfg successfully written!
Configuration file: commands.cfg successfully written!
Configuration file: contacts.cfg successfully written!
Configuration file: contactgroups.cfg successfully written!
Configuration file: contacttemplates.cfg successfully written!
Configuration file: servicedependencies.cfg successfully written!
Configuration file: hostdependencies.cfg successfully written!
Configuration file: serviceescalations.cfg successfully written!
Configuration file: hostescalations.cfg successfully written!
Configuration file: serviceextinfo.cfg successfully written!
Configuration file: hostextinfo.cfg successfully written!
I vaguely remember updating the renaming tool a week or so ago to version 1.4.2. As I'm using the renaming tool quite often, could I please get a hold of the previous version (1.4.1) as that version worked well for several months.

Grtz

Willem

Re: Weird Renaming Problem

Posted: Fri May 29, 2015 10:23 am
by lmiltchev
I was not able to recreate the issue. I was using version 1.4.1 - no issues, then I upgraded to version 1.4.2 - it worked as well. I didn't have to wait for a long time - changes happened almost instantaneously. I tested renaming hosts and services.

Can you try renaming a host/service and when you get the error, tail the apache error log and post the output in code wraps. Hopefully, we will find some clues in there.

Code: Select all

tail -100 /var/log/httpd/error_log

Re: Weird Renaming Problem

Posted: Mon Jun 01, 2015 2:06 am
by WillemDH
Ludmill,

I've tried debugging a bit. Symptoms seems not like last week. I'm not getting the red window, but applying configuration takes ages (+-7min) after renaming a host. Is this normal? When applying configuration after a 'normal' change, it only takes 17 sec. I did not found any errors in httpd error log.
One time I got an error specifying some service template was not found for a host testserver.cfg. The weird thing is that this testserver.cfg does not exist anywhere on the Nagios XI server, nor in the CCM. I vaguely remember using a testserver.cfg to test a Reactor chain some months ago. Also weird is that although I got an error, this error is not seen in the overview of the configuration snapshots.

Grtz

Willem

Re: Weird Renaming Problem

Posted: Mon Jun 01, 2015 9:05 am
by tgriep
Could you run the following while you are trying to Apply the Configuration and post back the output of the tail?

Code: Select all

tail -f /usr/local/nagiosxi/var/cmdsubsys.log

Re: Weird Renaming Problem

Posted: Mon Jun 01, 2015 9:07 am
by WillemDH
Ok, just a second. I'll pm you the results. Sent you the pm. I'm trying to restore to the last previous configuration snapshot, but I'm getting

Code: Select all

Another reconfigure process is still running, sleeping...
Another reconfigure process is still running, sleeping...
Another reconfigure process is still running, sleeping...
Another reconfigure process is still running, sleeping...
Another reconfigure process is still running, sleeping...
Another reconfigure process is still running, sleeping...
Another reconfigure process is still running, sleeping...
Another reconfigure process is still running, sleeping...
Another reconfigure process is still running, sleeping...
Another reconfigure process is still running, sleeping...
Another reconfigure process is still running, sleeping...
Another reconfigure process is still running, sleeping...
Another reconfigure process is still running, sleeping...
Another reconfigure process is still running, sleeping...
Another reconfigure process is still running, sleeping...
Another reconfigure process is still running, sleeping...
Another reconfigure process is still running, sleeping...
Another reconfigure process is still running, sleeping...
Another reconfigure process is still running, sleeping...
Another reconfigure process is still running, sleeping...
in the cmdsubsys.log.

Please advice how to continue troubleshooting this.

Grtz

Willem

Re: Weird Renaming Problem

Posted: Mon Jun 01, 2015 9:34 am
by lmiltchev
Do you still have the "reconfigure_nagios.lock" in the "scripts" directory? Try removing it to see if this is going to fix the issue:

Code: Select all

rm -rf /usr/local/nagiosxi/scripts/reconfigure_nagios.lock

Re: Weird Renaming Problem

Posted: Mon Jun 01, 2015 9:37 am
by WillemDH
Ludmill,

After some time the reconfigure process stopped sleeping, so I guess there is no lock anymore. I sent the outputs of cmdsubsys.log to Jesse. There must be some issue with testserver.cfg, but I can't find it anywhere.

Grtz

Willem

Re: Weird Renaming Problem

Posted: Mon Jun 01, 2015 9:48 am
by tgriep
In Core Config Manager under services, you cannot find the "testserver" entry?
If you can find it, you will need to fix the template assigned to it.

Also, if this system has a lot of hosts and services configured on it, you may need to edit the /etc/php.ini file's resource limits.
Check the following settings and increase them.

Code: Select all

max_execution_time = 60     ; Maximum execution time of each script, in  seconds
max_input_time = 60     ; Maximum amount of time each script may spend parsing request data
memory_limit = 256M      ; Maximum amount of memory a script may consume 
After editing the file you will have to restart apache

Code: Select all

service httpd restart

Re: Weird Renaming Problem

Posted: Mon Jun 01, 2015 10:09 am
by WillemDH
In Core Config Manager under services, you cannot find the "testserver" entry?
Correct. I'll check my php.ini tomorrow morning.

Re: Weird Renaming Problem

Posted: Mon Jun 01, 2015 10:29 am
by tgriep
Try this.

Go to the Core Config Manager
Under "Tools", click "Write Config Files"
Click the "Delete" button then click the "Write" button and then the "Verify" button
If you get any verification errors, resolve them and start the delete, write until the errors are gone.

If they are gone then Apply the Configuration.