Error in Bulk Renaming

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
bosecorp
Posts: 929
Joined: Thu Jun 26, 2014 1:00 pm

Error in Bulk Renaming

Post 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.
bosecorp
Posts: 929
Joined: Thu Jun 26, 2014 1:00 pm

Re: Error in Bulk Renaming

Post 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
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Error in Bulk Renaming

Post 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 
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
bosecorp
Posts: 929
Joined: Thu Jun 26, 2014 1:00 pm

Re: Error in Bulk Renaming

Post 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
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Error in Bulk Renaming

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
bosecorp
Posts: 929
Joined: Thu Jun 26, 2014 1:00 pm

Re: Error in Bulk Renaming

Post 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
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Error in Bulk Renaming

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
bosecorp
Posts: 929
Joined: Thu Jun 26, 2014 1:00 pm

Re: Error in Bulk Renaming

Post by bosecorp »

Thousands

:( :( :(
Envera IT
Posts: 159
Joined: Wed Jun 19, 2013 10:21 am

Re: Error in Bulk Renaming

Post 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.
I like graphs...
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Error in Bulk Renaming

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked