Page 1 of 1

Error Importing servicetemplates

Posted: Mon Aug 30, 2021 1:34 pm
by holme1
Hello All,

I'm importing the servicestemplates.cfg file from our Dev Nagios environment to our other environments.
We've been using the same process for months without issue.

Two week ago when trying to import the servicestemplates.cfg file it fails throwing a CCM Configuration Error that makes no sense...

Code: Select all

Error: Could not find any host matching 'umwwtstdb1601a EPI' (config file '/usr/local/nagios/etc/services/umwwtstdb1601a.cfg', starting on line 16)
Error: Failed to expand host list 'umwwtstdb1601a EPI' for service 'MSSQL Query - Test Query' (/usr/local/nagios/etc/services/umwwtstdb1601a.cfg:16)
That service and that server were deleted previously in the Dev environment.
We've been troubleshooting for a while... and no matter the troubleshooting steps taken it still results in some random file error like above. The file names and specific errors will change.

We've tried the following...

1) Rolling back to the previous servicestemplates.cfg file (works fine - but any new changes cause the error)
2) Various restores on both the Dev and Test boxes (just configuration / full restore)
3) Repairing the database

Is there anything else we can try? Is there special characters we should be on the look out for?
I feel like this is some form of parsing error. But I'm unsure where else to look.

Thanks for the help.

Re: Error Importing servicetemplates

Posted: Mon Aug 30, 2021 1:39 pm
by holme1
It should also be noted... that making changes and saving the servicestemplates.cfg in Dev works fine. So the Dev environment doesn't seem to have an issue with the file itself.

Re: Error Importing servicetemplates

Posted: Mon Aug 30, 2021 4:15 pm
by vtrac
Hi,
Please open a command prompt as "root" and run:

Code: Select all

rm -f /usr/local/nagios/etc/import/*

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

Now, please open Nagios XI GUI > Configure > Core Config Manager > Config File Management
Please click "Delete Files"
Please click "Write Configs"
Please click "Verify Files"
Now, please click Apply Configuration at the upper left panel.


Now, please try your import again.


Vinh

Re: Error Importing servicetemplates

Posted: Tue Aug 31, 2021 9:43 am
by holme1
Ended up trying that as well. Didn't work.

Ultimately found it to be a new service I was trying out. As soon as I removed it the migration worked just fine. So at least now I know where to look.

Thanks for the insight.

Re: Error Importing servicetemplates

Posted: Tue Aug 31, 2021 10:55 am
by vtrac
Great!! ... locking thread ... :-)