Can't import, but the files pass verification

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Can't import, but the files pass verification

Post 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.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Can't import, but the files pass verification

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Can't import, but the files pass verification

Post 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.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Can't import, but the files pass verification

Post 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!
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Can't import, but the files pass verification

Post 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.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Can't import, but the files pass verification

Post 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?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Can't import, but the files pass verification

Post 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
.
.
.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Can't import, but the files pass verification

Post by scottwilkerson »

Are these hosts in separate files?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Can't import, but the files pass verification

Post 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.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Can't import, but the files pass verification

Post 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?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked