Changing Nagios XI Server IP

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

Re: Changing Nagios XI Server IP

Post by toleolu »

The old Nagios is Version 1.1.

Is there a trick to converting or importing the services from v1.1 to NagiosXI? Everything else came across and is correct, just no services.
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: Changing Nagios XI Server IP

Post by slansing »

When you imported your configuration files did you see the services.cfg listed in the configurations nagios was reading in? Did it show any errors?
toleolu
Posts: 294
Joined: Fri Jul 19, 2013 7:02 pm
Location: Honolulu Hawaii

Re: Changing Nagios XI Server IP

Post by toleolu »

Think I might have found the problem.

I have the original services.cfg file in /usr/local/nagios/etc/cfgprep/orig and I have a services.cfg in /usr/local/nagios/etc/cfgprep, only probably is, it's empty, nothing in that files. The one in /cfgprep/orig is correct, but the one in /cfgprep contains no data.

I don't have a services.cfg in usr/local/nagios/etc, but I do have servicedependencies, serviceescalations, serviceextinfo, servicegroups, and servicetemplates.cfg's in there. But they all just appear to be the default NagiosXI files.

Can I re run the import script just with the services.cfg file?
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: Changing Nagios XI Server IP

Post by slansing »

That shouldddddd be okay, I would follow the steps again with just your services.cfg file. Do you by chance know what is in there? Can you verify its not just localhost services, and it in fact has all of your services?
toleolu
Posts: 294
Joined: Fri Jul 19, 2013 7:02 pm
Location: Honolulu Hawaii

Re: Changing Nagios XI Server IP

Post by toleolu »

Here's a sample of what's in the current services.cfg file on the live v 1.1 system. This is how it appears in cfgprep/orig on the new Nagios XI system as well.

define service{
use generic-service ; Name of service template to use

host_name Svr3MCTX1
service_description Disk Usage C:
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups nt-admins
notification_interval 0
check_command check_nt_disk!C!90!95
}

That's one service for one particular host. In the case of the servers of course there would be an additional service defined to check the D: drive, E: drive etc. etc.

I'll delete the empty services.cfg file that's in cfgprep on the new Nagios XI server and try importing it again. I'll let you know what I get on that.

Mahalo
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: Changing Nagios XI Server IP

Post by lmiltchev »

I'll delete the empty services.cfg file that's in cfgprep on the new Nagios XI server and try importing it again. I'll let you know what I get on that.
Sure, let us know if you run into more issues.
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: Changing Nagios XI Server IP

Post by toleolu »

Shoot, same thing.

I deleted services.cfg from cfgprep, ran the import on just the services.cfg file in cfgprep/orig with no errors, but the new services.cfg in cfgprep is blank as well.

Is there anything in here that might be causing a problem with the import:

################################################################################
# Sample object config file for Nagios
#
# Read the documentation for more information on this configuration file. I've
# provided some comments here, but things may not be so clear without further
# explanation, so make sure to read the HTML documentation!
#
# Last Modified: 09-17-2002
#
################################################################################


################################################################################
# SERVICE DEFINITIONS
#
# SYNTAX:
#
################################################################################

# Generic service definition template
define service{
name generic-service ; The 'name' of this service template, referenced in other service definitions
active_checks_enabled 1 ; Active service checks are enabled
passive_checks_enabled 1 ; Passive service checks are enabled/accepted
parallelize_check 1 ; Active service checks should be parallelized (disabling this can lead to major performance problems)
obsess_over_service 1 ; We should obsess over this service (if necessary)
check_freshness 0 ; Default is to NOT check service 'freshness'
notifications_enabled 1 ; Service notifications are enabled
notification_period 24x7
# notification_options c,r
notification_options n
event_handler_enabled 1 ; Service event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts

register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
}
# Service definition

Everything after this is actual service definitions. Any ideas why this isn't importing properly? Could I have missed something on the sequence of the imported files when I intially imported them

Thanks
Thanks
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: Changing Nagios XI Server IP

Post by toleolu »

I tried importing everything from scratch again, and I still come up with same problem of services.cfg showing up as an empty file in /cfgprep. Does anyone have a solution for this?

I have to be honest, it's going to be a little difficult given the tight budgets with the state these days to justify the cost of Nagios XI if we're going to have to build everything from scratch.

Thanks for all your help.
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: Changing Nagios XI Server IP

Post by slansing »

Can you copy one of your actual definitions from that file and share it here? If it has sensitive information please block it out. I'm curious to see if there is something strange with how they are defined, a general rule of thumb for importing is configurations older than those created with nagios 3.2 can cause issues.

Are you receiving errors when running the prep tool on your services.cfg, be sure you are running the command when you are in the directory with the services.cfg file, and be sure this .cfg file has all of your services in it. "for example":

Code: Select all

php /usr/local/nagiosxi/tools/xiprepimport.php orig/services.cfg
After you run this, "your original services.cfg file will be completely empty" you should see additional .cfg files in the "orig" directory, they should go along the lines of "thisisahostname.cfg" Those files are now your services as each service in nagios XI has it's own cfg.
toleolu
Posts: 294
Joined: Fri Jul 19, 2013 7:02 pm
Location: Honolulu Hawaii

Re: Changing Nagios XI Server IP

Post by toleolu »

There's an actual copy of one of my definition files a couple of posts above.

I get no erros when I run the xiprepimport
Charles Masteller
Information Systems Specialist
Hawaii Health Systems Corp.
"No one will ever need more than 640K RAM". Bill Gates
Locked