Page 1 of 1

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

Posted: Tue Mar 13, 2012 12:56 am
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

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

Posted: Tue Mar 13, 2012 11:42 am
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

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

Posted: Fri Mar 16, 2012 4:43 am
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..

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

Posted: Fri Mar 16, 2012 9:52 am
by scottwilkerson
I see, I though you meant one by one verifying the files...

Glad you got it worked out.

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

Posted: Fri Mar 16, 2012 9:53 am
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.