Page 1 of 1

Cannot apply configuration after 5.11.1 update

Posted: Fri Jun 30, 2023 2:49 am
by Achillefs
Hello all,

We encountered a weird issue after updating NagiosXI to version 5.11.1.
We tried to change the configuration of a host, but when we hit apply through the GUI we get the following error:

Code: Select all

"<div>Error: Template '' specified in host definition could be not found (config file '/usr/local/nagios/etc/hosttemplates.cfg', starting on line 251)
</div>

<div>Error: Template '' specified in host definition could be not found (config file '/usr/local/nagios/etc/hosttemplates.cfg', starting on line 402)</div>"
Usually, this would be pretty self-explanatory however the file it mentions (hosttemplates.cfg) is only 106 lines long:
# wc -l hosttemplates.cfg
106 hosttemplates.cfg

Can you please let me know where I should start looking for this wrong configuration?

Thank you

Re: Cannot apply configuration after 5.11.1 update

Posted: Fri Jun 30, 2023 3:28 am
by kg2857
You might have a look in CCM.
grep use /usr/local/nagios/etc/hosts/*
Look for a line with odd values.

Re: Cannot apply configuration after 5.11.1 update

Posted: Fri Jun 30, 2023 6:35 am
by Achillefs
Hey mate, thank you for your reply.
I tried it but I can not see anything wrong at least while gripping.
Do you think I need to check the config of the hosts one by one?

Re: Cannot apply configuration after 5.11.1 update

Posted: Fri Jun 30, 2023 4:44 pm
by kg2857
That or disable a bunch of hosts in CCM and try again.
It's not too friendly of it to keep the hostname a secret is it?

Re: Cannot apply configuration after 5.11.1 update

Posted: Tue Jul 04, 2023 3:30 am
by Achillefs
Hello guys,

So I learn something new, and in case it's going to help anyone here it is:
The error points you to a specific file. It will show only a few lines if you try to read its content(like with SSH).
However, if you go to CCM then Host Templates, and then you click "View Config" to any of the templates in there, you can see the file's actual contents.
From there I was able to determine that my issue was with some inactive host templates/service templates; I enabled all of them and then the configuration checked worked.

So I guess my advice is to focus less on the CLI and more on the GUI if you are troubleshooting haha.

Thanks!

Re: Cannot apply configuration after 5.11.1 update

Posted: Wed Jul 05, 2023 2:49 am
by hrosegripping
Either that, or turn off many hosts in CCM and start over.
Keeping the hostname a secret isn't very welcoming, is it?
word hurdle