Importing configuration files into Nagios 4.1.1

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
kaplan71
Posts: 21
Joined: Tue Oct 25, 2011 9:59 am

Importing configuration files into Nagios 4.1.1

Post by kaplan71 »

Hello --

I have built a Core 4.1.1 server to replace an Icinga 1.x system, and I have the configuration files from the Icinga system, and they are the following:

cgi.cfg
cgiauth.cfg
checkcommands.cfg
commands.cfg
contactgroups.cfg
contacts.cfg
hostextinfo.cfg
hostgroups.cfg
hosts.cfg
printer.cfg
services.cfg
switch.cfg
templates.cfg
timeperiods.cfg
windows.cfg

Is there a way of importing these files into the current installation?

Thanks.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Importing configuration files into Nagios 4.1.1

Post by hsmith »

Icinga uses a slightly different format than us, I believe. I don't have experience with the product, so I can't tell you for sure... Can you cat some of the files and post it here, and we can tell you whether or not they are ready to be swapped?
Former Nagios Employee.
me.
kaplan71
Posts: 21
Joined: Tue Oct 25, 2011 9:59 am

Re: Importing configuration files into Nagios 4.1.1

Post by kaplan71 »

Hello --

Thank-you for your reply. Per your request, I am uploading several of the files.
Attachments
hosts.cfg.txt
(59.08 KiB) Downloaded 300 times
checkcommands.cfg.txt
(19.48 KiB) Downloaded 265 times
services_abridged.cfg.txt
(236.49 KiB) Downloaded 278 times
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Importing configuration files into Nagios 4.1.1

Post by hsmith »

Hi kaplan71,

The first file from a quick glance looks all right to me.
The second one concerns me, as /usr/lib/nagios/plugins/ is not the path we use. We use /usr/local/nagios/libexec for our plugins. Nothing a quick replace couldn't fix, though!
Third one seems to have the format all right as well.


Just keep in mind that you're going to want to make sure you bring the plugins over as well/redownload them, or you're going to have a mess.
Former Nagios Employee.
me.
kaplan71
Posts: 21
Joined: Tue Oct 25, 2011 9:59 am

Re: Importing configuration files into Nagios 4.1.1

Post by kaplan71 »

Hello --

I am going through the motions of importing the files, and so far I have successfully added the checkcommands, contactgroups, and hosts configuration files.

The hostextinfo.cfg file is the first to give me an error condition. After it was brought into the system the preflight check was run and the following error message appeared repeatedly on-screen:
WARNING: Extinfo objects are deprecated and will be removed in future versions
Should I not bother with the file as a whole, or what setting(s) within the file can be changed to eliminate this error?

Thanks.
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Importing configuration files into Nagios 4.1.1

Post by eloyd »

The warning is simply telling you that Extinfo records are old style entries, and the ability to use them may be removed in the future. It should work regardless of this error.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Importing configuration files into Nagios 4.1.1

Post by hsmith »

Thanks Eric.

Everything going all right, @kaplan71?
Former Nagios Employee.
me.
kaplan71
Posts: 21
Joined: Tue Oct 25, 2011 9:59 am

Re: Importing configuration files into Nagios 4.1.1

Post by kaplan71 »

Hello --

Just about. I was able to get the files configured, and the server is monitoring the clients. The only thing that does not seem to working is the email notifications.

I configured my address in the contacts.cfg file, and all services have notifications enabled. I verified that sendmail and mailx client are installed on the server,
and I was able to send a test message to my account.

What other file(s) do I need to modify to correct this?

Thanks.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Importing configuration files into Nagios 4.1.1

Post by Box293 »

When you go to a host or service and "Submit a custom notification" do you receive the notification?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
kaplan71
Posts: 21
Joined: Tue Oct 25, 2011 9:59 am

Re: Importing configuration files into Nagios 4.1.1

Post by kaplan71 »

Hello --

I went to the GUI and did the custom notification steps for a host and service, but I did not receive the notification in either case.

While I was in the GUI I noticed the Passive Checks and Event Handler options were disabled. Should those be activated in order
for the e-mail notification to work?

Regarding the contacts.cfg file, here is what I have as the configuration:
define contact{
contact_name nagiosadmin ; Short name of user
use generic-contact ; Inherit default values from generic-contact template (defined above)
alias Nagios Admin ; Andrew Kaplan
service_notification_period 24x7
host_notification_period 24x7
service_notification_options c,r
host_notification_options d,u,r
service_notification_commands notify-by-email
host_notification_commands host-notify-by-email

email [email protected] ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
}

define contact{
contact_name ahk ; Short name of user
use generic-contact ; Inherit default values from generic-contact template (defined above)
alias Andrew Kaplan ; Andrew Kaplan
service_notification_period 24x7
host_notification_period 24x7
service_notification_options c,r
host_notification_options d,u,r
service_notification_commands notify-by-email
host_notification_commands host-notify-by-email
email [email protected] ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
}
Shown below is a typical entry from the services.cfg file:
define service {
service_description Check CPU Statistics
check_command check_nrpe!check_cpu_stats
host_name cosmos1
check_period 24x7
notification_period 24x7
contact_groups linux-admins
event_handler_enabled 0
active_checks_enabled 1
passive_checks_enabled 0
notifications_enabled 1
check_freshness 0
freshness_threshold 86400
use generic-service
}
Locked