Page 1 of 1

Case change on host has lead to problems

Posted: Tue Jun 23, 2020 10:38 am
by GldRush98
Former hostname: voc-hyperv1
Current hostname: VOC-hyperv1
Yes, it's a minor change, but it was done to conform with the naming scheme were caps denote production and lower cases denote DR servers.
So this was changed a while ago but there is a mix up now and this has broken things, most importantly performance data is missing from services still associated with the old hostname.
I can not figure out WHERE the old name is coming from.
Config name on services has been updated.
Host does not have an alias or display name set to it.
I have deleted the host and recreated it.
I have deleted the services showing the errant name and recreated them.
And STILL it comes back! I even went as far as grepping the cfg files on the server for the lower case name and it is NOWHERE that I can find.
Capture.PNG
Capture2.PNG
Capture3.PNG

Re: Case change on host has lead to problems

Posted: Tue Jun 23, 2020 12:01 pm
by GldRush98
Actually, changing the case on services is proving to be problemactic as well.
For example service named:
url content

Change the name to:
Url content

The service is now broken. It shows the old name (url content) the XI gui and it will never perform a check. It sticks at pending state!
This really feels like a bug. Unless changing case of something is not actually supported?

Re: Case change on host has lead to problems

Posted: Tue Jun 23, 2020 3:26 pm
by jbrunkow
You may want to try rewriting your configuration files to correct the error.
  1. Navigate to Config using the bar on top of XI > click Core Config Manager under Advanced Configuration on the left pane > then click Config File Management under Tools on the left.
  • Click Delete Files. ( Don't worry, we can easily rewrite them. )
  • Click Write Configs.
  • Click Verify Files. If you see any errors, correct them and perform the two previous steps again.
  • Click Restart Nagios Core to apply the configuration.

Re: Case change on host has lead to problems

Posted: Wed Jun 24, 2020 10:54 pm
by GldRush98
Yeah, I did that. Made no difference. The configs being written to the actual files all appear with the correct case.

Re: Case change on host has lead to problems

Posted: Thu Jun 25, 2020 3:56 pm
by jbrunkow
I believe this may actually be a bug in a recent release. People are reporting that objects are replicating instead of being renamed.

We are working to correct the software so that we can deploy a fix soon, but you could also alter the database as a workaround for the time being.

Delete the objects you see from the database using a command like below, but with the names of the objects you want to delete.

Code: Select all

mysql -h 127.0.0.1 -uroot -pnagiosxi nagios -e "delete from nagios_obects where name1 like '%hostname%';"
...or you could truncate the entire table...

Code: Select all

mysql -h 127.0.0.1 -uroot -pnagiosxi nagios -e "truncate table nagios_objects;"
...then Apply Config to write the changes from the database to the configuration.

Re: Case change on host has lead to problems

Posted: Thu Jun 25, 2020 4:32 pm
by GldRush98
jbrunkow wrote:I believe this may actually be a bug in a recent release. People are reporting that objects are replicating instead of being renamed.

We are working to correct the software so that we can deploy a fix soon, but you could also alter the database as a workaround for the time being.

Delete the objects you see from the database using a command like below, but with the names of the objects you want to delete.

Code: Select all

mysql -h 127.0.0.1 -uroot -pnagiosxi nagios -e "delete from nagios_obects where name1 like '%hostname%';"
...or you could truncate the entire table...

Code: Select all

mysql -h 127.0.0.1 -uroot -pnagiosxi nagios -e "truncate table nagios_objects;"
...then Apply Config to write the changes from the database to the configuration.
Yes, this looks like a bug to me. Running (you had a minor typo in the table name):

Code: Select all

mysql -h 127.0.0.1 -uroot -pnagiosxi nagios -e "delete from nagios_objects where name1 like '%voc-srv1%';"
And then applying the config cleared up the case confusion! All the services look correct and show under the correct case host now.

edit: And confirming this same method also let me change the case of just a service name correctly as well! The service works correctly after the case change. File that bug report :ugeek:

Re: Case change on host has lead to problems

Posted: Fri Jun 26, 2020 11:14 am
by jbrunkow
Great! I'm glad you got it working.

Our developers have been made aware of this problem.

Is it okay if I mark this topic as resolved and lock it for editing?

Re: Case change on host has lead to problems

Posted: Fri Jun 26, 2020 2:29 pm
by GldRush98
Yup, this will suffice until an update fixes it. Thanks for making the devs aware.

Re: Case change on host has lead to problems

Posted: Mon Jun 29, 2020 7:29 am
by scottwilkerson
GldRush98 wrote:Yup, this will suffice until an update fixes it. Thanks for making the devs aware.
Great

Locking thread