Page 1 of 2

Error in Bulk Renaming

Posted: Tue May 01, 2018 8:04 am
by bosecorp
Getting this error after bulk rename. Right after finish making changes and while trying to apply config

SQL Error [ndoutils] : You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') AND `name2`='Check Service Drive - N: Usage'' at line 1
SQL Error [ndoutils] : You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') AND `name2`='Check Service Drive - O: Usage'' at line 1
SQL Error [ndoutils] : You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') AND `name2`='Check Service Drive - R: Usage'' at line 1
SQL Error [ndoutils] : You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') AND `name2`='Check Service Drive - V: Usage'' at line 1
SQL Error [ndoutils] : You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') AND `name2`='Check Service Drive - W: Usage'' at line 1
SQL Error [ndoutils] : You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') AND `name2`='Check Service Drive - X: Usage'' at line 1
Bulk Renaming Tool
Complete
The new config is being applied in the background and on large systems can take some time.

Re: Error in Bulk Renaming

Posted: Tue May 01, 2018 11:11 am
by bosecorp
It;s addition to the error, looks like this created a big problem for me now. Looks like the files didnt get renamed

Re: Error in Bulk Renaming

Posted: Tue May 01, 2018 12:18 pm
by npolovenko
Hello, @bosecorp.

What exactly did you try to rename? Did you use any special characters in the new name?

In XI web interface please go to Configure -> Core Configurations Manager, then click on Tools -> Config File Management in the left column. Then perform the following actions in order:
1)Write
2)Delete
3)Write
4)Verify

If you see any errors please copy-paste the output in here.


You could also revert to a previous working Configuration Snapshot in Core Configurations Manager. And after you revert run the database repair script:

Code: Select all

  /usr/local/nagiosxi/scripts/repair_databases.sh 

Re: Error in Bulk Renaming

Posted: Tue May 01, 2018 1:37 pm
by bosecorp
No errors

I was trying to rename services.

looks like the services got renamed successfully, but like I said the files didn't get rename so now all my historical information is gone from the GUI perspective. I know the old performance data is there, just with the wrong file name

Re: Error in Bulk Renaming

Posted: Tue May 01, 2018 3:00 pm
by npolovenko
@ bosecorp, So the services in GUI were renamed but the RRD files did not get renamed? As a result, you're unable to see any performance data?

Please check a few service files in this directory and let me know if they were not renamed.

Code: Select all

/usr/local/nagios/share/perfdata/
What version of XI are you running and have you upgraded it recently?

Try to revert to a previous good snapshot, run the database repair script and then attempt to rename the services again.

Re: Error in Bulk Renaming

Posted: Wed May 02, 2018 7:28 am
by bosecorp
correct, no perfdata

cant restore from snapshop at this point. almost 3 days have gone by. We have added a bunch of new host of other things.

and yes the RRD file didnt get renamed.

I am running 5.4.12. havent upgrade Nagios in the last several weeks

Re: Error in Bulk Renaming

Posted: Wed May 02, 2018 3:53 pm
by npolovenko
@bosecorp, How many services did you rename with the Bulk Renaming Tool? 5, 50? If it's only 5-10 you could attempt manually rename the RRD files. Let me know.

Re: Error in Bulk Renaming

Posted: Wed May 09, 2018 7:42 am
by bosecorp
Thousands

:( :( :(

Re: Error in Bulk Renaming

Posted: Wed May 09, 2018 10:17 am
by Envera IT
bosecorp wrote:Thousands

:( :( :(
yea...we've had issues with large renames as well. We only do 25 or so at a time now.

Re: Error in Bulk Renaming

Posted: Wed May 09, 2018 4:22 pm
by npolovenko
@Ehamby, This makes it more complicated. Theoretically, you could take a VM snapshot of Nagios XI, then revert back to a previous CCM snapshot and try to rename the services again. If the renaming succeeds this time copy the renamed RRD files from (/usr/local/nagios/share/perfdata/) folder to your computer, or copy the whole folder. Then revert to a VM snapshot and replace the perfdata folder.
All the other solutions will be too time-consuming provided that you need to modify thousands of services.

I agree with @Ehamby, In future, I would try to rename no more than 500 at a time. Modifying thousands of services requires more resources and tweaking the config files, including the php.ini.