Cannot apply configuration after 5.11.1 update

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
Achillefs
Posts: 6
Joined: Thu Jan 21, 2021 12:42 pm

Cannot apply configuration after 5.11.1 update

Post 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
kg2857
Posts: 234
Joined: Wed Apr 12, 2023 5:48 pm

Re: Cannot apply configuration after 5.11.1 update

Post by kg2857 »

You might have a look in CCM.
grep use /usr/local/nagios/etc/hosts/*
Look for a line with odd values.
Achillefs
Posts: 6
Joined: Thu Jan 21, 2021 12:42 pm

Re: Cannot apply configuration after 5.11.1 update

Post 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?
kg2857
Posts: 234
Joined: Wed Apr 12, 2023 5:48 pm

Re: Cannot apply configuration after 5.11.1 update

Post 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?
Achillefs
Posts: 6
Joined: Thu Jan 21, 2021 12:42 pm

Re: Cannot apply configuration after 5.11.1 update

Post 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!
hrosegripping
Posts: 6
Joined: Wed Jul 05, 2023 2:46 am

Re: Cannot apply configuration after 5.11.1 update

Post 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
Post Reply