What to import from /cfgprep

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
toleolu
Posts: 294
Joined: Fri Jul 19, 2013 7:02 pm
Location: Honolulu Hawaii

What to import from /cfgprep

Post by toleolu »

I copied the relevant .cfg files from our old Nagios server to the new one, put those .cfg files in /cfgprep/orig.

I ran the php script to prep the files in /orig and now in my cfgprep I have a .cfg file for every host on the old system, in addition to the preped versions of the original files services.cfg, contacts.cfg etc etc.

Now from CCM I go in to import those files and this is where I hit a wall. Am I supposed to import everything in cfgprep directory, and if so, do I select all the files at once, import them one at a time, and what about the sequence shown on the Import page?

If someone could explain the exact steps at this point to write those .cfg files, I would really appreciate it.

By the way, I made a copy of the original /etc/ directory before I started doing this, when the import bombs, I just copy the original etc folder back and start all over again. Am I causing any issues doing this?
Charles Masteller
Information Systems Specialist
Hawaii Health Systems Corp.
"No one will ever need more than 640K RAM". Bill Gates
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: What to import from /cfgprep

Post by lmiltchev »

Am I supposed to import everything in cfgprep directory, and if so, do I select all the files at once, import them one at a time, and what about the sequence shown on the Import page?
This is what we recommend:
To prevent errors or misconfigurations, you should import your configurations in an useful order. We recommend importing in the following order:

commands -> timeperiods -> contacttemplates -> contacts -> contactgroups ->
hosttemplates -> hosts -> hostgroups -> servicetemplates -> services -> servicegroups

The CCM import tool does not currently support object names that start with '#', or group exclusions that start with '!'

Check your configurations after import before saving to file!
Be sure to check out our Knowledgebase for helpful articles and solutions!
toleolu
Posts: 294
Joined: Fri Jul 19, 2013 7:02 pm
Location: Honolulu Hawaii

Re: What to import from /cfgprep

Post by toleolu »

Thanks, but could you be a little more specific. For instance, in the sequence of importing the files where it says "hosts" is that the actual host.cfg file in cfgprep or is it all the individual hostname.cfg files that were created during the xiprepimport process?

Thanks
Charles Masteller
Information Systems Specialist
Hawaii Health Systems Corp.
"No one will ever need more than 640K RAM". Bill Gates
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: What to import from /cfgprep

Post by slansing »

All of the individual files as shown here:

http://assets.nagios.com/downloads/nagi ... nto_XI.pdf

You should see quite a long list of configs you can import, these will bring your services in as well. As abrist suggested, we can set up a quickstart and help you with this if you are still having troubles.
toleolu
Posts: 294
Joined: Fri Jul 19, 2013 7:02 pm
Location: Honolulu Hawaii

Re: What to import from /cfgprep

Post by toleolu »

So the fact that the services.cfg in cfgprep is empty is not an issue.

I never got to the point of importing the actual hostname.cfg files. Let me give it a shot and I'll get back with you. We'll probably take you up on that quickstart since it's looking like the biggest issue we are facing right now is PEBKAC. (Probelme Exists Between Keyboard And Chair) :D

By the way, in an earlier post, I mentioned that I made a copy of the etc directory from the clean install. I was using that to overwrite the etc directory when I get things messed up so I could start from scratch again. Is there any problems in doing that?
Charles Masteller
Information Systems Specialist
Hawaii Health Systems Corp.
"No one will ever need more than 640K RAM". Bill Gates
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: What to import from /cfgprep

Post by slansing »

Happens to everyone! :)

I'd have to say I do not recommend removing the entire etc directory, there are some files that are already created by XI that exist there from the start for a reason. Though generally the MySql database will replace them when an apply configuration is ran.

It's advisable to create snapshots if you are running an XI VM that way you don't have to worry about torching the filesystem on accident.
toleolu
Posts: 294
Joined: Fri Jul 19, 2013 7:02 pm
Location: Honolulu Hawaii

Re: What to import from /cfgprep

Post by toleolu »

Now Nagios is saying I have a permissions issue with some of my config files, but when I go to the Admin page it doesn't list any config files. Just the red warning symbol, and text saying "The following configuration files have incorrect permissions: but it doesn't list any files

The line about about config scripts is fine.

Seems like I'm going backwards at this point.
Charles Masteller
Information Systems Specialist
Hawaii Health Systems Corp.
"No one will ever need more than 640K RAM". Bill Gates
toleolu
Posts: 294
Joined: Fri Jul 19, 2013 7:02 pm
Location: Honolulu Hawaii

Re: What to import from /cfgprep

Post by toleolu »

Finally got my services to show up. :D :D :D

Something in the contacts.cfg was giving me some issues, so I just didn't import that, the first host.cfg I imported threw an error saying no contact group defined, so I imported the contactgroups.cfg, then I was able to import all my hosts so everything shows up now.

What's really interesting is that it looks like a lot of the hosts are reporting to the new server, because I'm showing green for a a bunch of the server services like Anti Virus, C: drive D: drive etc etc.

Guess we'll take a snapshot from here, play around with it see what else we can break.

Thanks for all your help guys, you rock. You can close this one.

Mahalo
Charles Masteller
Information Systems Specialist
Hawaii Health Systems Corp.
"No one will ever need more than 640K RAM". Bill Gates
Locked