Page 1 of 3
Renaming tool screwed up
Posted: Tue Nov 03, 2015 9:14 am
by WillemDH
Hello,
The renaming tool seriously screwed me over again. After trying to rename a bunch of services (120 or so) from SRV_CPU to SRV_CPU_Usage all the services I renamed have lost heir history.

Tried going back to previous config snapshot, but to no use. The rrds are still there:
Code: Select all
-rwxrwxr-x 1 nagios nagios 1151496 Nov 3 15:06 SRV_CPU.rrd
-rwxrwxr-x 1 nagios nagios 1151496 Nov 3 14:51 SRV_CPU_Usage.rrd
-rwxrwxr-x 1 nagios nagios 2879 Nov 3 14:52 SRV_CPU_Usage.xml
But no data in any graphs from before the moment I renamed them....
When I test again on one host it seems to work normal.
It could have all kinds of reasons, such as other apply configs running by other users, which prevented me from seeing the correct services resulting in me restoring a config snap, while the rrds were already moved.
Of course re-renaming again is probably not a good idea or he will retry the copy of the newly created rrd...
I think the root casue again is that working (applying) with multiple users in Nagios XI is generally a bad idea, as we don't know when an apply configuration is running... (check also this thread:
https://support.nagios.com/forum/viewto ... 16&t=35349)
So the solution to my problem is renaming the hosts manually in the CCM. If only knew which services I renamed. Ans as the renaming tool does absolutely no sorting at all... Could sorting stuff alphabetically in new or updated components etc not also become a pre-go-to-production checkbox. I think I've created enough feature requests to order lists alphabetically...
Willem
Re: Renaming tool screwed up
Posted: Tue Nov 03, 2015 1:20 pm
by WillemDH
Ok, solved this by some manual labour. Please make a feature request to
- Alphabetically sort the hosts in the renaming tool
- Make it possible to edit multiple fields at once. At this time I have to hit 3 * tab then paste and loop through 100+ svc'es. having to do this for 100+ hosts /services is just not cool for a tool named renaming tool. Some way to set all the new names at once. Find / Replace all. There is definitely room for improvement.
- It would be nice if, when the component does start an apply configuration, the same waiting for apply to finish screen as for the normal apply is shown. Atm this is done in the background, which is confusing, as there is no easy way to see when the apply has finished.
And I hope you guys are aware of the issue with the apply configuration and the notification icons for larger setups and will come up with a nice solution in a future release.

Re: Renaming tool screwed up
Posted: Tue Nov 03, 2015 1:59 pm
by hsmith
FR 6871 has been put in.
Did we ever submit a FR for your apply configuration icon changed you wanted to see? I have one in for searchbox enhancements from you and Bandit, but I do not know if one was ever made for the Apply Config icon deal. I could look, but I am sure it is faster to ask you

Re: Renaming tool screwed up
Posted: Tue Nov 03, 2015 2:40 pm
by WillemDH
Hey Holden,
Well, to be honest I made
http://tracker.nagios.com/view.php?id=571 a long time ago, but the way it is implemented is not really an improvement to be honest imho.
Trevor said:
I will still make the request, but it might need to be a little more vague so the developers can do it their way.
Grtz!
Re: Renaming tool screwed up
Posted: Wed Nov 04, 2015 12:50 pm
by ssax
Willem, are you saying that your hosts aren't sorted alphabetically? Mine are, please provide a screenshot or be more specific and I'll look for a solution for you.
Re: Renaming tool screwed up
Posted: Thu Nov 05, 2015 3:09 am
by WillemDH
Check out these first letters. the complete list is too long, but the list is definitely noy alphabetically sorted. Go to renaming, click services next, search for example for CPU, select all services and then you get an unsorted list?
It might be a good idea to make a sortable filterable listview from this? Then everyone can choose what column to sort in what direction. And a way to change all the New Service Description at once please please.
Re: Renaming tool screwed up
Posted: Thu Nov 05, 2015 10:36 am
by WillemDH
Just having more problems with the renaming tool. Tried to rename three hosts. This is the result: (apply configuration is running for 2+ minutes now)
EDIT 1: Still running... Make it 4 minutes...

EDIT 2: The gui says it's still running. When I tail cmdsubsys.log nothing interesting is showing
Code: Select all
tail -f /usr/local/nagiosxi/var/cmdsubsys.log
..................................................
PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated
.
PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated
PROCESSED 0 COMMANDS
EDIT 3: CCM syas: Configuration Status: Configuration not applied!
The tab where I started the apply configuration is still running now (+5 minutes!) =>Check out the amount of dots....
Code: Select all
Waiting for configuration verification....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
What should I do to make it stop? Restart nagios svc?
Re: URGENT - Renaming tool screwed up
Posted: Thu Nov 05, 2015 10:54 am
by WillemDH
Ok the apply has stopped running. I got this error message:
Nagios_Renaming3.PNG
----------
Now I hear you thinking => You have an error with your max_check_attempts with host google....bla
But check the screenshot fo tis particular host.. I also check the services of this host. They all have a valid max_check_attempts. Plus we have applied several times today with no problems....
So what's going on here?
----------
Ok, so the config not applied. The CCM compleining the config is not applied. I try to go back to the latest config and it seems I'm again screwed. Seems that the cmdsubsys.log now does show some information =>
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...
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...
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated
PROCESSED 0 COMMANDS
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...
So what now?? it's still running from the first apply after the screwed up rename? I'm lost at this.
Re: Renaming tool screwed up
Posted: Thu Nov 05, 2015 5:52 pm
by tmcdonald
See if you can find reconfigure_nagios.lock on your system under /usr/local/nagiosxi/scripts/ and if it is there, delete it and run /usr/local/nagiosxi/scripts/reconfigure_nagios.sh as root.
Re: Renaming tool screwed up
Posted: Fri Nov 06, 2015 9:18 am
by WillemDH
Trevor,
I have tried to gather some info around this issue. I tried to rename one host resulting in the same problems as last time.
So I tried deleting reconfigure_nagios.lock and rerunning reconfigure_nagios.sh which was able to do a 'normal' apply.
I've tried renaming this host twice resulting each time in the same problem. the tail of the cmdsubsys.log resulted in this info:
Code: Select all
PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated
.
PROCESSED 0 COMMANDS
.. . 61.9 =3m9s
2015-11-06 15:12:20 (61.9 B/s) - “nagiosql.export.monitoring” saved [11681]
NAGIOSQL WRITE CONFIGS FAILED!\n
OUTPUT=NAGIOSQL WRITE CONFIGS FAILED!\n
RETURNCODE=5
Can anyone elaborate what returncode 5 means? Am I the only one where the renaming for hosts doesn't work? Renaming services does succeed by the way.
In the gui this error did again show:
Code: Select all
Error: Invalid max_check_attempts value for host 'google-public-dns-a.google.com'
Error: Could not register host (config file '/usr/local/nagios/etc/hosts/google-public-dns-a.google.com.cfg', starting on line 16)
But the invalid max_check attempts is 5 which should not cause any issues.
Every time I tried renaming the host, the reconfigure_nagios.lock was not removed. Now the weird thing is that the second tile I tried renaming this host, the rename did succeed! Although I did get the error.
Did a third test with another host. Same scenario. Very long apply resulting in
Code: Select all
NAGIOSQL WRITE CONFIGS FAILED!\n
OUTPUT=NAGIOSQL WRITE CONFIGS FAILED!\n
RETURNCODE=5
And
Code: Select all
An error occurred while attempting to apply your configuration to Nagios Core. Monitoring engine configuration files have been rolled back to their last known good checkpoint.
The lock file is still there.
When I remove the lock and run reconfigure_nagios.sh
The host is renamed as configured.
I hope my tests help you pinpoint the problem.