Page 1 of 1

Is there a way to export NagiosXI tools data?

Posted: Fri Dec 14, 2018 2:11 am
by xpertech
Is there a way to export NagiosXI tools data?

Re: Is there a way to export NagiosXI tools data?

Posted: Fri Dec 14, 2018 11:04 am
by npolovenko
Hello, @xpertech. I believe backup-restore should take care of that.
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Other than that you could probably dump them from one database and import to another but that is not something we support or tested in the past.

Re: Is there a way to export NagiosXI tools data?

Posted: Sat Dec 15, 2018 5:48 am
by xpertech
Since the monitored hosts and services of the destination servers are owned by different departments, we need to offer a list of monitored hosts and services for different departments.

Re: Is there a way to export NagiosXI tools data?

Posted: Mon Dec 17, 2018 11:24 am
by scottwilkerson
The common tools (not user specific) are in the nagiosxi database

Code: Select all

select * from xi_options where name='commontools';

Re: Is there a way to export NagiosXI tools data?

Posted: Wed Dec 19, 2018 4:39 am
by xpertech
Is there a way to simply export monitored hosts & services list to a excel/csv file, or txt file?

Re: Is there a way to export NagiosXI tools data?

Posted: Wed Dec 19, 2018 3:24 pm
by tgriep
The following MYSQL query will create a csv file /tmp/hostservice.csv with a list of Host and Services that are running on the server.

Code: Select all

echo "select nagios.nagios_hosts.host_object_id, nagios.nagios_services.host_object_id, nagios_hosts.display_name, nagios_services.display_name from nagios.nagios_hosts inner join nagios.nagios_services on nagios.nagios_hosts.host_object_id = nagios.nagios_services.host_object_id;" | mysql -u root -pnagiosxi -B | sed "s/'/\'/;s/\t/\",\"/g;s/^/\"/;s/$/\"/;s/\n//g" >>/tmp/hostservice.csv
This should get you what you want.

Re: Is there a way to export NagiosXI tools data?

Posted: Thu Dec 20, 2018 1:19 pm
by xpertech
Hi tgriep,

The returned information of MYSQL query are not enough, we hope the csv file looks like the NagiosXI Tools returned information.

Re: Is there a way to export NagiosXI tools data?

Posted: Thu Dec 20, 2018 1:39 pm
by tgriep
Sorry, I do not have an SQL query that can gather all of the Host, Service, commands, etc. from the servers database and as far as I know, none exist.