How to import modified host and service files in DB from CLI

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
Satyam
Posts: 63
Joined: Mon Oct 24, 2011 8:14 am

How to import modified host and service files in DB from CLI

Post by Satyam »

Hi,

We are using NagiosXI, but still we prefer to do most of the things from CLI. Most often we are adding or removing some service from a no. of files and again we need to import these modified files into DB using NagiosXI UI. Its very difficult to search and import a large no. of these files using UI. Is there any way i can import these modified files into NagiosXI DB from command line without using NagiosXI User Interface.

Thanks,
Manish Kumar,
Mahindra Satyam, Tools Team
Thanks,
Sattanathan.S
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: How to import modified host and service files in DB from

Post by scottwilkerson »

At present I believe the best you can do would be to write the config files and then import them into XI through the web interface at Configure -> Core Config Manager -> Tools -> Import Config Files
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Satyam
Posts: 63
Joined: Mon Oct 24, 2011 8:14 am

Re: How to import modified host and service files in DB from

Post by Satyam »

Hi Scott,

I found it, it can be done.... :)

Copy all the modified files to the folder /usr/local/nagios/etc/import
And then run the script
/usr/local/nagiosxi/scripts/reconfigure_nagios.sh

And its's done, no need to waste your time in selecting the changed files from UI and then importing them. Thanks..
Thanks,
Sattanathan.S
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: How to import modified host and service files in DB from

Post by scottwilkerson »

I see, I though you meant one by one verifying the files...

Glad you got it worked out.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: How to import modified host and service files in DB from

Post by mguthrie »

You are correct, this is how our wizard import files as well. There are some limitations to importing this way, so I would suggest sticking to single Host->Service relationships for this method for the best results.
Locked