Page 1 of 1
Export details in .csv / excel
Posted: Wed Feb 13, 2019 12:47 pm
by lrnnetops
Hi Team,
We wanted to export our nagios xi configured services configuration in .csv or excel in attached file format (
nagiosxi-config-output-sample.csv
).
Let us know how we will achieve this.
Regards,
Rohan
Re: Export details in .csv / excel
Posted: Wed Feb 13, 2019 5:22 pm
by cdienger
I think the command view is generated on the fly and not directly in the database, but other than that you can find the information in the nagiosql database. For example:
echo "select host_name,config_name,service_description,display_name,check_command from tbl_service INTO OUTFILE '/directory/to/output.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\n';" | mysql -uroot -pnagiosxi -Dnagiosql
note that the host_name and check_command need to be linked to the tbl_host and tbl_command tables in the same database. I haven't been able to figure this out yet, but hopefully the above gives you something to work with.