Page 1 of 2
Can't import, but the files pass verification
Posted: Fri Sep 13, 2019 10:05 am
by eloyd
I hate when people ask me these sorts of questions, so I apologize in advance for this question.
We have a customer that is migrating a lot of data from another Nagios Core forked product over to Nagios XI. After four days of massaging their data, I've gotten to the point where:
- If I put all the *.cfg files into /usr/local/nagios/etc/services (just a random place that I know the Nagios Core built in to Nagios XI will look), then a verify run verifies everything as correct
- If I put all the *.cfg files into /usr/local/nagios/etc/import and then import things in the proper order, when I get to hosts, things fall apart with weird failures where it won't import.
So why can't I import things, when, presumably, they are valid configs? I'd rather not provide config files samples if possible.
Re: Can't import, but the files pass verification
Posted: Fri Sep 13, 2019 12:07 pm
by scottwilkerson
Did you run the prep tool on the configs
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
https://assets.nagios.com/downloads/nag ... p-Tool.pdf
I know this may seem silly if it runs already but it prepares the files for import
Re: Can't import, but the files pass verification
Posted: Fri Sep 13, 2019 12:15 pm
by eloyd
No, I didn't. But I'll give it a shot. Worse thing is that it doesn't work any better than it does now.
Thanks for the hint.
Re: Can't import, but the files pass verification
Posted: Fri Sep 13, 2019 1:07 pm
by scottwilkerson
eloyd wrote:No, I didn't. But I'll give it a shot. Worse thing is that it doesn't work any better than it does now.
Thanks for the hint.
Good Luck!
Re: Can't import, but the files pass verification
Posted: Fri Sep 13, 2019 1:31 pm
by eloyd
Sadly, the number one thing that isn't importing properly is the hosts file, which the cfg prep tool just de-whitespace-ifies, but otherwise leaves mostly untouched. So no, this did not help.
Re: Can't import, but the files pass verification
Posted: Fri Sep 13, 2019 1:33 pm
by scottwilkerson
eloyd wrote:Sadly, the number one thing that isn't importing properly is the hosts file, which the cfg prep tool just de-whitespace-ifies, but otherwise leaves mostly untouched. So no, this did not help.
Hmm, do you have an example of one of the hosts and the errors you are getting?
Re: Can't import, but the files pass verification
Posted: Fri Sep 13, 2019 1:42 pm
by eloyd
Error:
Code: Select all
Duplicate entry '1' for key 'config_name'
Followed by a lot of:
Code: Select all
Entry host_name:: inside tbl_host successfully inserted
Entry host_name:: inside tbl_host could not be inserted: 1
Entry host_name:: inside tbl_host could not be inserted: 1
Entry host_name:: inside tbl_host could not be inserted: 1
Entry host_name:: inside tbl_host could not be inserted: 1
Entry host_name:: inside tbl_host could not be inserted: 1
.
.
.
Re: Can't import, but the files pass verification
Posted: Fri Sep 13, 2019 1:59 pm
by scottwilkerson
Are these hosts in separate files?
Re: Can't import, but the files pass verification
Posted: Fri Sep 13, 2019 2:23 pm
by eloyd
One file. 7000+ hosts. Working on splitting them up by first letter to see if we can make it through a..b...c... imports before errors pop up.
Re: Can't import, but the files pass verification
Posted: Fri Sep 13, 2019 2:50 pm
by scottwilkerson
eloyd wrote:One file. 7000+ hosts. Working on splitting them up by first letter to see if we can make it through a..b...c... imports before errors pop up.
Does this file contain all the hosts AND all the services?